Migrate with the link - Azure SQL Managed Instance
Applies to: Azure SQL Managed Instance
This article teaches you to migrate your SQL Server database to Azure SQL Managed Instance by using the Managed Instance link.
Overview
The Managed Instance link enables migration from SQL Server hosted anywhere, to Azure SQL Managed Instance. The link uses Always On availability group technology to replicate changes nearly in real time from the primary SQL Server instance to the secondary SQL Managed Instance. The link provides the only truly online migration option between SQL Server and Azure SQL Managed Instance, since the only downtime is cutting over to the target SQL managed instance.
Migrating with the link gives you:
- The ability to test read only workloads on SQL Managed Instance before you finalize the migration to Azure.
- The ability to keep the link and migration running for as long as you need, weeks and even months at a time.
- Near real-time replication of data that provides the fastest available data replication to Azure.
- The most minimum downtime migration compared to all other solutions available today.
- Instantaneous cutover to the target SQL Managed Instance.
- The ability to migrate anytime you're ready.
- The ability to migrate single or multiple databases from a single or multiple SQL Server instances to the same or multiple SQL managed instances in Azure.
- The only true online migration to the Business Critical service tier.
Note
While you can only migrate one database per link, you can establish multiple links from the same SQL Server instance to the same SQL Managed Instance.
Prerequisites
To use the link with Azure SQL Managed Instance for migration, you need the following prerequisites:
- An active Azure subscription. If you don't have one, create a trial account.
- Supported version of SQL Server with the required service update installed.
Assess and discover
After you've verified that your source environment is supported, start with the pre-migration stage. Discover all of the existing data sources, assess migration feasibility, and identify any blocking issues that might prevent your migration. In the Discover phase, scan the network to identify all SQL Server instances and features used by your organization.
You can use the following tools to discover SQL sources in your environment:
- SQL Server enabled by Azure Arc: SQL Server enabled by Azure Arc automatically produces an assessment for migration to Azure, simplifying the discovery process and readiness assessment for migration.
- Azure Migrate to assess migration suitability of on-premises servers, perform performance-based sizing, and provide cost estimations for running them in Azure.
- Microsoft Assessment and Planning Toolkit (the "MAP Toolkit") to assess your current IT infrastructure. The toolkit provides a powerful inventory, assessment, and reporting tool to simplify the migration planning process.
After data sources have been discovered, assess any on-premises SQL Server instances that can be migrated to Azure SQL Managed Instance to identify migration blockers or compatibility issues.
Create target instance
After you've assessed your existing environment, and determined the appropriate service tier and hardware configuration for your target SQL managed instance, deploy your target instance by using the Azure portal, PowerShell or the Azure CLI.
Configure link
After your target SQL managed instance is created, configure a link between the database on your SQL Server instance and Azure SQL Managed Instance. First, prepare your environment and then configure a link by using SQL Server Management Studio (SSMS) or scripts.
Data sync and cutover
After your link is established, and you're ready to migrate, follow these steps (typically during a maintenance window):
- Stop the workload on the primary SQL Server database so the secondary database on SQL Managed Instance catches up.
- Validate all data has made it over to the secondary database on SQL Managed Instance.
- Fail over the link to the secondary SQL managed instance by choosing Planned failover.
- (For SQL Server 2022 migrations) Check the box to Remove link after successful failover to ensure that failover is one way, and the link is removed.
- Cut over the application to connect to the SQL managed instance endpoint.
Validate migration
After you've cut over to the SQL managed instance target, monitor your application, test performance and remediate any issues.
Reverse migrate (SQL Server 2022)
Starting with SQL Server 2022 CU10, you can configure a link with Azure SQL Managed Instance as the initial primary and SQL Server as the secondary. This capability allows you to reverse migrate from Azure SQL Managed Instance to SQL Server 2022.
To reverse a migration, follow the same steps to configure the link, but start the process with the SQL Managed Instance as your migration source, and the SQL Server 2022 instance as the migration target.
Related content
To use the link:
- Prepare environment for the Managed Instance link
- Configure link between SQL Server and SQL Managed instance with SSMS
- Configure link between SQL Server and SQL Managed instance with scripts
- Fail over the link
- Best practices for maintaining the link
To learn more about the link:
For other replication and migration scenarios, consider: