A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/azure/dms/tutorial-sql-server-managed-instance-offline-ads below:

Tutorial: Migrate SQL Server to Azure SQL Managed Instance - Azure Database Migration Service

You can use Azure Database Migration Service (DMS) and the Azure SQL migration extension in Azure Data Studio to migrate databases from a SQL Server instance to Azure SQL Managed Instance with minimum downtime.

For database migration methods that might require some manual configuration, see Migration guide: SQL Server to Azure SQL Managed Instance.

Tip

In Azure Database Migration Service, you can migrate your databases offline or while they are online. In an offline migration, application downtime starts when the migration starts. To limit downtime to the time it takes you to cut over to the new environment after the migration, use an online migration. We recommend that you test an offline migration to determine whether the downtime is acceptable. If the expected downtime isn't acceptable, do an online migration.

In this tutorial, you migrate the AdventureWorks2022 database from an on-premises instance of SQL Server to an instance of Azure SQL Managed Instance, using Azure Data Studio and Database Migration Service (DMS). This tutorial uses online migration mode, where application downtime is limited to a short cutover at the end of the migration.

In this tutorial, you learn how to:

Important

Prepare for migration and reduce the duration of the online migration process as much as possible, to minimize the risk of interruption caused by instance reconfiguration or planned maintenance. In such an event, migration process starts from the beginning. During planned maintenance, there's a grace period of 36 hours where the target Azure SQL Managed Instance configuration or maintenance is held before migration process is restarted.

In this tutorial, you migrate the AdventureWorks2022 database from an on-premises instance of SQL Server to an instance of Azure SQL Managed Instance, using Azure Data Studio and Database Migration Service (DMS). This tutorial uses offline migration mode, which considers an acceptable downtime during the migration process.

In this tutorial, you learn how to:

Prerequisites

To complete this tutorial, you need to:

Launch the Migrate to Azure SQL wizard in Azure Data Studio

To open the Migrate to Azure SQL wizard:

  1. In Azure Data Studio, go to Connections. Select and connect to your on-premises instance of SQL Server. You also can connect to SQL Server on an Azure virtual machine.

  2. Right-click the server connection and select Manage.

  3. In the server menu, under General, select Azure SQL Migration.

  4. In the Azure SQL Migration dashboard, select Migrate to Azure SQL to open the migration wizard.

  5. On the first page of the wizard, start a new session or resume a previously saved session.

Run database assessment, collect performance data and get Azure recommendation
  1. Select the databases you want to assess, and select Next.

  2. Select Azure SQL Managed Instance as the target.

  3. Select View/Select to view the assessment results.

  4. In the assessment results, select the database, and then review the assessment report to make sure no issues were found.

    1. Select Get Azure recommendation to open the recommendations pane.

    2. Select Collect performance data now. Select a folder on your local computer to store the performance logs, and then select Start.

      Azure Data Studio will now collect performance data until you either stop the collection, press the Next button in the wizard or close Azure Data Studio.

      After about 10 minutes, Azure Data Studio indicates that a recommendation is available for Azure SQL Managed Instance. You can also press the Refresh recommendation link after the initial 10 minutes to refresh and refine the recommendation with the extra data collected. An extended assessment is especially helpful if your usage patterns vary over time.

    3. In the selected Azure SQL Managed Instance target, select View details to open the detailed SKU recommendation report.

    4. In Review Azure SQL Managed Instance Recommendations, review the recommendation. To save a copy of the recommendation, select the Save recommendation report checkbox.

  5. Select Close to close the recommendations pane.

  6. Select Next to continue your database migration in the wizard.

Configure migration settings
  1. Specify your Azure SQL Managed Instance by selecting your subscription, location, resource group from the corresponding dropdown lists and then select Next.

  2. Select Online migration as the migration mode.

    Note

    In the online migration mode, the source SQL Server database can be used for read and write activity while database backups are continuously restored on target Azure SQL Managed Instance. Application downtime is limited to duration for the cutover at the end of migration.

  3. Select the location of your database backups. Your database backups can either be located on an on-premises network share or in an Azure storage blob container.

    Note

    If your database backups are provided in an on-premises network share, DMS will require you to set up a self-hosted integration runtime in the next step of the wizard. If a self-hosted integration runtime is required to access your source database backups, check the validity of the backup set and upload them to your Azure storage account. If your database backups are already on an Azure storage blob container, you don't need to set up a self-hosted integration runtime.

For backups that are located on a network share, enter or select the following information:

Field Description Source Credentials - Username The credential (Windows / SQL authentication) to connect to the source SQL Server instance and validate the backup files. Source Credentials - Password The credential (Windows / SQL authentication) to connect to the source SQL Server instance and validate the backup files. Network share location that contains backups The network share location that contains the full and transaction log backup files. Any invalid files or backup files in the network share that don't belong to the valid backup set are automatically ignored during the migration process. Windows user account with read access to the network share location The Windows credential (username) that has read access to the network share to retrieve the backup files. Password The Windows credential (password) that has read access to the network share to retrieve the backup files. Target database name You can modify the target database name during the migration process. Storage account details The resource group and storage account where backup files are uploaded. You don't need to create a container. DMS automatically creates a blob container in the specified storage account during the upload process.

