13
votes

I would like to transfer my existing SQL Azure location to other one, but I think there is no functionality right now to do so on the management portal of Azure.

I just googled it and found one link http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/e6c961cc-5eea-4f07-82c9-a8805d367b05 that says I need to use the data sync option in Azure's portal but I don't have that feature enabled in my Azure portal.

Also if I do use that option, is there any charge for it? Finally, are there any other option that is possible for moving the SQL Azure location?

4

4 Answers

13
votes

To Move an Existing SQL Server Database to a New Region on Azure Assuming There Are No Blob Containers Associated With the Database. For further reference see:
https://azure.microsoft.com/en-us/blog/migrating-azure-services-to-new-regions/

  1. Upgrade the database, if necessary, to one of the Premium pricing tiers
  2. Add geo-replication to the existing database. You can choose what region to have the backup of the existing database. Create a new Database server in the target region of your choice. I suggest provisioning that new database server with the same admin username and password as the existing sql database. When creating the secondary database, I suggest making the Secondary type “Readable” as it will allow you the ability to check that all data and schemas were replicated correctly.
  3. Allow the two databases time to sync. Rule of thumb according from Microsoft AzureCAT is: 3 * (5 minutes + database size / 150 MB/minute)
  4. Configure the Firewall settings of the secondary database to allow the necessary IP addresses to access the database
  5. Temporarily shut down whatever users or applications are accessing the existing database.
  6. From the Azure portal select the existing database and change its geo-replication role from primary to secondary.
  7. Run any ddl scripts that rely on the masterdb such as ddl scripts to recreate users and user profiles
  8. Change the connection strings of any applications to point to the new database.
  9. Users and applications can now connect to the new Database
  10. At your discretion you can remove the old database as a backup and add any new regions as backup.

In terms of charges there will be charges for upgrading the old database if it isn't already a premium database. There will also be charges for creating the geo-replicated database. However, those charges can be limited to a day to a few days worth of fees (depending on how long geo-replication takes). Once the new database is up and running, delete the old database as soon as possible to limit additional fees. Finally, if you upgraded the service level of the old database to a premium tier to facilitate the geo-replication, you will want to downgrade the new database to the original service level of the old database to also limit fees.

10
votes

I think you can use new Import/Export bacpac feature. I have used it to move databases between accounts and can't see why it wouldn't also work between regions.

See how here

3
votes

If you are able to stop writes to the DB for a time then you can use the Copy feature on the Azure Portal.

  1. Create a new SQL Server in the region of your choosing.
  2. Add your service(s) IP addresses to the new SQL Server firewall.
  3. Stop writes to the origin database.
  4. Open the origin database in the Azure Portal and click Copy at the top of the blade.
  5. Choose your new SQL server located in the destination region.
  6. Wait for the copy to complete.
  7. Update your service(s) to point to the destination DB.
  8. Enable DB writes.
  9. Verify everything is working.
  10. Delete origin database (and server if it was the only DB on the server).
1
votes

I wouldn't use DataSynch because it creates many objects in your database to perform synchronization (it's an invasive solution). You can indeed try the Import/Export feature; that should work fine. You can also download a trial version of the Enzo backup tool, which comes with a 30-day free trial: http://www.bluesyntax.net/backup.aspx. [disclaimer: I am the author of this tool]

Regarding the pricing question, you may be charged for data being extracted out of the database. Moving data "in" SQL Azure is free of charge for now. If you are transferring the data to a different data center, you will be charged for extracting the data. It's 15 cents per GB in the US and Europe, and 20 cents in Asia. Here are the pricing details: http://www.microsoft.com/windowsazure/pricing/

Keep in mind that a database that requires 4GB of storage doesn't mean you have 4GB of data. Sometimes indexes can take a lot of space. To estimate the size of the data you will need to transfer you can either drop your indexes (and wait a little for the database size to shrink; the database size should be roughly equal to your data transfer needs) or you can calculate the size of your tables by running a command. Here is a link to an article that shows how to do something similar (look at the second command with is a SELECT statement; just run it for all the tables): http://www.sqldocumentor.com/table-size-in-sql-server-find-rows-and-disk-space-usage