Migrate Redis data to a Redis Managed Database using RedisShake
You can migrate Redis and Valkey data to Selectel with continuous synchronization and minimal downtime using RedisShake.
RedisShake connects to the source Redis as a replica. It first transfers a data snapshot (RDB) and an append-only file (AOF), and then continuously streams new changes to the target Redis until synchronization is stopped. Applications can be switched to the new Redis during data synchronization, minimizing service downtime.
This method is suitable for migration between sites and within the same environment, supporting various topologies, including Redis with Sentinel.
For data migration using RedisShake, Redis versions from 2.8 to 7.4 are supported. We recommend that the source and target Redis versions match.
Requirements
For small RedisShake installations, a configuration of 2 CPUs, 4 GB RAM, and 10 GB disk space is sufficient. Disk space depends on the size of the RDB and AOF files (parameters sync_rdb and sync_aof). For large amounts of data, we recommend estimating the required CPU performance based on benchmarks in the RedisShake documentation.
Additionally, you will need:
- network access from the RedisShake environment to the source and target Redis;
- RedisShake 4.x;
- Docker and Docker Compose or a Kubernetes cluster if RedisShake is run in a container.
Migrate data
-
Optional: check the migration status.
1. Install RedisShake
-
Download the binary from the RedisShake repository on GitHub. You can also pull the Docker image:
docker pull ghcr.io/tair-opensource/redisshake:latest -
If Redis is password-protected, pass it:
redis-cli -h 127.0.0.1 -p 6379 -a '<password>'Specify
<password>— Redis password. -
Make sure that the source Redis is accessible from the environment where RedisShake will run:
redis-cli -h <host> -p <port> pingtelnet <host> <port>Specify:
<host>— Redis address;<port>— default Redis port.
-
Check the cluster status and node list for Redis Cluster:
redis-cli -h <host> -p <port> cluster inforedis-cli -h <host> -p <port> cluster nodesSpecify:
<host>— Redis address;<port>— default Redis port.
-
Check memory usage:
redis-cli -h <host> -p <port> info memorySpecify:
<host>— Redis address;<port>— default Redis port.
-
Repeat steps 3–5 to check the target Redis.
2. Configure RedisShake
-
Open the CLI.
-
Open the
shake.tomlfile in a text editor. -
Set synchronization parameters. If the source or target Redis is Redis Cluster, specify
cluster = truefor it. For a complete reference ofshake.tomlparameters, see the RedisShake repository on GitHub.
Redis → Redis
Redis with Sentinel → Redis
Redis → Redis with Sentinel
General parameters
[sync_reader]
cluster = false
address = "<source_address>:6379"
username = ""
password = ""
tls = false
sync_rdb = true
sync_aof = true
# prefer_replica = false
# try_diskless = false
[redis_writer]
cluster = false
address = "<target_address>:6379"
username = ""
password = ""
tls = false
off_reply = false
Specify:
<source_address>— source Redis address;<target_address>— target Redis address.
3. Start synchronization
Before starting, check that the configuration file shake.toml is populated and located in the correct path.
Docker Compose
Docker
Binary
Kubernetes
-
Open the CLI.
-
Prepare
docker-compose.yaml:services:redis-shake:image: ghcr.io/tair-opensource/redisshake:latestcontainer_name: redis-shakevolumes:- ./shake.toml:/app/shake_sync_env.toml:ro- ./data:/app/dataenvironment:SYNC: "true" -
Run Docker Compose:
docker compose up -d
4. Optional: Check migration status
During synchronization, RedisShake continuously writes status and current operations to the log. You can use the log to track how many changes are still remaining.
-
Open the CLI.
-
Enable real-time display of RedisShake logs:
tail -f data/shake.log -
Verify the number of keys in the source and target Redis:
redis-cli -h <source_host> -p <source_port> dbsizeredis-cli -h <target_host> -p <target_port> dbsizeSpecify:
<source_host>— source Redis address;<source_port>— source Redis port;<target_host>— target Redis address;<target_port>— target Redis port.
5. Complete migration
-
Switch applications to the new Redis while synchronization is still running. This ensures that changes made prior to the switch are not lost.
-
When all data has been transferred, stop RedisShake using the same method you used to start it.
Docker Compose
Docker
Binary
Kubernetes
-
Open the CLI.
-
Stop and remove containers:
docker compose down