Escrito por Kristy Noms,

5 minutos de leitura

Migrate On-premises SQL Server Database to an Azure SQL Managed Instance with minimal downtime

How to migrate local SQL Server databases to an Azure SQL Managed Instance or an Azure SQL VM with minimal downtime.

Compartilhe este post:

Using the new Azure Data Migration extension for Azure Data Studio we can migrate our local SQL Server databases to an Azure SQL Managed Instance or an Azure SQL VM with minimal downtime.
Let’s go through the necessary steps:

1 – Create a storage account to upload backups

It’ll be used to store our backups taken from the local database to restore in Azure (full, log).

 

2 – Install Azure Data Studio and add SQL Migration extension

Download and install Azure Data Studio.

After installed let’s add the extension from the marketplace:

3 – Launch the “Migrate to Azure SQL” wizard in Azure Data Studio

Open Azure Data Studio → connect to our local database → Right click on server connection –> Manage –> Azure SQL Migration –> Migrate to Azure SQL

Choose the database to migrate:

Next, let’s run the assessment to see if it’s possible to migrate, and to show us recommendations, since we’re migrating to Managed Instance, select it and click next:

Next we’ll link our azure account and choose our target:

Next let’s select our migration mode:

We have the following settings to configure:

Backups to be restored:

Next, we need to create a DMS or use an existing:

I created a new one, in this mode we also have the possibility to use Integration Runtime to access our local backups, but if you already have an Integration Runtime you’re gonna need to uninstall and install again to be able to change the authentication key (in my case I used ADF in another lab and my IR was using the old key, so I had to install again).

 

 

Back to DMS setup we’ll test our connection:

 

 

Next step is to click on start migration.

Back to the home page we can see the status:

If we take look at the portal we’ll see the backups in Azure Blob Storage:

Connecting to the Managed Instance we’ll see our database in a restoring state:

When all files are restored, it’ll be available the option to start the cutover:

To finish our migration let’s add some data to the database and take a final log backup:

Back to the Azure Data Studio we can see that our final log transaction is being uploaded without our intervention:

Now, let’s start the cutover:

In Azure Portal the database is now online:

Connecting to the Managed Instance endpoint we can see that our database is ready to use and up-to-date.

Compartilhe este post: