0
votes

We're in the process of a server migration from an on-premise server (Win2008R2) to Azure PaaS.

To move the databases, we used the Microsoft Data Migration Assistant (DMA) tool, which worked great and we can connect to the migrated Azure DB via SQL Server Management Studio.

Considering:

  • Made quite a few changes to the migrated Azure database (tables, stored procedures, indexes) to work with the apps in Azure
  • Combined multiple databases from the on-premise server into one DB in Azure via DMA to save costs
  • On-premise database is continually being modified by insert and update operations (multiple tables) during the migration process
  • When fully switching hosting in Azure we need to make sure all data is up-to-date. This will be done very early in the AM during which on-premise IIS websites are stopped assuring no DB operations are made, giving us a short window to migrate missing data

Question: what is the best and fastest way to migrate data (all vs missing/updated) considering the above?

2

2 Answers

2
votes

I would recommend you to migrate first only the schema of your on-premises databases to Azure SQL Databases and then let Azure SQL Data Sync to migrate the data to Azure and keep it updated on Azure SQL Database.

My suggestion to start with an empty schema on the Azure SQL Database side is because when SQL data Sync finds data on-premises and on Azure it start comparing both databases and that consumes a lot of resources.

On the initial sync SQL Data Sync may consume a lot of resources on the on-premises database server even when having an empty schema on the Azure side, for that you can use SQL Server Resource Governor to cap the CPU used by the data sync sessions in your on premises SQL Server, and this way avoid big performance impact possibly affecting database users.

When you are ready, you can switch your users (gradually or not if SQL Data Sync is on bi-directional mode) to Azure. Once your users have been migrated, you can then remove the member database (the on-premises database) from the SQL Data Sync configuration and stop SQL Data Sync operation.

0
votes

Visual Studio also has a great tool for comparing both schema and data between two databases on different servers.
It can then update the target database with any changes after which you can switch over to use the Azure DB.

This method would require downtime of around 5-30 minutes depending on amount of data, but that might be acceptible depending on your requirements.