In this article, you learn how to move Azure Cache for Redis instances to a different Azure region. You might move your resources to another region for many reasons:
If you're looking to migrate to Azure Cache for Redis from on-premises, cloud-based VMs, or another hosting service, we recommend you see Migrate to Azure Cache for Redis.
The tier of Azure Cache for Redis you use determines the option that's best for you.
Cache Tier Options Premium Geo-replication, create a new cache, dual-write to two caches, export and import data via RDB file, or migrate programmatically Basic or Standard Create a new cache, dual-write to two caches, or migrate programmatically Enterprise or Enterprise Flash Create a new cache or export and import data with an RDB file, or migrate programmatically Passive geo-replication (Premium) PrerequisitesTo configure geo-replication between two caches, the following prerequisites must be met:
To move your cache instance to another region, you need to create a second premium cache instance in the desired region. Once both caches are running, you can set up geo-replication between the two cache instances.
Note
Data transfer between Azure regions is charged at standard bandwidth rates.
Some features aren't supported with geo-replication:
Conditions for geo-replications support:
After geo-replication is configured, the following restrictions apply to your linked cache pair:
To link two caches together for geo-replication, first select Geo-replication from the Resource menu of the cache that you intend to be the primary linked cache. Next, select Add cache replication link from Geo-replication on the left.
Select the name of your intended secondary cache from the Compatible caches list. If your secondary cache isn't displayed in the list, verify that the Geo-replication prerequisites for the secondary cache are met. To filter the caches by region, select the region in the map to display only those caches in the Compatible caches list.
You can also start the linking process or view details about the secondary cache by using the context menu.
Select Link to link the two caches together and begin the replication process.
You can view the progress of the replication process using Geo-replication on the left.
You can also view the linking status on the left, using Overview, for both the primary and secondary caches.
Once the replication process is complete, the Link status changes to Succeeded.
The primary linked cache remains available for use during the linking process. The secondary linked cache isn't available until the linking process completes.
Once your new cache in the targeted region is populated with all necessary data, remove the link between the two caches and delete the original instance.
To remove the link between two caches and stop geo-replication, select Unlink caches from the Geo-replication on the left.
When the unlinking process completes, the secondary cache is available for both reads and writes.
Note
When the geo-replication link is removed, the replicated data from the primary linked cache remains in the secondary cache.
If you don't need to maintain your data during the move, the easiest way to move regions is to create a new cache instance in the targeted region and connect your application to it. For example, if you use Redis as a look-aside cache of database records, you can easily rebuild the cache from scratch.
MoveIn the Azure portal, search for and select Azure Cache for Redis.
On the Azure Cache for Redis page, select Create > Azure Cache for Redis.
On the Basics tab of the New Redis Cache page, configure the following settings:
Select the Networking tab, or select Next: Networking.
On the Networking tab, select a connectivity method to use for the cache. Private Endpoint is recommended for security. If you select Private Endpoint, select Add private endpoint and create the private endpoint.
Select the Advanced tab, or select Next: Advanced.
On the Advanced pane, configure the following options:
The following image shows the Advanced tab for the Standard SKU.
Important
Use Microsoft Entra ID with managed identities to authorize requests against your cache if possible. Authorization using Microsoft Entra ID and managed identity provides better security and is easier to use than shared access key authorization. For more information about using managed identities with your cache, see Use Microsoft Entra ID for cache authentication.
Optionally, select the Tags tab or select Next: Tags, and enter tag names and values to categorize your cache resources.
Select Review + create, and once validation passes, select Create.
The new cache deployment takes several minutes. You can monitor deployment progress on the portal Azure Cache for Redis page. When the cache Status displays Running, the cache is ready to use.
Finally, update your application to use the new instances.
Clean up source resourcesOnce your new cache in the targeted region is running, delete the original instance.
Export and import data with an RDB file (Premium, Enterprise, Enterprise Flash)Open-source Redis defines a standard mechanism for taking a snapshot of a cache's in-memory dataset and saving it to a file. This file, called RDB, can be read by another Redis cache. Azure Cache for Redis Premium and Enterprise supports importing data into a cache instance with RDB files. You can use an RDB file to transfer data from an existing cache to Azure Cache for Redis.
Important
RDB file format can change between Redis versions and might not maintain backward-compatibility. The Redis version of the cache you're exporting from should be the same or lower than the version of your new cache instance.
PrerequisitesTo move your cache instance to another region, you'll need to create a second premium cache instance in the desired region.
MoveFor more information on how to import and export data in Azure Cache for Redis. see Import and Export data in Azure Cache for Redis.
Update your application to use the new cache instance.
You can monitor the progress of the import operation by following the notifications from the Azure portal, or by viewing the events in the audit log.
Clean up source resourcesOnce your new cache in the targeted region is running, delete the original instance.
Dual-write to two caches (Basic, Standard, and Premium)Rather than moving data directly between caches, you can use your application to write data to both an existing cache and a new one you're setting up. The application initially reads data from the existing cache initially. When the new cache has the necessary data, you switch the application to that cache and retire the old one. Let's say, for example, you use Redis as a session store and the application sessions are valid for seven days. After writing to the two caches for a week, you'll be certain the new cache contains all non-expired session information. You can safely rely on it from that point onward without concern over data loss.
PrerequisitesTo move your cache instance to another region, you'll need to create a second cache instance in the desired region.
MoveGeneral steps to implement this option are:
Modify application code to write to both the new and the original instances.
Continue reading data from the original instance until the new instance is sufficiently populated with data.
Update the application code to reading and writing from the new instance only.
Once your new cache in the targeted region is running, delete the original instance.
Migrate programmatically (All tiers)You can create a custom migration process by programmatically reading data from an existing cache and writing them into Azure Cache for Redis. This open-source tool can be used to copy data from one Azure Cache for Redis instance to another instance in a different Azure Cache region. A compiled version is available as well. You may also find the source code to be a useful guide for writing your own migration tool.
Note
This tool isn't officially supported by Microsoft.
PrerequisitesAfter creating a VM in the region where the existing cache is located and creating a new cache in the desired region, the general steps to implement this option are:
Flush data from the new cache to ensure that it's empty. This step is required because the copy tool itself doesn't overwrite any existing key in the target cache.
Important
Make sure to NOT flush from the source cache.
Use an application such as the open-source tool above to automate the copying of data from the source cache to the target. Remember that the copy process could take a while to complete depending on the size of your dataset.
Once your new cache in the targeted region is running, delete the original instance.
Next stepsLearn more about Azure Cache for Redis features.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4