Migrate your data to ElastiCache Serverless
This page walks you through an online migration from a self-managed Valkey or Redis OSS source on Amazon EC2 to an ElastiCache Serverless for Valkey cache. You use the ElastiCache console from start to finish. You create the migration, redirect your application to the migration endpoint, start the data sync, and complete the cutover.
Before you start
Before you begin, confirm that your source cache and your target cache meet the migration requirements. For more information, see Prerequisites for online migration to ElastiCache Serverless. If your source requires authentication or TLS, set that up first. For more information, see Source authentication for online migration to ElastiCache Serverless.
Confirm that you have the following:
-
An ElastiCache Serverless for Valkey cache that is available and empty, with the IPv4 network type and no public endpoint.
-
A self-managed Valkey or Redis OSS source on Amazon EC2 that meets the source requirements.
-
A Secrets Manager secret that holds your source credentials, if your source requires authentication.
-
Your source TLS configuration, if your source requires TLS.
Create the migration
You create a migration with the ElastiCache console. You can open the Create migration page in two ways.
-
In the navigation pane, choose Migrations, choose Create migration, and then choose Migrate to serverless.
-
On the Valkey caches page, select your target cache, or open its cache details page, and then choose Migrate data. This action preselects the target cache.
On the Create migration page, complete the following steps.
-
Under Source details, for Server address, enter your source address. You can also choose an Amazon EC2 instance from the suggestions, which fills in the address.
-
For Port, enter your source port.
-
For Authentication method, choose one of the following options.
- Use an existing secret
-
Choose your secret under Existing secret.
- Create and use a new secret
-
Enter a user name if your engine version uses one, enter a password, and choose a customer managed Amazon KMS key. ElastiCache creates the secret. The user name and password must meet the requirements in Source authentication for online migration to ElastiCache Serverless.
- None
-
Your source does not require authentication.
-
For TLS encryption, choose Verify CA or None.
If you choose Verify CA, under Certificate authority choose Public CA or Private CA, and provide the PEM-encoded CA certificates that issued your source's server certificate. Provide them for public and private authorities alike. For more information about why, see Source authentication for online migration to ElastiCache Serverless.
-
Under Target details, for Choose target cache, choose your cache. Only compatible caches are listed.
-
Choose Create.
The console opens the migration details page. Its title reads Migration: followed by your cache name.
The migration details page
The migration details page shows the state and controls for your migration. The Migration overview shows Target cache, Current state, Migration endpoint, and Cutover method. The page has a Monitor tab and an Events tab. It also has Stop, Force complete, and Start migration buttons.
While ElastiCache prepares the migration, Current state reads Preparing migration, and the Migration endpoint field is hidden. The banner reads "Step 1 of 3: Preparing migration" and "This may take a few minutes. Once complete, choose Start migration to begin the data sync. You can remain on this page or return later to continue."
Redirect your application
When Current state reads Ready to sync, the banner reads "Migration is ready to sync" and "Your migration endpoint is active and traffic is routed to your source. Update your application to point to the migration endpoint, then choose Start migration when ready." The Migration endpoint field now shows the address. Update your application to connect to the migration endpoint. To copy the address, choose Copy migration endpoint. Your traffic is routed to your source until cutover. The console reminds you to do this before you start the data sync, because ElastiCache cannot detect whether your application has moved. Starting the data sync first does not affect the data on your target.
Start the data sync
When you start the data sync, ElastiCache begins replicating data from your source to your target cache. Your application continues to be served throughout. For more information about cutover modes, see Cutover modes for online migration to ElastiCache Serverless.
-
On the migration details page, choose Start migration.
-
In the Start migration dialog box, for Cutover mode, choose Manual cutover or Auto-cutover. For more information, see Cutover modes for online migration to ElastiCache Serverless.
-
Warning
Clearing the target cannot be undone.
Under Target cache data, to clear a target that contains data, select Authorize automatic clearing of the target cache if it contains data. Your target contains data if you are starting the data sync again after you stopped it. It can also contain data if an earlier start failed. If your target contains data and you do not select this option, the data sync fails because the target is not empty, and the migration returns to Ready to sync.
-
Choose Start migration.
Current state moves to Initializing sync and then to Data sync in progress. While the data sync initializes, the banner reads "Step 2 of 3: Data sync is initiating". With Manual cutover it reads "Connecting to your source and initializing data sync. Once syncing begins, you can choose Complete migration and cutover will occur on the next fully synced window." With Auto-cutover it reads "Connecting to your source and initializing data sync. Once syncing begins, cutover will be performed automatically on the next fully synced window." When the data sync is running, the banner reads "Step 2 of 3: Data sync is in progress". With Manual cutover it reads "Choose Complete migration and cutover will occur on the next fully synced window." With Auto-cutover it reads "We will perform auto-cutover for you on the next fully synced window." The Monitor tab shows a selected set of the target cache's metrics.
Complete the cutover
How the cutover completes depends on the cutover mode you chose.
- Manual cutover
-
When Current state reads Data sync in progress and you are ready, choose Complete migration. The console shows "Complete migration triggered for
name." Complete migration is available only while the data sync is in progress. - Auto-cutover
-
ElastiCache cuts over at the next fully synced window. Complete migration is disabled in this mode.
During cutover, Current state reads Cutover in progress and the banner reads "Step 3 of 3: Cutover is in progress" and "Traffic is being switched from your source to the target cache. This might take a few minutes." Stop and Force complete are disabled during cutover.
With Auto-cutover, the console opens the cache details page when the migration finishes. This page shows a Migration completed successfully banner until you dismiss it. The Events tab lists the migration events.
If you need to stop
To stop the data sync, choose Stop on the migration details page. Stop is available only while Current state reads Data sync in progress. While the data sync stops, Current state reads Stopping and the banner reads "Data sync is being stopped. Traffic continues through the migration endpoint. Once stopped, the migration will return to Ready to sync." For more information about what stopping does, see Cutover modes for online migration to ElastiCache Serverless.
Force complete
Force complete ends the migration even if your target is not in sync with your source. Your migration endpoint then serves from your target, which can have incomplete data. To return to your source, you must move your application traffic back to it yourself.
To end a migration that has reported an error, use Force complete. It is available when Current state reads Ready to sync or Data sync in progress. The console shows "Force complete triggered for name." For more information, see Cutover modes for online migration to ElastiCache Serverless.
Using the Amazon CLI
For more information about migrating with the Amazon CLI, see the Amazon CLI examples on Source authentication for online migration to ElastiCache Serverless and Cutover modes for online migration to ElastiCache Serverless.
For the API operations, see PrepareMigration, StartMigration, CompleteMigration, and StopMigration in the Amazon ElastiCache API Reference.