Skip to Content

Data Migration

master-replica Redis Data Migration

UDTS Migration

UDTS can use Redis as a data source/target for full plus incremental task transmission.

Note:

  1. When the Redis source is on the public network and is in cluster mode, you need to bind the subnet ID in the destination VPC to NATGW to complete the transmission task.

  2. Ensure that the repl-diskless-sync configuration of the source library is set to NO.

Detailed documentation: https://docs.ucloud.cn/udts/type/redissource

redis-port Migration

master-replica redis-port data synchronization, import and export tool.

Redis3.2 and below versions

Download Link: https://redis-import-tool.cn-bj.ufileos.com/uredis-redis-port

1、master-replica Redis synchronization import and export

./uredis-redis-port sync --psync -f source_ip:source_port -P PASSWORD -t dest_ip:dest_port -A PASSWORD

If the following result appears, it means that the synchronization is complete and incremental synchronization is being maintained.

2、master-replica Redis export RDB data file

./uredis-redis-port dump -f source_ip:source_port -P PASSWORD -o save.rdb

3、master-replica Redis import RDB data file

./uredis-redis-port restore -i save.rdb -t dest_ip:dest_port -A PASSWORD

4、master-replica Redis import AOF data file

redis-cli -h dest_ip -p dest_port -A PASSWORD --pipe < appendonly.aof

Note: For distributed Redis and master-replica Redis migration, please submit non-standard requirements, and we will carry out synchronous migration in the background.

Redis4.0 version

Download link: https://umemsh2.cn-sh2.ufileos.com/redis-port_4.0.tar

The usage is as follows:

1 redis-decode: DECODE dumped payload to human readable format (hex-encoding)

Usage: redis-decode [--ncpu=N] [--input=INPUT|INPUT] [--output=OUTPUT] Examples: redis-decode -i dump.rdb -o dump.log redis-decode dump.rdb -o dump.log cat dump.rdb | redis-decode --ncpu=8 > dump.log

2 redis-dump: DUMP rdb file from master redis

Usage: redis-dump [--ncpu=N] (--master=MASTER|MASTER) [--output=OUTPUT] [--aof=FILE] Examples: redis-dump 127.0.0.1:6379 -o dump.rdb redis-dump 127.0.0.1:6379 -o dump.rdb -a redis-dump -m passwd@192.168.0.1:6380 -o dump.rdb -a dump.aof

3 redis-restore: RESTORE rdb file to target redis

Usage: redis-restore [--ncpu=N] [--input=INPUT|INPUT] --target=TARGET [--aof=FILE] [--db=DB] [--unixtime-in-milliseconds=EXPR] Examples: redis-restore dump.rdb -t 127.0.0.1:6379 redis-restore -i dump.rdb -t 127.0.0.1:6379 --aof dump.aof --db=1 redis-restore -t 127.0.0.1:6379 --aof dump.aof redis-restore -t 127.0.0.1:6379 --db=0

4 redis-sync: SYNC data from master to slave

Usage: redis-sync [--ncpu=N] (--master=MASTER|MASTER) --target=TARGET [--db=DB] [--tmpfile-size=SIZE [--tmpfile=FILE]] Examples: redis-sync -m 127.0.0.1:6379 -t 127.0.0.1:6380 redis-sync 127.0.0.1:6379 -t passwd@127.0.0.1:6380 redis-sync 127.0.0.1:6379 -t passwd@127.0.0.1:6380 --db=0