As you noticed, Elasticache does not support the SLAVEOF command , so you cannot just add the Elasticache node to your existing cluster and then push it to the primary node / disconnect the existing cluster.
Instead, to migrate your Redis cluster, you must create a snapshot using BGSAVE or SAVE to create a .rdb snapshot.
Then you should upload this snapshot file to S3 and allow Elasticache access to the file:
To provide access to an ElastiCache snapshot for a snapshot copied to Amazon S3
Log in to the AWS management console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ .
Click All Buckets, and then click the name of the Amazon S3 bucket that contains your .rdb file.
Click the name of the folder containing your .rdb file.
Click your .rdb file name, select the Actions drop-down menu, and then select Properties.
Click Permissions, and then click Add Advanced Permissions.
In the "Grantee" field, enter this email address: aws-scs-s3-readonly@amazon.com.
It is important to connect to a specific region of the canonical ID for the following regions and not aws-scs-s3-readonly@amazon.com : China (Beijing): b14d6a125bdf69854ed8ef2e71d8a20b7c490f252229b806e514966e490b8d83 EU (Frankfurt) Region: 540804c33a284a299d2547575ce1010f2312ef3da9b3a053c8bc45bf233e4353 AWS GovCloud (US): 40fa568277ad703bd160f66ae4f83fc9dfdfd06c2f1b5060ca22442ac3ef8be6 Note. The snapshot should be located in the GovCloud S3 bucket for you to upload it to the GovCloud Redis cluster. Please note The aws-scs-s3-readonly@amazon.com account is used exclusively for customers downloading Redis snapshot data from Amazon S3.
- Click "Open / Download" and then click "Save."
After that, just create a new Elasticache cluster with Redis support and in the configuration section you must specify the S3 location of your snapshot file.
This will launch your new Elasticache cluster with your existing cluster data taken from the snapshot, but obviously you will still have to deal with downtime, data loss, or you will have to devise a way to reproduce the AOF log in the Elasticache cluster using something like this play tool .
Amazon docs are discussed in more detail here .
source share