Sync Redis instances with `rst` and `rmt`
masterThe tool provides two primary ways to move data between Redis instances.
rst (Continuous Sync)
rst migrates an initial RDB snapshot and then continuously syncs incremental data changes. It runs until manually stopped.
- Use case: Real-time synchronization or keeping a replica updated.
- Limitation: Only supports filtering by
dbindex.
# Sync two instances
$ rst -s redis://127.0.0.1:6379 -m redis://127.0.0.1:6380 -r
# Sync a single instance to a Redis Cluster
$ rst -s redis://127.0.0.1:6379 -m redis://127.0.0.1:30001 -r -d 0rmt (One-time Migration)
rmt performs a BGSAVE on the source to generate a snapshot, migrates that snapshot to the target, and then terminates.
- Use case: One-time data migration.
# Migrate RDB file to a remote Redis instance
$ rmt -s /path/to/dump.rdb -m redis://192.168.1.105:6379 -r
# Migrate RDB to a remote Redis Cluster using nodes.conf
$ rmt -s /path/to/dump.rdb -c ./nodes-30001.conf -r$ rst -s redis://127.0.0.1:6379 -m redis://127.0.0.1:6380 -r