Question: How to Migrate from One Redis ElastiCache Cluster to Another


You can migrate data from one Redis ElastiCache cluster to another by following these steps:

  1. Create a snapshot of the source Redis cluster:

    To create a manual snapshot, navigate to the ElastiCache Management Console in AWS, select the source Redis cluster, and choose "Create snapshot" from the "Actions" menu. Provide a name for the snapshot, and click "Create."

    You can also use the AWS CLI to create a snapshot:

    aws elasticache create-snapshot --cache-cluster-id source_cluster_id --snapshot-name source_snapshot_name
  2. Restore the snapshot into a new Redis cluster:

    From the ElastiCache Management Console, go to "Snapshots," find the snapshot you created, and select it. Choose "Restore Snapshot" from the "Actions" menu. Provide the necessary details for the new cluster and click "Restore."

    Alternatively, use the AWS CLI to restore the snapshot:

    aws elasticache restore-cache-cluster --snapshot-name source_snapshot_name --cache-cluster-id destination_cluster_id
  3. Update your application's configuration:

    Once the new Redis cluster is ready, update your application's configuration to point to the new cluster's endpoint.

  4. Test your application:

    Test your application to ensure that it's working as expected with the new Redis cluster.

  5. Delete the old Redis cluster (optional):

    If you're certain that the migration was successful and the old cluster is no longer needed, you can delete it from the ElastiCache Management Console or using the AWS CLI:

    aws elasticache delete-cache-cluster --cache-cluster-id source_cluster_id

Remember to monitor the new cluster's performance and adjust its configuration if necessary, e.g., by modifying the instance types or adding/removing replica nodes.

Was this content helpful?

Start building today

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.