For backups that are stored in an Azure storage blob container, enter or select the following information:

Field Description Target database name The target database name can be modified if you wish to change the database name on the target during the migration process. Storage account details The resource group, storage account and container where backup files are located.
  1. Specify your Azure SQL Managed Instance by selecting your subscription, location, resource group from the corresponding dropdown lists and then select Next.

  2. Select Offline migration as the migration mode.

    Note

    In offline migration mode, the source SQL Server database shouldn't be used for write activity while database backups are restored on a target instance of Azure SQL Managed Instance. Application downtime needs to be considered until the migration is finished.

  3. Select the location of your database backups. Your database backups can be located either on an on-premises network share or in an Azure storage blob container.

For backups that are located on a network share, enter or select the following information:

Name Description Source Credentials - Username The credential (Windows / SQL authentication) to connect to the source SQL Server instance and validate the backup files. Source Credentials - Password The credential (Windows / SQL authentication) to connect to the source SQL Server instance and validate the backup files. Network share location that contains backups The network share location that contains the full and transaction log backup files. Any invalid files or backup files in the network share that don't belong to the valid backup set are automatically ignored during the migration process. Windows user account with read access to the network share location The Windows credential (username) that has read access to the network share to retrieve the backup files. Password The Windows credential (password) that has read access to the network share to retrieve the backup files. Target database name You can modify the target database name during the migration process. Storage account details The resource group and storage account where backup files are uploaded. You don't need to create a container. DMS automatically creates a blob container in the specified storage account during the upload process.

For backups that are stored in an Azure storage blob container, enter or select the following information:

Name Description Target database name You can modify the target database name during the migration process. Storage account details The resource group, storage account, and container where backup files are located. Last Backup File The file name of the last backup of the database you're migrating.

Important

If loopback check functionality is enabled and the source SQL Server and file share are on the same computer, then source won't be able to access the file share using FQDN. To fix this issue, disable loopback check functionality using the instructions here

The Azure SQL migration extension for Azure Data Studio no longer requires specific configurations on your Azure Storage account network settings to migrate your SQL Server databases to Azure. However, depending on your database backup location and desired storage account network settings, there are a few steps needed to ensure your resources can access the Azure Storage account. See the following table for the various migration scenarios and network configurations:

Scenario SMB network share Azure Storage account container Enabled from all networks No extra steps No extra steps Enabled from selected virtual networks and IP addresses See 1a See 2a Enabled from selected virtual networks and IP addresses + private endpoint See 1b See 2b 1a - Azure Blob storage network configuration

If you have your Self-Hosted Integration Runtime (SHIR) installed on an Azure VM, see section 1b - Azure Blob storage network configuration. If you have your Self-Hosted Integration Runtime (SHIR) installed on your on-premises network, you need to add your client IP address of the hosting machine in your Azure Storage account as so:

To apply this specific configuration, connect to the Azure portal from the SHIR machine, open the Azure Storage account configuration, select Networking, and then mark the Add your client IP address checkbox. Select Save to make the change persistent. See section 2a - Azure Blob storage network configuration (Private endpoint) for the remaining steps.

1b - Azure Blob storage network configuration

If your SHIR is hosted on an Azure VM, you need to add the virtual network of the VM to the Azure Storage account since the VM has a non-public IP address that can't be added to the IP address range section.

To apply this specific configuration, locate your Azure Storage account, from the Data storage panel select Networking, then mark the Add existing virtual network checkbox. A new panel opens up. Select the subscription, virtual network, and subnet of the Azure VM hosting the integration runtime. This information can be found on the Overview page of the Azure VM. The subnet might say Service endpoint required if so, select Enable. Once everything is ready, save the updates. Refer to section 2a - Azure Blob storage network configuration (Private endpoint) for the remaining required steps.

2a - Azure Blob storage network configuration (private endpoint)

If your backups are placed directly into an Azure Storage container, all previous steps are unnecessary since there's no integration runtime communicating with the Azure Storage account. However, we still need to ensure that the target SQL Server instance can communicate with the Azure Storage account to restore the backups from the container. To apply this specific configuration, follow the instructions in section 1b - Azure Blob storage network configuration, specifying the target SQL instance Virtual Network when filling out the "Add existing virtual network" popup.

2b - Azure Blob storage network configuration (private endpoint)

If you have a private endpoint set up on your Azure Storage account, follow the steps outlined in section 2a - Azure Blob storage network configuration (private endpoint). However, you need to select the subnet of the private endpoint, not just the target SQL Server subnet. Ensure the private endpoint is hosted in the same VNet as the target SQL Server instance. If it isn't, create another private endpoint using the process in the Azure Storage account configuration section.

Create a Database Migration Service instance

Create a new Azure Database Migration Service or reuse an existing Service that you previously created.

If you previously created a Database Migration Service instance by using the Azure portal, you can't reuse the instance in the migration wizard in Azure Data Studio. You can reuse an instance only if you created the instance by using Azure Data Studio.

