How to migrate on-premises SQL Server to Azure SQL Server using Azure storage account

In this article, we will be migrating the on-premise SQL Server database to Azure SQL Server. We will use the Import and Export Wizard to copy data using bacpac file.

Cloud is everywhere now, even sensitive data also in cloud. So, it’s time to move our on-premise data also to cloud. But when you move on-premise SQL server to Azure SQL server, how we can migrate the data?

Let’s see how we can get that also done in below article,

Export to .bacpac file using SQL Server Management Studio

  1. Open and connect database file in SQL Server Management Studio.
  • To export a database file, right click on the name of the database. In the context menu, select Tasks > Export Data-tier Application.
A screenshot of a computer

Description automatically generated
  1. The option will open the wizard. Click Next> Introduction page and go to the Export Settings.
  2. In Export Settings, you have Advanced tab where you have option to select objects you wanted.
  3. Under Settings tab we have two options,

Save to the local disk:

Save the files as bacpac file to local path by clicking browse button.

  • Once you save on the local disk you can move that to azure storage manually by upload on container

Save to Microsoft Azure:

  • Click on connect and give the StoreAccountName and access Key to connect like below,
  • After selecting container, click next.
  1. In Summary page . You can verify and confirm the Settings here. After all information is verified, click Finish.
  2. It starts the exporting now. Click the Close button to exit the bacpac Export wizard.
  1. After wizard completes close it and open the Azure storage there you can see the bacpac file.

Import a bacpac file to Azure SQL

  1. Create a required resource group, server and temp database with basic core.
  1. After creating server and resource group with temp database delete the database. Go the data base server
  1. There you will see import database option. Click on import option and select the stored bacpac file from the storage location.
  2. After selecting storage configure pricing tier and database.
  1. After giving the server credentials and on clicking okay you can see the database on that server.

Conclusion: I hope this article helps you to understand the migration of on-premises SQL Server to Azure SQL Server using Azure storage account. If you have any questions/issues about this article, please let me know in comments.

Sharing is Caring!

Leave a Reply

Your email address will not be published. Required fields are marked *