Nyway to restore a dump.rdb redis backup file remotely

redis

i have written some Golang code to backup a bunch of Redis clusters
the only way i have found to restore these backups is to copy the dump.rdb file in a certain directory and restart the Redis instance
the instances are docker containers and volumes are set for persistence
is there any way to restore a dump.rdb file remotely
any tools that can help?

Best Answer

If loading the rdb upon container startup is not an option for you, it is possible to transform the rdb file into redis protocol and import the raw protocol.

  1. Make sure you have redis-rdb-tools available.
  2. scp source-redis:/data/dump.rdb ./dump.rdb
  3. rdb -c protocol dump.rdb > ./dump.protocol
  4. scp ./dump.protocol target-redis:/data/dump.protocol
  5. ssh target-redis -C 'redis-cli --pipe < /data/dump.protocol'
Related Topic