Is it possible to copy all keys from one Redis instance to another remote instance using MIGRATE
? I\'ve tried COPY
, REPLACE
and KEYS
This is an improvement on the answer provided by @ezain since I am unable to post comments. The command uses the correct redis syntax for processing batches of keys, but the arguments to xargs
result in the command being called once for every key instead of just once with all the keys included (which means it'll take much more time to complete than is necessary). The following will be much faster in all cases:
redis-cli --raw KEYS '*' | xargs redis-cli MIGRATE my.redis 6379 "" 0 5000 KEYS
If the destination is password protected:
redis-cli --raw KEYS '*' | xargs redis-cli MIGRATE my.redis 6379 "" 0 5000 AUTH password-here KEYS