Migrate Redis data with RIOT

Posted . Visible to the public. Repeats.

Ever needed to migrate data between Redis instances? Give RIOT - Redis Input/Output Tools Show archive.org snapshot a try. It supports migration to different versions and supports AWS ElastiCache.

Replication mode

Replicates all data from source to target.

Caution

Target data will be overwriten!

./riot replicate "$SOURCE_HOST:$SOURCE_PORT" "$TARGET_HOST:$TARGET_PORT"
Scanning 100% [====================================================] 2630/2630 (0:00:02 / 0:00:00) 1315.0/s
Comparing 100% [===================================================] 2630/2630 (0:00:01 / 0:00:00) 2630.0/s

File import/export

Caution

Target data will also be overwriten!

# Create dump
./riot file-export -h 127.0.0.1 -p 6379 dump.json
Exporting 100% [====================================================] 2630/2630 (0:00:02 / 0:00:00) 1315.0/s

# Restore dump
./riot file-import -u "$REDIS_URL_TARGET" dump.json
Importing dump.json  ? % [                      =                              ] 2630/? (0:00:02 / ?) 1315.0/s
Andreas Vöst
Last edit
Andreas Vöst
License
Source code in this card is licensed under the MIT License.