# RESTORE-ASKING

```json metadata
{
  "schema_version": 2,
  "title": "RESTORE-ASKING",
  "description": "An internal command for migrating keys in a cluster.",
  "categories": ["docs","develop","stack","oss","rs","rc","oss","kubernetes","clients"],
  "arguments": [{"display_text":"key","key_spec_index":0,"name":"key","type":"key"},{"display_text":"ttl","name":"ttl","type":"integer"},{"display_text":"serialized-value","name":"serialized-value","type":"string"},{"display_text":"replace","name":"replace","optional":true,"since":"3.0.0","token":"REPLACE","type":"pure-token"},{"display_text":"absttl","name":"absttl","optional":true,"since":"5.0.0","token":"ABSTTL","type":"pure-token"},{"display_text":"seconds","name":"seconds","optional":true,"since":"5.0.0","token":"IDLETIME","type":"integer"},{"display_text":"frequency","name":"frequency","optional":true,"since":"5.0.0","token":"FREQ","type":"integer"}],
  "syntax_fmt": "RESTORE-ASKING key ttl serialized-value [REPLACE] [ABSTTL]\n  [IDLETIME seconds] [FREQ frequency]",
  "complexity": "O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).",
  "group": "server",
  "command_flags": ["write","denyoom","asking"],
  "acl_categories": ["@keyspace","@write","@slow","@dangerous"],
  "since": "3.0.0",
  "arity": -4,
  "key_specs": [{"OW":true,"begin_search":{"spec":{"index":1},"type":"index"},"find_keys":{"spec":{"keystep":1,"lastkey":0,"limit":0},"type":"range"},"update":true}],
  "tableOfContents": {"sections":[{"id":"required-arguments","title":"Required arguments"},{"id":"optional-arguments","title":"Optional arguments"},{"id":"redis-software-and-redis-cloud-compatibility","title":"Redis Software and Redis Cloud compatibility"},{"id":"return-information","title":"Return information"}]}

,
  "codeExamples": []
}
```

The `RESTORE-ASKING` command is an internal command.
It is used by a Redis cluster master during slot migration.

## Required arguments

<details open><summary><code>key</code></summary>

The name of the key to create.

</details>

<details open><summary><code>ttl</code></summary>

The time to live for the key, in milliseconds. `0` means no expiration. With `ABSTTL`, this is an absolute Unix timestamp in milliseconds.

</details>

<details open><summary><code>serialized-value</code></summary>

The serialized value, as produced by `DUMP`.

</details>

## Optional arguments

<details open><summary><code>REPLACE</code></summary>

Replace the key if it already exists.

</details>

<details open><summary><code>ABSTTL</code></summary>

Interpret `ttl` as an absolute Unix timestamp in milliseconds rather than a relative time.

</details>

<details open><summary><code>IDLETIME seconds</code></summary>

Set the key's idle time (for LRU eviction) to this many seconds.

</details>

<details open><summary><code>FREQ frequency</code></summary>

Set the key's access-frequency counter (for LFU eviction) to this value.

</details>

## Redis Software and Redis Cloud compatibility

| Redis<br />Software | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
|:----------------------|:-----------------|:------|
| <span title="Not supported">&#x274c; Standard</span><br /><span title="Not supported"><nobr>&#x274c; Active-Active</nobr></span> | <span title="Not supported">&#x274c; Standard</span><br /><span title="Not supported"><nobr>&#x274c; Active-Active</nobr></span> |  |

## Return information

**RESP2:**

[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`.

**RESP3:**

[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`.



