Author Topic: migrate and export redis on prem and restore to AWS elasticache  (Read 1788 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
migrate and export redis on prem and restore to AWS elasticache
« on: มกราคม 28, 2022, 09:47:22 PM »
migrate and export redis on prem and restore to AWS elasticache

======Example: Redis Backup ==> https://www.w3resource.com/redis/redis-backup.php
The example given below creates the backup of the current database.
127.0.0.1:6379> SAVE
OK
This command will create the dump.rdb file in your redis directory.

Restore:
CONFIG GET
To restore redis data just move redis backup file (dump.rdb) into your redis directory and start the server. To get your redis directory use CONFIG command can be used. The CONFIG GET command is used to read the configuration parameters of a running Redis server.
127.0.0.1:6379> CONFIG get dir
1) “dir"
2) "/var/lib/redis/6379”
In the output of above command "/var/lib/redis/6379" is the directory, where redis server is installed.

==== restore .rdb to AWS elastic ache  https://github.com/leonchen83/redis-rdb-cli
apt-get install openjdk-8-jdk
wget https://github.com/leonchen83/redis-rdb-cli/releases/download/v0.7.4/redis-rdb-cli-release.zip
unzip redis-rdb-cli-release.zip
cd ./redis-rdb-cli/bin
./rmt -h

==connect via stunnel4 need to connect via stunnel
./rmt -s dump.rdb -m redis://172.31.20.105:6374 -r
get golf2
or
./rmt -s dump.rdb -m redis://172.31.20.105:6374 -t list -d 0
 \[    5 B|    3 B/s]