Lesson 4 of 5 Migration Solutions

Choosing a Database Migration Path

This lesson explains online and offline migration, and the tools for each engine.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish online from offline migration.
  • Compare Database Migration Service, Log Replay Service and Managed Instance link.
  • Choose a tool from stated requirements.

Online and offline

The key decision is how long a database can be unavailable. In an offline migration, the application stops, data is copied, and the application restarts against the new database. It is simple, but downtime depends on the size of the data. In an online migration, an initial copy is followed by continuous replication of changes, and a short cutover is performed when the target has caught up. Downtime is minimal, but the process is more complex.

The target also matters, and the source engine determines the effort. A homogeneous migration keeps the same engine, such as SQL Server to Azure SQL. A heterogeneous migration changes the engine, such as Oracle to PostgreSQL, and needs schema and code conversion.

Sort into groups

Homogeneous or heterogeneous?

Exam skills 4.3.4

Classify each database migration.

Log in to try this activity Interactive activities are free with an account.

Azure Database Migration Service

Azure Database Migration Service (DMS) is the managed service for moving databases at scale. For SQL Server, it supports online and offline migration to SQL Managed Instance and SQL Server on Azure virtual machines, and offline migration to Azure SQL Database. It can run through a private endpoint, but it does not migrate TDE-protected databases to every target, or logins, without additional steps.

Azure Data Studio, which once hosted the Azure SQL migration extension, was retired on 28 February 2026. Its replacement for SQL development is Visual Studio Code with the MSSQL extension, and the migration can be run from the Azure portal, Azure Arc, the Azure CLI or PowerShell. Older guidance that names Azure Data Studio should be read with that in mind.

Further options for SQL Managed Instance

Two additional tools target SQL Managed Instance.

Log Replay Service

Log Replay Service (LRS) is a free cloud service, which restores standard SQL Server backups from Blob Storage to SQL Managed Instance. It can run in autocomplete mode, or in continuous mode, in which logs are replayed until a final cutover. An LRS job can run for at most 30 days. It suits teams who want control, and those who already manage native backups.

Managed Instance link

The Managed Instance link uses distributed availability group technology to replicate databases from SQL Server to SQL Managed Instance in near real time. It gives the shortest cutover and suits mission-critical databases. It also allows reads on the managed instance during the migration, which reduces risk. It supports one-way failover from SQL Server 2016 to 2019, and two-way failover from SQL Server 2022 or 2025, given a matching update policy, which allows a real failback path.

The following comparison recaps the tools for SQL Server.

Database Migration Service
TargetSQL Database, Managed Instance, SQL on VMs
MechanismManaged migration service
DowntimeMinimal when online
Failback possibleNo
Choose when Managed, general-purpose migrations
Log Replay Service
TargetManaged Instance
MechanismReplay of backups
DowntimeMinimal in continuous mode
Failback possibleNo
Choose when Control through native backups
Managed Instance link
TargetManaged Instance
MechanismDistributed availability group
DowntimeShortest
Failback possibleYes, from SQL Server 2022 or later
Choose when Mission-critical migrations needing failback

The following diagram shows the link and why the alternatives fall short.

Migrating a 3 TB SQL Server 2022 database that uses SQL Server Agent and cross-database queries. SQL Managed Instance supports both, and the Managed Instance link replicates in near real time for a cutover of minutes; on SQL Server 2022 it supports two-way failover, a return path that Database Migration Service does not offer.
DMS stands for Azure Database Migration Service.
Scenario questions

Choosing a SQL migration tool

Exam skills 4.3.4

Choose the tool for each SQL Server migration to Managed Instance.

Log in to try this activity Interactive activities are free with an account.

Other paths

Several other paths exist. SQL Server Migration Assistant (SSMA) converts schemas and migrates data from Oracle, Db2, MySQL, SAP ASE and Access to SQL Server and Azure SQL. Transactional replication can copy data to Azure SQL Database with minimal downtime. BACPAC exports provide an offline transfer for small databases. A native backup and restore from Blob Storage works for SQL Managed Instance and for SQL Server on virtual machines, but not for Azure SQL Database.

Open-source engines use the migration tools native to those services. Azure Database for PostgreSQL and MySQL each provide a migration service for offline and online moves, and native tools such as pg_dump and mysqldump suit small databases. MongoDB workloads can move to Azure Cosmos DB for MongoDB or Azure DocumentDB, keeping their existing drivers.

Choosing a target and tool

The following table recaps some common migration requirements.

RequirementRecommendation
SQL Server to Managed Instance, minimal downtime, managed serviceDatabase Migration Service, online
SQL Server to Managed Instance, near-zero downtime, with failbackManaged Instance link
SQL Server to Azure SQL DatabaseDatabase Migration Service, offline
Oracle to Azure SQLSQL Server Migration Assistant
Backups already in Blob Storage, to Managed InstanceLog Replay Service
Match the pairs

Migration tool by requirement

Exam skills 4.3.4

Match each database migration requirement with its tool.

Log in to try this activity Interactive activities are free with an account.
Worked example

Minimal downtime migration

A hospital runs SQL Server 2022 with a 3 TB database, which uses SQL Server Agent and cross-database queries. It wants a PaaS target, a cutover of under five minutes, and the ability to return to on-premises SQL Server if a serious problem appears after cutover. Which solution should you recommend?

SQL Server Agent and cross-database queries point to SQL Managed Instance as the target. The Managed Instance link fits the migration requirement, as it replicates in near real time, gives a very short cutover, and on SQL Server 2022 it supports a two-way failover, which provides a return path.

Database Migration Service online would meet the downtime target, but it offers no failback. A backup and restore would need hours of downtime for 3 TB. Azure SQL Database does not support SQL Server Agent, so it is the wrong target, regardless of tool.

Check yourself

Can a native SQL Server backup be restored directly to Azure SQL Database?

Show answer

No. Native restore works for SQL Managed Instance and SQL Server on virtual machines.

Exam Tips

Remember for the exam

  • Offline is simple, with downtime; online replicates changes for a short cutover.
  • Database Migration Service: online to Managed Instance and SQL on VMs; offline to SQL Database.
  • Managed Instance link gives the shortest cutover, and failback from SQL Server 2022.
  • SSMA converts other engines to SQL targets.
  • Azure Data Studio is retired.