Exercise - Migrate a database with downtime by using Azure Database Migration Service

Completed

In this exercise, you migrate the data in your database by using Azure Database Migration Service. This is a two-step process. First, you create a new instance of Database Migration Service. Within that instance, you then create a new migration project.

Create the Database Migration Service instance

  1. Open the Azure portal, and under Azure services, select Create a resource. The Create a resource pane appears.

  2. In the Search services and marketplace search box, enter Azure Database Migration Service, and press Enter. The Azure Database Migration Service pane appears.

  3. Select Create. The Create Migration Service pane appears.

  4. On the Basics tab, enter the following values for each setting.

    Setting Value
    Project details
    Subscription Select your subscription
    Resource group From the dropdown list, select admsdemorg
    Instance details
    Migration service name Enter admsdemodms
    Location Select the same region where your resources are located
    Pricing tier Standard 1 vCores
  5. Select Next : Networking.

  6. On the Networking tab, select the admsdemo-vnet/default virtual network.

  7. Select Review + create.

  8. To create the Database Migration Service instance, select Create.

  9. Wait for the deployment to finish. It might take 15 minutes. Then, select Go to resource. The Azure Database Migration Service Overview pane appears.

    The overview pane for Database Migration Service.

Create a migration project

After the service instance is created, you create a project to migrate the database.

  1. In the top menu bar, select New Migration Project. The New migration project pane appears.

  2. Enter the following values for each setting.

    Setting Value
    Migration project name
    Project name SocialDatabaseMigration
    Choose your source and target server type.
    Source server type SQL Server
    Target server type Azure SQL Database
    Choose your migration activity type.
    Migration activity type Data migration

    Selections for project, servers, and activity type.

  3. Select Create and run activity. The SQL Server to Azure SQL Database Migration Wizard pane appears.

  4. On the Select source tab, enter the following values for each setting.

    Setting Value
    Source SQL Server instance name admsdemovm
    Authentication type Windows Authentication
    User Name admsdemovm\windowsadmin
    Password Enter the password for the windowsadmin account
    Connection properties
    Encrypt connection Check
    Trust server certificate Check

    Source details.

  5. Select Next : Select databases.

  6. Select Next : Select target.

  7. On the Select target tab, enter the following values for each setting.

    Setting Value
    Target server name Enter the DNS name of your Azure SQL server (for example, admsdemosqlmfe4eev3ubxlo.database.windows.net).
    Authentication type SQL Authentication
    User Name azuresqladmin
    Password Enter the password for the azuresqladmin account
    Connection properties
    Encrypt connection Check

    Target details.

  8. Select Next : Map to target databases.

  9. On the Map to target databases tab, for the Social database, select Set Source DB Read-Only.

    Make sure you're not logged in to the database elsewhere, such as from SQL Server Management Studio in the virtual machine. If you are, the migration will fail.

    Selections for mapping to a target database.

  10. Select Next : Configure migration settings.

  11. On the Configure migration settings tab, to expand the list of tables, next to Social 1 of 1, select the arrow. Make sure the dbo.Twitters table is selected.

    List of tables.

  12. Select Next : Summary.

  13. On the Summary tab, in the Activity name box, enter MigrateSocialDatabase.

    Migration summary.

  14. To start the migration, select Start migration. A new pane appears with the status of the migration.

  15. To update the status until it shows that the process is finished, on the top menu bar, select Refresh.

    Refresh button.

View data in the new database

You can now go to the Azure SQL database and view your migrated data.

  1. Go back to your admsdemorg resource group, and select the Social (admsdemosqlv2v2s22x.../Social) SQL database.

    Overview pane.

  2. Select Set server firewall.

  3. On the Firewall settings pane, in the top menu bar, select Add client IP, and then select Save.

    Firewall pane.

  4. To return to the overview for your database, close the Firewall settings pane.

  5. Select Query editor (preview).

  6. Log in with the azuresqladmin username and password.

  7. Enter the following query, and select Run.

    SELECT * FROM [dbo].[Twitters];
    

    Select pane.

    You should see data from your database, which indicates a successful migration.