First blog for the year! It’s been extremely busy but it means that I’ve got lots of things to share.
In this blog post, I will be sharing efficient way of migrating (copying) a Azure database from one subscription to another.
Let’s get started!
Previous to ARM model, and even ARM was introduced, I believe lots of you would still be using the following method:
- Make a copy from a production database
- Export the copied database to a blob storage
- Import the .bacpac to the destination SQL server
- Delete the database copy
- Delete the .bacpac file
This method is completely fine, but there are some cons around this:
- Export & import process takes long time which ends up incurring extra operational cost
- Possibility of leaving the .bacpac file back in the blob storage (if not an automated way)
- You need to know the administrator login details for both source and destination SQL servers
From the new ARM portal, it allows you to migrate a resource to a resource group in different subscription.
Using this functionality, the following approach could be made:
- Create a temporary SQL server in the resource group where a production SQL server is running
- Make a copy of the production database to the temporary SQL server
- Move the temporary SQL server to another subscription
- Make a copy of the copied database to the destination SQL server
- Delete the temporary SQL server
What are the benefits?
Pretty much reverse to what’s mentioned above, cons for traditional way.
One of the main benefits is “reduced operational cost” – it doesn’t require a copied database to stand up for export & import processes.
Also, no additional space required in blob storage to hold the .bacpac file.
Hope this helps and feel free to leave a comment for any questions or clarifications 🙂