Riot

Data Migration Modes

Roit supports various migration modes:

  1. Real-time replication using dump and restore.
  2. Type-based replication.


Installation

You need to run the following commands in your local terminal or container.

Linux

Download the precompiled Roit binary from GitHub, unzip it, and copy it to the desired location.

1wget https://github.com/redis-developer/riot/releases/download/v3.1.5/riot-standalone-3.1.5-linux-x86_64.zip
2
3unzip riot-standalone-3.1.5-linux-x86_64.zip -d ~/riot
4cd ~/riot/riot-standalone-3.1.5-linux-x86_64
5./bin/riot --help
WARNING

⚠️ Note : The Roit binary includes the necessary Java runtime, so you do not need to install Java JDK separately.

macOS

1brew install redis-developer/tap/riot

Docker

1docker run fieldengineering/riot [OPTIONS] [COMMAND]

Migration Example

Some basic parameters:

1riot replicate --help
2
3-h, --hostname
4Server hostname
5
6-p, --port
7Server port
8
9-c, --cluster
10Enable cluster mode
11
12-n, --db
13Database number
14
15-a, --pass
16Password to use when connecting to the server
17
18--mode
19Replication mode.
20
211. snapshot: Initial replication using key scan.
22
232. live: Initial and continuous replication using key scan and keyspace notifications in parallel. See Live Replication for details.
24
253. liveonly: Continuous replication using keyspace notifications (only changed keys are replicated).
26
274. compare: Compare source and target keys
28
29--type
30Replication strategy (default: dump).
31
32dump: Dump & Restore.
33
34ds: Type-based Replication.

Real-time Replication

No password, non-cluster, single DB, single full migration execution.

1# Command line
2./riot -h <source host> -p <source port> replicate -h <target host> -p <target port>
3
4# Docker
5docker run fieldengineering/riot -h <source host> -p <source port> replicate -h <target host> -p <target port>

The source host is the address from which you want to migrate data, and the target is the port of your Montplex Serverless cache instance. Example :

1mdawmtawmdm4oa.engula-aliyun-cn-beijing.montplex.net

Full command:

1docker run fieldengineering/riot -h 172.31.0.22 -p 6379 -a testpwd replicate -h mdawmtawmdm4oa.engula-aliyun-cn-beijing.montplex.net -p 8125 -a <YOUR PASSWORD>

After running the above command, you can see the runtime logs in the console as shown below:

1Listening  ? % [  =             ] 646642/? (0:25:00 / ?) 431.1/s | 19,165 queued
2Listening  ? % [ =              ] 650193/? (0:25:01 / ?) 433.2/s | 92,328 queued
3Listening  ? % [        =      ] 653393/? (0:25:02 / ?) 435.0/s | 172,395 queued
4Listening  ? % [             = ] 654043/? (0:25:03 / ?) 435.2/s | 223,762 queued
5Listening  ? % [        =      ] 655043/? (0:25:04 / ?) 435.5/s | 304,991 queued

Full Migration and Real-time Sync for Clusters

1docker run fieldengineering/riot -h <source host> -p <source port> -a <passwd> -c replicate --type ds -h <target host> -p <target port> -a <passwd> -c --mode live
INFO

TIPS: --mode live, you must modify the source Redis configuration first.

For cloud databases like Redis, refer to Modify parameters of ApsaraDB for Redis。 For Amazon Cloud ElastiCache, refer to Modify parameters of ElastiCache

If the source Redis is your self-hosted instance, you can modify the parameters as follows:

1config set notify-keyspace-events KA

Type-based Replication

Sometimes the source and target Redis versions are inconsistent, or for other reasons such as:

  1. The target Redis database does not support the RESTORE command (Redis Enterprise CRDB).
  2. The DUMP format is incompatible between the source and target (e.g., Redis 7.0).

You can add the --type ds option to the command as shown below:

1docker run fieldengineering/riot -h <source host> -p <source port> replicate --type ds -h <target host> -p <target port> --mode live

For more detailed information, please refer to Riot.