Migrate SQL Server Database To Azure SQL Server

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)
  1. Open and connect database file in SQL Server Management Studio (SSMS).

    SQL Server

  2. To export a database file, right click on the name of the database. In the context menu, select Tasks > Export Data-tier Application.

    SQL Server

  3. The option will open the wizard. Click Next> Introduction page and go to the Export Settings.

    SQL Server

  4. Export Settings are requested to the location to save the bacpac file.

    SQL Server
    • 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.

      SQL Server

    • If you want to migrate a full database, select all the objects. After the location is selected, click Next.

      SQL Server
  1. The current Summary page looks like below. You can verify and confirm the Settings here. After all information is verified, click Finish.

    SQL Server

  2. It starts the exporting now. Click the Close button to exit the bacpac Export wizard.

    SQL Server

Import a bacpac file to Azure SQL

  1. To create an (Create a SQL database Azure) SQL Azure database form a bacpac file in SSMS, connect to the SQL Azure Server.

    SQL Server

  2. After you connect, go to Object Explorer pane, right click the database, and select Import Data-tier.

    SQL Server

  3. The option will open the wizard. Click Next> Introduction page and go to the Import Settings.

    SQL Server

  4. The Import settings are requested to the bacpac file to import.

    SQL Server

    • You have exported the bacpac file to your local disk., Now, let's import it.

      SQL Server

    • After this, click Next button.

      SQL Server 
  1. 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.

    SQL Server

  2. The Summary page confirms the correct information. Click the Finish button to the start the Import action.

    SQL Server

  3. Successful Import looks like below. Click the Close button to exit the bacpac Import wizard.

    SQL Server

Validate Azure SQL

  1. You can confirm that a new database has been created in the Azure SQL Server.

    SQL Server

  2. And visit the Microsoft Azure portal to check in the respective Azure SQL Server.

    SQL Server