How do I migrate my ElastiCache for Redis self-designed cluster within a Region, cross Region, or to a different account?

4 minute read
0

I want to migrate my Amazon ElastiCache for Redis self-designed cluster within an AWS Region, to a different Region, or to a different account.

Short description

To perform an offline migration of an ElastiCache for Redis self-designed cluster within a Region, to a different Region, or different account, use a backup.

To perform an online migration of a self-designed cluster on an Amazon Elastic Compute Cloud (Amazon EC2) instance to ElastiCache, see Online migration to ElastiCache.

Resolution

Migrate an ElastiCache for Redis self-designed cluster within a Region

Complete the following steps:

  1. Create an ElastiCache backup of your ElastiCache for Redis cluster.
    Note: Before you create your backup, review the backup constraints.
  2. To create a new ElastiCache for Redis cluster, restore the cluster from a backup into a new cache.

Note: You can use the preceding steps 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. Also, use the preceding steps to switch from a cluster with cluster mode turned off to a cluster with cluster mode turned on.

Migrate an ElastiCache for Redis self-designed cluster to a different Region

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

Complete the following steps:

  1. Create an ElastiCache backup of your ElastiCache for Redis cluster.
    Note: Before you create your backup, review the backup constraints.

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

  3. Grant ElastiCache access to the Amazon S3 bucket.

  4. Export the ElastiCache backup to the Amazon S3 bucket.

  5. Create an Amazon S3 bucket in your destination Region.

  6. Enter the 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 Amazon S3 bucket to the destination Region's Amazon S3 bucket:
    Note: Replace example-source-bucket with the source bucket name, example-destination-bucket with the destination bucket name, example-source-region with the source Region, and example-destination-region with the destination Region.

    aws s3 cp s3://example-source-bucket/example-backup.rdb s3://example-destination-bucket/example-backup.rdb --acl bucket-owner-full-control   --source-region example-source-region --region example-destination-region
  8. In the destination Region, open the Amazon S3 console, and then grant ElastiCache read access to the .rdb file.

  9. To create an ElastiCache for Redis cluster, seed the cluster with the .rdb file.

Migrate an ElastiCache for Redis self-designed cluster to a different account

Note: If you receive errors when you run AWS CLI commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

Complete the following steps:

  1. Create an ElastiCache backup of your ElastiCache for Redis cluster.
    Note: Before you create your backup, review the backup constraints.

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

  3. Grant ElastiCache access to the S3 bucket.

  4. Export the ElastiCache backup to the S3 bucket.

  5. Create an Amazon S3 bucket in your destination account.
    Note: Make sure that the bucket is in the same Region as the cluster.

  6. Enter the access key ID and secret access key of the source account's IAM user or role.

  7. Copy the .rdb backup file from the source account's Amazon S3 bucket to the destination account's Amazon S3 bucket.
    Note: Replace example-source-bucket with the source bucket name, example-destination-bucket with the destination bucket name, example-source-region with the source Region, and example-destination-region with the destination Region.

    aws s3 cp s3://example-source-bucket/example-backup.rdb s3://example-destination-bucket/example-backup.rdb --acl bucket-owner-full-control   --source-region example-source-region --region example-destination-region
  8. In the destination account, open the Amazon S3 console, and then grant ElastiCache read access to the .rdb file.

  9. To create an ElastiCache for Redis cluster, seed the cluster with the .rdb file.

AWS OFFICIAL
AWS OFFICIALUpdated a year ago