Sample Header Ad - 728x90

How to restore a docker container redis dump file to Elasticache ( newly created )

0 votes
0 answers
42 views
**Situation :** I have a redis docker container running on local with some data of different kinds : Set, Hash, GeoHash. **Want to :** Move the data from local redis container to a newly created Elasticache instance ( Cluster mode Disabled ) **Tried :** **Approach 1 :** Created a rdb file of local docker container data with : `sudo docker exec -it bash redis-cli `save. This creates dump.rdb in /data Copied rdb file on local from container Copied rdb file to EC2 instance which is running in same VPC, Subnets as of Elasticache Ran : cat dump.rdb | redis-cli -h .cache.amazonaws.com -p 6379 --pipe This fails with : >All data transferred. Waiting for the last reply... \ >ERR unknown command 'REDIS0012', with args beginning with: 'redis-ver7.4.1'\ >ERR unknown command 'redis-bits@ctime$used-mem', with args beginning with: Last reply received from server. \ >errors: 2, replies: 2 **Approach 2 :** While creating new Elasticache instance, there is an option to restore from backup ( below image ), this also fails with the local redis generated rdb file. Seems like this only works with Elasticache generated backups only. Don't know for sure, just a guess. enter image description here Question : How to take backup of a docker running redis instance & create a Elasticache instance with the same data ? Please help with this, Thanks.
Asked by Harsh.K (1 rep)
Nov 2, 2024, 05:35 AM
Last activity: Nov 3, 2024, 06:21 PM