Domain 1 β€” Module 4 of 5 80%
4 of 28 overall
Domain 1: Plan and Implement Data Platform Resources Free ⏱ ~12 min read

Migration Planning: Online vs Offline

Evaluate migration requirements for Azure SQL. Understand the differences between online and offline migration strategies, and when to use each approach.

Planning a migration

Simple explanation

Think of migration like moving house.

Offline migration is packing everything into a truck, driving to the new house, and unpacking. While the truck is in transit, nobody lives in either house. Simple, but there’s downtime.

Online migration is like moving one room at a time while still living in the old house. You move the big furniture first (initial sync), then keep forwarding mail (continuous replication) until you flip the mailbox to the new address (cutover). Much more complex, but near-zero downtime.

Migration assessment β€” what to evaluate

Before moving anything, Kenji runs a thorough assessment of NorthStar’s 200 databases:

Compatibility assessment

Assessment AreaWhat to CheckTool
SQL compatibilityDeprecated features, unsupported T-SQL, compatibility levelAzure Migrate, Data Migration Assistant (DMA)
Feature parityFeatures used on-prem but not available on target (FILESTREAM, CLR, SSRS)Azure Migrate, DMA
Database sizeTotal data size affects migration duration and target tier selectionsys.database_files, Azure Migrate
DependenciesCross-database queries, linked servers, applications connecting to the databaseApplication dependency mapping
Downtime toleranceHow long can the application be offline during cutover?Business requirements

Target selection rules

If the source uses…Target should be…
SQL Server Agent, cross-DB queries, linked serversAzure SQL Managed Instance
No instance-scoped features, modern appAzure SQL Database
FILESTREAM, SSRS, SSIS on same server, third-party toolsSQL Server on Azure VMs
Any SQL version, minimal changes wantedAzure SQL MI or SQL on VMs
Azure Migrate vs Data Migration Assistant

Azure Migrate is the centralised hub for discovery, assessment, and migration. It includes:

  • Discovery of on-prem SQL instances
  • Assessment reports (compatibility, readiness, SKU recommendations)
  • Integration with Azure Database Migration Service for execution

Data Migration Assistant (DMA) is the standalone tool for detailed compatibility assessment:

  • Identifies breaking changes, behaviour changes, and deprecated features
  • Recommends target Azure SQL platform
  • Generates a readiness report with remediation steps

The exam may use either tool name β€” know that Azure Migrate is the overarching service, DMA is the assessment-specific tool.

Online vs offline migration

This is the core decision in migration planning.

Online vs Offline Migration
AspectOfflineOnline
DowntimeHours to days (depends on DB size)Minutes (cutover only)
ComplexitySimple β€” stop, copy, startComplex β€” initial sync + continuous replication + cutover
Data loss riskNone (application is stopped)Minimal (replication lag during cutover)
Source availabilitySource offline during migrationSource stays online throughout
ToolsBackup/restore, BACPAC, BCP, DMS offlineDMS online, log replay, transactional replication
Best forSmall databases, acceptable downtime windowsLarge databases, 24/7 operations, minimal downtime tolerance
CostLower (simpler setup)Higher (requires DMS, network bandwidth, monitoring)

When to choose offline

Kenji uses offline migration for NorthStar’s smaller databases (under 100 GB) that have a maintenance window:

  1. Stop the application
  2. Take a final backup
  3. Restore to the target (or use BACPAC export/import)
  4. Validate data
  5. Redirect the application to the new target
  6. Done

Methods:

  • Native backup and restore β€” to Azure SQL MI or SQL on VMs (via Azure Blob Storage)
  • BACPAC export/import β€” to Azure SQL Database (schema + data in a portable file)
  • BCP (Bulk Copy Program) β€” for individual tables, flexible but manual
  • DMS offline mode β€” guided migration with validation

When to choose online

Kenji uses online migration for NorthStar’s mission-critical ERP database (800 GB, 24/7 operations):

  1. Set up Azure Database Migration Service (DMS)
  2. Initial full copy β€” bulk data transfer to target
  3. Continuous sync β€” DMS tails the transaction log, replicating changes in near real-time
  4. Application remains online during steps 2 and 3
  5. Cutover β€” stop writes to source, let sync catch up, redirect application. Downtime: minutes.

Methods:

  • Azure DMS online mode β€” to Azure SQL Database or MI
  • Log Replay Service (LRS) β€” to Azure SQL MI (continuous restore from log backups in Azure Blob Storage)
  • Transactional replication β€” to Azure SQL Database or MI
  • Always On Availability Group β€” extend an on-prem AG to include Azure as a replica (SQL on VMs)
Log Replay Service (LRS) for MI migration

LRS is purpose-built for migrating to Azure SQL Managed Instance:

  1. Take full + differential + log backups to Azure Blob Storage
  2. Start LRS β€” it continuously restores log backups as they arrive
  3. When ready, complete the final log backup and trigger cutover
  4. LRS restores the final log and brings the database online

LRS is free (included with MI) and works well for databases of any size. It’s the recommended online migration method for MI.

Migration tools at a glance

ToolTargetOnline?Offline?Notes
Azure DMSSQL DB, MIYesYesRecommended first choice for most migrations
Native backup/restoreMI, SQL VMNoYesVia Azure Blob Storage. Simplest for MI offline.
Log Replay ServiceMIYesNoPurpose-built for MI online migration
BACPACSQL DBNoYesExport/import via SqlPackage or Azure Portal
Transactional replicationSQL DB, MIYesNoContinuous replication, complex setup
BCP / BULK INSERTAllNoYesTable-level, good for specific data loads
Azure Data FactoryAllNoYesETL pipeline, good for data transformation during migration

Kenji’s migration checklist

Before any migration, Kenji validates:

  1. Compatibility report β€” no blocking issues from DMA/Azure Migrate
  2. Network bandwidth β€” sufficient for data transfer (calculate: DB size / available bandwidth = transfer time)
  3. Target sizing β€” target tier can handle the source workload (vCores, storage, IOPS)
  4. Application changes β€” connection strings, driver versions, retry logic for transient faults
  5. Rollback plan β€” what happens if migration fails? Keep source running until validation is complete.
  6. Validation queries β€” row counts, checksum comparisons, application smoke tests
Question

What is the main difference between online and offline migration?

Click or press Enter to reveal answer

Answer

Offline: source database is unavailable during migration (hours to days of downtime). Online: source stays available during migration, with only minutes of downtime during final cutover.

Click to flip back

Question

What is Log Replay Service (LRS) used for?

Click or press Enter to reveal answer

Answer

LRS is a free, purpose-built service for online migration to Azure SQL Managed Instance. It continuously restores log backups from Azure Blob Storage until cutover.

Click to flip back

Question

What tool should you use for a compatibility assessment before migration?

Click or press Enter to reveal answer

Answer

Azure Migrate (discovery + assessment hub) or Data Migration Assistant (DMA) for detailed compatibility analysis. Both identify breaking changes, deprecated features, and recommend target platforms.

Click to flip back

Knowledge Check

Kenji needs to migrate an 800 GB mission-critical database to Azure SQL Managed Instance with less than 15 minutes of downtime. Which migration method should he use?

Knowledge Check

Tomas is assessing a database for migration. He discovers it uses FILESTREAM, SSRS installed on the same server, and a third-party monitoring agent. Which target platform should he recommend?

Next up: Execute and Troubleshoot Migrations β€” implement online and offline migrations, move between Azure SQL services, and troubleshoot common migration issues.