I currently have a live redis server running on a cloud instance and I want to migrate this redis server to a new cloud instance and use that instance as my new redis server. If it were MySQL, I would export the DB from the old server and import it into the new server. How should I do this with redis?
P.S.: I'm not looking to set-up replication. I want to completely migrate the redis server to a new instance.
Best Answer
First, create a dump on server A.
This ensures
dump.rdb
is completely up-to-date, and shows us where it is stored (/var/lib/redis/dump.rdb
in this case).dump.rdb
is also periodically written to disk automatically.Next, copy it to server B:
Stop the Redis server on B, copy dump.rdb (ensuring permissions are the same as before), then start.
The version of Redis on B must be greater or equal than that of A, or you may hit compatibility issues.