Use an existing instance of Database Migration Service

To use an existing instance of Database Migration Service:

  1. In Resource group, select the resource group that contains an existing instance of Database Migration Service.

  2. In Azure Database Migration Service, select an existing instance of Database Migration Service that's in the selected resource group.

  3. Select Next.

Create a new instance of Database Migration Service

To create a new instance of Database Migration Service:

  1. In Resource group, create a new resource group to contain a new instance of Database Migration Service.

  2. Under Azure Database Migration Service, select Create new.

  3. In Create Azure Database Migration Service, enter a name for your Database Migration Service instance, and then select Create.

After successful creation of DMS, you'll be provided with details to set up integration runtime.

  1. Select the Download and install integration runtime link to open the download link in a web browser. Download the integration runtime, and then install it on a computer that meets the prerequisites to connect to the source SQL Server instance.

    When installation is finished, Microsoft Integration Runtime Configuration Manager automatically opens to begin the registration process.

  2. In the Authentication key table, copy one of the authentication keys that are provided in the wizard and paste it in Azure Data Studio. If the authentication key is valid, a green check icon appears in Integration Runtime Configuration Manager. A green check indicates that you can continue to Register.

    After you register the self-hosted integration runtime, close Microsoft Integration Runtime Configuration Manager.

  3. In Create Azure Database Migration Service in Azure Data Studio, select Test connection to validate that the newly created Database Migration Service instance is connected to the newly registered self-hosted integration runtime.

  4. Return to the migration wizard in Azure Data Studio.

Start the database migration

Review the configuration you created, and then select Start migration to start the database migration.

Monitor the database migration
  1. On the Database Migration Status, you can track the migrations in progress, migrations completed, and migrations failed (if any).

  2. Select Database migrations in progress to view active migrations.

    To get more information about a specific migration, select the database name.

    The migration details pane displays the backup files and their corresponding status:

    Status Description Arrived The backup file arrived in the source backup location and was validated. Uploading the integration runtime is uploading the backup file to the Azure storage account. Uploaded The backup file was uploaded to the Azure storage account. Restoring The service is restoring the backup file to Azure SQL Managed Instance. Restored The backup file is successfully restored in Azure SQL Managed Instance. Canceled The migration process was canceled. Ignored The backup file was ignored because it doesn't belong to a valid database backup chain.

Complete migration cutover

The final step of the tutorial is to complete the migration cutover to ensure the migrated database in Azure SQL Managed Instance is ready for use. This process is the only part that requires downtime for applications that connect to the database and hence the timing of the cutover needs to be carefully planned with business or application stakeholders.

To complete the cutover:

  1. Stop all incoming transactions to the source database.
  2. Make application configuration changes to point to the target database in Azure SQL Managed Instance.
  3. Take a final log backup of the source database in the backup location specified
  4. Put the source database in read-only mode. Therefore, users can read data from the database but not modify it.
  5. Ensure all database backups have the status Restored in the monitoring details page.
  6. Select Complete cutover in the monitoring details page.

During the cutover process, the migration status changes from in progress to completing. When the cutover process is completed, the migration status changes to succeeded to indicate that the database migration is successful and that the migrated database is ready for use.

Important

After the cutover, availability of SQL Managed Instance with Business Critical service tier only can take significantly longer than General Purpose as three secondary replicas have to be seeded for Always On High Availability group. This operation duration depends on the size of data, for more information, see Management operations duration.

  1. In Azure Data Studio, in the server menu, under General, select Azure SQL Migration to go to the dashboard for your Azure SQL migrations.

    Under Database migration status, you can track migrations that are in progress, completed, and failed (if any), or you can view all database migrations.

  2. Select Database migrations in progress to view active migrations.

    To get more information about a specific migration, select the database name.

    The migration details pane displays the backup files and their corresponding status:

    Status Description Arrived The backup file arrived in the source backup location and was validated. Uploading the integration runtime is uploading the backup file to the Azure storage account. Uploaded The backup file was uploaded to the Azure storage account. Restoring The service is restoring the backup file to Azure SQL Managed Instance. Restored The backup file is successfully restored in Azure SQL Managed Instance. Canceled The migration process was canceled. Ignored The backup file was ignored because it doesn't belong to a valid database backup chain.

After all database backups are restored on the instance of Azure SQL Managed Instance, an automatic migration cutover is initiated by Database Migration Service to ensure that the migrated database is ready to use. The migration status changes from In progress to Succeeded.

After the migration, the availability of SQL Managed Instance with Business Critical service tier might take significantly longer than the General Purpose tier because three secondary replicas have to be seeded for an Always On High Availability group. The duration of this operation depends on the size of the data.

Limitations

Important

Online migrations with the Azure SQL extension use the same technology as the Log Replay Service (LRS), and have the same limitations. Before you migrate databases to the Business Critical service tier, consider these limitations, which don't apply to the General Purpose service tier.

Migrating to Azure SQL Managed Instance by using the Azure SQL extension for Azure Data Studio has the following limitations:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4