What are best practices for migrating my ElastiCache for Redis cluster?

3 minute read
0

What best practices should I use when migrating my Amazon ElastiCache for Redis cluster?

Short description

Amazon ElastiCache currently supports offline methods using backup to migrate an ElastiCache Redis cluster within a Region, across Regions in the same account, or across accounts.

Note: For information on migrating a Redis cluster on an Amazon Elastic Compute Cloud (Amazon EC2) instance to ElastiCache, see Online migration to ElastiCache.

Resolution

Migrate an ElastiCache Redis cluster within a Region

1.    Create an ElastiCache backup of your ElastiCache for Redis cluster. Review the backup constraints before creating your backup.

2.    Creating a new Redis cluster by restoring for the backup.

Note: This method can be used to migrate an ElastiCache for Redis cluster to a different Availability Zone within a Region. Or, you can use it to turn on in-transit encryption or at-rest encryption for an existing cluster.

Migrate an ElastiCache Redis cluster to a different Region

1.    Create an ElastiCache backup of your ElastiCache for Redis cluster. Review the backup constraints before creating your backup.

2.    Create an Amazon Simple Storage Service (S3) bucket in the same AWS Region as the Redis cluster.

3.    Grant ElastiCache access to the S3 bucket.

4.    Export the ElastiCache Backup to the S3 bucket.

5.    Create anS3 bucket in your destination Region.

6.    Install and configure the AWS Command Line Interface (AWS CLI).

Configure the AWS CLI by running the following command:

aws configure

Enter access keys (access key ID and secret access key) of your AWS Identity and Access Management (IAM) user or role.

7.    Use the AWS CLI to copy the .rdb backup file from the source Region's S3 bucket to the destination Region's S3 bucket:

aws s3 cp s3://SourceBucketName/BackupName.rdb  s3://DestinationBucketName/BackupName.rdb --acl bucket-owner-full-control   --source-region SourceRegionName --region DestinationRegionName

8.    In the destination Region, go to the Amazon S3 console and grant ElastiCache read access to the .rdb file.

9.    Create an ElastiCache for Redis cluster by seeding the cluster with the .rdb file.

Migrate an ElastiCache Redis cluster to a different account

1.    Create a backup of your cluster. Review the backup constraints before creating your backup.

2.    Create an Amazon S3 bucket in the same AWS Region as the Redis cluster.

3.    Grant ElastiCache access to the S3 bucket.

4.    Export the ElastiCache backup to the S3 bucket.

5.    Create an S3 bucket in your destination account. The bucket must be in the same Region as the Redis cluster.

6.    Install and configure the AWS Command Line Interface (AWS CLI).

Configure the AWS CLI by running the following command:

aws configure

Enter access keys (access key ID and secret access key) of your source account's AWS Identity and Access Management (IAM) user or role.

7.    Copy the .rdb backup file from the source account's S3 bucket to the destination account's S3 bucket.

Note: If the source and destination Regions are different, copy the .rdb file using the following command:

aws s3 cp s3://SourceAccountBucketName/BackupName.rdb  s3://DestinationAccountBucketName/BackupName.rdb --acl bucket-owner-full-control  --source-region SourceRegionName --region DestinationRegionName

8.    In the destination account, open the Amazon S3 console and grant ElastiCache read access to the .rdb file.

9.    Create an ElastiCache for Redis cluster by seeding the cluster with the .rdb file.


AWS OFFICIAL
AWS OFFICIALUpdated 2 years ago
1 Comment

thanks for answer, successfully migrate to different account.

replied a year ago