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.
- First we had to check that the regions we were working with was supported for MySQL cross region replication.
- 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.
- 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
- 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.
- 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.