Recently, I have a issue can't move data include: key and value from this server redis to server redis other. How way do it? Please help me. Best regards
CodePudding user response:
If you have access to the Redis servers you can use a combination of the commands available here: -
https://redis.io/commands/keys
https://redis.io/commands/dump
https://redis.io/commands/restore
https://redis.io/commands/migrate
I tend to keep track of the keys I have set so I can flush REDIS if I need to.
Someone else with a deeper knowledge may have a better way, but I would either: -
List the keys you need to migrate
Dump them all
Move over the dumped data
Restore them all on the new server
OR
Use the MIGRATE command like this (quoted from the REDIS.IO site)
Migrating multiple keys with a single command call Starting with Redis 3.0.6 MIGRATE supports a new bulk-migration mode that uses pipelining in order to migrate multiple keys between instances without incurring in the round trip time latency and other overheads that there are when moving each key with a single MIGRATE call.
CodePudding user response:
If you don't have access to the server and want to do a live migration you can use RIOT. There is more information in the Redis->Redis Cookbook and documentation