{ "MIGRATE": { "summary": "Atomically transfer a key from a Redis instance to another one.", "complexity": "This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed.", "group": "generic", "since": "2.6.0", "arity": -6, "function": "migrateCommand", "get_keys_function": "migrateGetKeys", "history": [ [ "3.0.0", "Added the `COPY` and `REPLACE` options." ], [ "3.0.6", "Added the `KEYS` option." ], [ "4.0.7", "Added the `AUTH` option." ], [ "6.0.0", "Added the `AUTH2` option." ] ], "command_flags": [ "WRITE", "RANDOM" ], "acl_categories": [ "KEYSPACE", "DANGEROUS" ], "key_specs": [ { "flags": [ "WRITE" ], "begin_search": { "index": { "pos": 3 } }, "find_keys": { "range": { "lastkey": 0, "step": 1, "limit": 0 } } }, { "flags": [ "WRITE", "INCOMPLETE" ], "begin_search": { "keyword": { "keyword": "KEYS", "startfrom": -2 } }, "find_keys": { "range": { "lastkey": -1, "step": 1, "limit": 0 } } } ], "arguments": [ { "name": "host", "type": "string" }, { "name": "port", "type": "string" }, { "name": "key_or_empty_string", "type": "oneof", "arguments": [ { "name": "key", "type": "key", "key_spec_index": 0 }, { "name": "empty_string", "type": "pure-token", "token": "\"\"" } ] }, { "name": "destination-db", "type": "integer" }, { "name": "timeout", "type": "integer" }, { "name": "copy", "token": "COPY", "type": "pure-token", "optional": true }, { "name": "replace", "token": "REPLACE", "type": "pure-token", "optional": true }, { "token": "AUTH", "name": "password", "type": "string", "optional": true }, { "token": "AUTH2", "name": "username_password", "type": "block", "optional": true, "arguments": [ { "name": "username", "type": "string" }, { "name": "password", "type": "string" } ] }, { "token": "KEYS", "name": "key", "type": "key", "key_spec_index": 1, "optional": true, "multiple": true } ] } }