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
- 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.
- The option will open the wizard. Click Next> Introduction page and go to the Export Settings.
- In Export Settings, you have Advanced tab where you have option to select objects you wanted.
- 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.
- In Summary page . You can verify and confirm the Settings here. After all information is verified, click Finish.
- It starts the exporting now. Click the Close button to exit the bacpac Export wizard.
- After wizard completes close it and open the Azure storage there you can see the bacpac file.
Import a bacpac file to Azure SQL
- Create a required resource group, server and temp database with basic core.
- After creating server and resource group with temp database delete the database. Go the data base server
- There you will see import database option. Click on import option and select the stored bacpac file from the storage location.
- After selecting storage configure pricing tier and database.
- 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.