Blog Post

Azure Architecture Blog
1 MIN READ

Migrate Large Azure MySQL Between Subscriptions

DaveLawlor's avatar
DaveLawlor
Icon for Microsoft rankMicrosoft
Oct 15, 2020

Because of the time involved and that it was a live production system finding a quicker way was needed instead of making an extended downtime for a customer facing solution. 

 

 

We worked out a solution that would minimize downtime and allow a seamless migration.

 

  1. First we had to check that the regions we were working with was supported for MySQL cross region replication.
  2. Because you can't do cross region replication between subscriptions though, you will need to first create a read replica in the current subscription in the new region.
  3. After the replica is created move the replica server to the new subscription (this can be done in the Resource Group screen, select the replica server and in the Move dropdown choose Move to another subscription
  4. After the move, check that the replication lag is zero, take the original app down for a short maintenance window, and stop replication to make the replica a standalone server.
  5. Redirect traffic to the new region with the now standalone MySQL server in the new region and subscription in a fraction of the time it was taking with a backup and restore.

This allowed the customer to migrate his application and database in much less time to the new subscription and region.

 

Updated Jan 01, 2021
Version 2.0
  • Hello,
    Thanks for sharing the instruction.
    This instruction is good for the Azure MariaDB and Azure DB for MySQL - Single Server, but not for Azure DB for MySQL - flexible.
    Azure DB for MySQL - flexible after moving replica to another subscription has a "Complete replica list currently unavailable." message under the Replica feature. The "Reset password," "Restore," "Restart," and "Stop" options are unavailable. And you don't have any options to stop the replication from the primary server. Before moving, you need "Promote" your replica and then move it.