Introduction
In this article, I will try to share my experience of moving from SQL Server to SQL Azure for the first time. This is my first article on migrating the SQL Server database to Azure SQL Server. The Import and Export Wizard is a simple way to copy data using bacpac file.
Export to bacpac file in SQL Server Management Studio (SSMS)
- Open and connect database file in SQL Server Management Studio (SSMS).
- 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.
- Export Settings are requested to the location to save the bacpac file.
- You can save it to the local disk or Azure Storage account. Since you don't have an Azure Storage account, you'll save the bacpac file and file name to the local disk.
- If you want to migrate a full database, select all the objects. After the location is selected, click Next.
- The current Summary page looks like below. 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.
Import a bacpac file to Azure SQL
- To create an (Create a SQL database Azure) SQL Azure database form a bacpac file in SSMS, connect to the SQL Azure Server.
- After you connect, go to Object Explorer pane, right click the database, and select Import Data-tier.
- The option will open the wizard. Click Next> Introduction page and go to the Import Settings.
- The Import settings are requested to the bacpac file to import.
- You have exported the bacpac file to your local disk., Now, let's import it.
- After this, click Next button.
- The Database Settings page requests rhat you configure the new Azure SQL database by providing the new database name and maximum database size. Click Next.
- The Summary page confirms the correct information. Click the Finish button to the start the Import action.
- Successful Import looks like below. Click the Close button to exit the bacpac Import wizard.
Validate Azure SQL
- You can confirm that a new database has been created in the Azure SQL Server.
- And visit the Microsoft Azure portal to check in the respective Azure SQL Server.