DEV Community

Cover image for Migrating SQL Server to Azure SQL Database with SQL Server Management Studio (SSMS)
Olalekan Oladiran
Olalekan Oladiran

Posted on

Migrating SQL Server to Azure SQL Database with SQL Server Management Studio (SSMS)

Introduction

Databases from an on-premises SQL Server instance can be moved to an Azure SQL Database (offline) using SQL Server Management Studio (SSMS). We will learn how to use SQL Server Management Studio to move the sample AdventureWorksLT2022 database from an on-premises SQL Server instance to an Azure SQL Database instance.

Needed Tools

How to create Azure SQL Database instance

  • Log into Azure portal, search for SQL Database in the market place and click SQL Database Image description
  • Click create SQL Database Image description
  • Fill the project details by selecting the right subscription and resource group. Image description
  • Fill the database details by supplying a name to your database and click create server if you have not configured a server before. Image description
  • In the Create SQL Database Server pane choose a name and location for your server. It is important to make sure that the location of your resource group and server are the same. Image description Under authentication, choose use sql authentication and supply the username and password. Click Ok after. Image description
  • Click configure database in compute + storage section Image description
  • Change the service tier to basic, leave other settings as default and click Apply Image description
  • Leave other settings under Create SQL Database as default and click Review + create Image description
  • Click Create after passing validation Image description
  • Wait for it to deploy Image description
  • Click Go to resource once deployment is complete Image description
  • Click on the server name to open the server Image description
  • Select the Networking blade and change Public network access to Selected network Image description
  • Tick allow Azure services and resources...and click save. Image description
  • We need to register Microsoft.DataMigration in the resource provider of our subscription by searching for subscription in the market place Image description
  • Select your subscription Image description
  • Search for Datamigration in the filter and click register Image description
  • We are through with configuring Azure SQL Database.

Migrating SQL server to Azure SQL database

  • After installing SQL Server Management Studio (SSMS), Launch it. The Server name will be the name of the local SQL server installed and click connect Image description
  • After connecting, expand the database folder by clicking on it, right click on the database we want to migrate, click Tasks and select Deploy Database to Microsoft Azure SQL Database Image description
  • Click Next Image description
  • Click connect to put the Server name which is the name of the the server created in Azure portal Image description
  • Change Authentication to SQL Server authentication, put the Log in and password details. Click connect after Image description
  • It will require you to sign in Image description
  • Leave the settings as default and click Next Image description
  • Click Finish Image description
  • Wait for it to finish Image description
  • Once the import is complete, click Close Image description
  • To check if the database has been moved successfully, navigate to Azure portal and open the resource group for our database. Image description
  • Click to open it and select Query editor. Put the Password and press Ok Image description

Image description

Top comments (0)