skip to Main Content

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

2

Answers


  1. 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: –

    1. List the keys you need to migrate

    2. Dump them all

    3. Move over the dumped data

    4. 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.

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search