This chapter covers Azure Database Migration Service (DMS), a fully managed service that enables seamless migrations from multiple database sources to Azure data platforms with minimal downtime. For the AZ-305 exam, this topic appears in approximately 15–20% of questions related to data migration strategies, often in scenario-based questions about choosing the right migration tool. You must understand DMS's capabilities, supported sources, migration modes (online vs. offline), and how it integrates with other Azure services like Azure Data Factory and Azure SQL Database.
Jump to a section
Imagine you are moving from an old house (on-premises database) to a new house (Azure SQL Database). You have many rooms of furniture (schemas, tables, indexes, stored procedures, views, and data). Doing it yourself would be overwhelming—you'd have to pack everything, rent a truck, drive, unpack, and hope nothing breaks. Instead, you hire Azure Database Migration Service (DMS), a professional moving company. The movers first assess your house: they measure doorways, identify fragile items, and note any tricky stairs. This is like the pre-migration assessment that checks for compatibility issues and suggests fixes. Then, on moving day, they handle the heavy lifting: they carefully pack each room, load the truck, drive to the new house, and unpack. But here's the key: while they are moving, the old house still has its original furniture—you can still live there. The movers keep a log of any new items you buy or move during the process (ongoing changes). Once everything is in the new house, they do a final sweep: they bring over only the items that changed since the last big move (incremental sync). Finally, you cut the utilities at the old house and switch to the new one (cutover). DMS does all this with minimal downtime: you only stop using the old database for a few minutes at the very end. Without DMS, you'd have to take the old database offline for hours or days—like closing your old house before the movers even start packing.
What is Azure Database Migration Service?
Azure Database Migration Service (DMS) is a fully managed Azure service designed to simplify and accelerate the migration of databases from on-premises, other clouds, or virtual machines to Azure data platforms. It supports both offline (one-time, full data movement) and online (minimal downtime, continuous sync) migrations. DMS automates the tedious tasks of schema conversion, data transfer, and synchronization, reducing manual effort and risk of errors.
Why DMS Exists
Traditionally, database migrations were complex, time-consuming, and error-prone. They required manual scripting, extended downtime, and deep expertise in both source and target platforms. DMS addresses these challenges by providing: - Automated assessment: Identifies compatibility issues and suggests remediation. - Minimal downtime: Online migration mode allows applications to remain operational during the bulk of the migration. - Integrated tooling: Works with Azure Data Studio, Azure Portal, PowerShell, and CLI. - Support for heterogeneous migrations: From Oracle, PostgreSQL, MySQL, MongoDB, and more.
How DMS Works Internally
DMS uses a migration pipeline that consists of several phases:
1. Assessment: DMS first performs a pre-migration assessment using the Data Migration Assistant (DMA) or Azure Migrate. This checks for feature parity, blocking issues, and performance recommendations. 2. Schema Migration: DMS converts the source schema to the target schema. For homogeneous migrations (e.g., SQL Server to Azure SQL), this is straightforward. For heterogeneous migrations (e.g., Oracle to Azure SQL), DMS uses the Data Migration Assistant to map data types and objects. 3. Data Migration: - Offline mode: DMS takes a full snapshot of the source database and restores it to the target. The source database must be offline during this process. - Online mode: DMS performs an initial full load, then continuously syncs changes from the source to the target using change data capture (CDC) or transaction log replication. The source remains operational until cutover. 4. Cutover: For online migrations, after the initial sync catches up, you perform a final sync to bring the target fully up to date, then switch the application connection string to the target. The source is taken offline only at this point.
Key Components, Values, Defaults, and Timers
Migration Project: An Azure resource that defines source, target, and migration activity settings.
Migration Activity: The actual migration job within a project. Each activity can be a full load or incremental sync.
Supported Sources:
- SQL Server (on-premises, Azure VM) - Oracle (versions 10g, 11g, 12c, 18c, 19c) - PostgreSQL (on-premises, Azure VM) - MySQL (on-premises, Azure VM) - MongoDB (up to version 4.0) - Supported Targets:
- Azure SQL Database (single, elastic pool) - Azure SQL Managed Instance - Azure SQL Server on Azure VM - Azure Database for PostgreSQL (Single Server, Flexible Server) - Azure Database for MySQL (Single Server, Flexible Server) - Azure Cosmos DB (for MongoDB API) - Default Timeout: The default timeout for migration activities is 24 hours. This can be extended via REST API or PowerShell. - Bandwidth Requirement: For online migrations, Microsoft recommends at least 10 Mbps network bandwidth between source and Azure. - Database Size Limits: DMS can handle databases up to 2 TB for offline migrations and 1 TB for online migrations (for SQL Server). Larger databases may require splitting or using Azure Data Factory.
Configuration and Verification Commands
You can create and manage DMS using Azure CLI, PowerShell, or Azure Portal. Here are key commands:
Azure CLI
Create a DMS instance (Standard tier for production, Premium for high throughput):
az dms create \
--resource-group myResourceGroup \
--name myDMS \
--location eastus \
--sku-name Standard_1vCoreCreate a migration project:
az dms project create \
--resource-group myResourceGroup \
--service-name myDMS \
--name myProject \
--source-platform SQL \
--target-platform SQLDBCreate a migration activity (offline):
az dms project task create \
--resource-group myResourceGroup \
--service-name myDMS \
--project-name myProject \
--name myTask \
--task-type OfflineConfigurationMonitor migration status:
az dms project task show \
--resource-group myResourceGroup \
--service-name myDMS \
--project-name myProject \
--name myTask \
--query 'properties.state'PowerShell
New-AzDataMigrationService -ResourceGroupName myResourceGroup -Name myDMS -Location eastus -Sku Standard_1vCore
New-AzDataMigrationProject -ResourceGroupName myResourceGroup -ServiceName myDMS -ProjectName myProject -SourceType SQL -TargetType SQLDB
New-AzDataMigrationTask -ResourceGroupName myResourceGroup -ServiceName myDMS -ProjectName myProject -TaskName myTask -TaskType OfflineConfigurationInteraction with Related Technologies
Azure Data Factory (ADF): For large-scale or complex migrations (e.g., many databases, or when transformation is needed), ADF can be used alongside DMS. ADF handles data movement and transformation, while DMS focuses on schema and continuous sync.
Azure Database Migration Assistant (DMA): Used for assessment and schema migration. DMS can invoke DMA internally for heterogeneous migrations.
Azure Migrate: Provides a unified hub for discovery, assessment, and migration of entire workloads, including databases via DMS.
Azure SQL Database / Managed Instance: The primary targets for SQL Server migrations. DMS supports both.
Azure Cosmos DB: For MongoDB migrations, DMS migrates data to Cosmos DB's MongoDB API.
Performance and Scaling Considerations
DMS SKUs: Standard tier (up to 4 vCores) and Premium tier (up to 16 vCores) for higher throughput. Premium tier is recommended for large databases or online migrations.
Parallelism: DMS can parallelize data copy within a database (e.g., multiple tables simultaneously). The degree of parallelism is controlled by the service and can be tuned via settings.
Network: Use Azure ExpressRoute or VPN for consistent bandwidth. For online migrations, low latency is critical.
Source Impact: During initial full load, DMS reads the source database, which may impact source performance. Schedule during low-usage periods.
Assess Source Database
Use Data Migration Assistant (DMA) or Azure Migrate to evaluate the source database for compatibility with the target Azure platform. This step identifies blocking issues such as unsupported features (e.g., SQL Server Agent jobs, CLR assemblies) and provides recommendations for remediation. The assessment generates a report that lists all issues and their severity. For the exam, know that DMA is a separate tool but DMS can invoke it. The assessment is critical because it prevents migration failures later.
Provision Target Azure Database
Create the target Azure database (e.g., Azure SQL Database, Azure SQL Managed Instance) with the appropriate tier and size. Ensure firewall rules allow connections from DMS (enable 'Allow Azure services and resources to access this server'). For online migrations, the target must be configured with the same service tier and performance level as the source, or higher, to handle the load. Also, enable change tracking if required for CDC.
Create DMS Service and Project
In the Azure Portal, create a Database Migration Service instance. Choose the appropriate SKU (Standard or Premium) based on the migration size and type (online requires Premium). Then create a migration project, selecting the source and target database types. For example, source: SQL Server, target: Azure SQL Database. You also specify the migration activity type (offline or online). The project serves as a container for the actual migration tasks.
Configure Migration Activity
Within the project, create a migration activity. Provide source connection details (server name, authentication, database name) and target connection details. For online migrations, you must enable transactional replication on the source to capture changes. DMS will set up the necessary replication if permissions allow. You also specify tables to migrate (or all). The activity then begins the initial full load of schema and data.
Monitor and Perform Cutover
During the migration, monitor the status in the Azure Portal. For online migrations, after the initial full load completes, DMS enters continuous sync mode. You can see the remaining changes to be applied. When the lag is minimal (e.g., less than a minute), you initiate cutover. This stops the source database from accepting changes (or takes it offline), applies the final sync, and then the target becomes the new primary. For offline migrations, cutover is immediate after the full load.
Enterprise Scenario 1: SQL Server to Azure SQL Managed Instance
A large financial services company needs to migrate a 5-TB SQL Server 2017 database to Azure SQL Managed Instance to leverage PaaS benefits while maintaining SQL Server Agent and cross-database dependencies. They use DMS in online mode to minimize downtime. The source is a SQL Server Always On availability group with multiple replicas. DMS is configured to use a secondary replica as the source to reduce impact on the primary. The migration takes two weeks for the initial full load due to network bandwidth constraints (50 Mbps). During continuous sync, replication lag stays under 5 seconds. At cutover, the application is paused for 2 minutes while the final sync completes. Key lesson: Always test cutover procedures in a staging environment.
Enterprise Scenario 2: Oracle to Azure SQL Database
A retail company is migrating its Oracle 12c database (2 TB) to Azure SQL Database to reduce licensing costs. This is a heterogeneous migration requiring schema conversion. DMS uses the Data Migration Assistant to convert Oracle schemas, including PL/SQL packages, to T-SQL. However, some complex stored procedures require manual refactoring. The assessment phase identifies these issues early. The migration is performed offline because the application can tolerate 4 hours of downtime during a maintenance window. DMS completes the full load in 3 hours. After migration, the team runs compatibility tests. Common pitfalls: Oracle sequences may not map directly to SQL Server identity columns, and NULL handling differs.
Common Misconfigurations
Insufficient network bandwidth: Online migrations fail if bandwidth is below 10 Mbps. Use ExpressRoute or increase bandwidth.
Firewall rules not updated: DMS must be allowed through source and target firewalls. The source must allow outbound connections to Azure.
SKU selection: Using Standard tier for online migration will cause errors because Standard does not support online mode. Always use Premium for online.
Permissions: DMS needs db_owner on the source and db_owner on the target. For online, it needs sysadmin on the source to set up replication.
Ignoring assessment: Skipping the assessment leads to migration failures due to unsupported features.
AZ-305 Exam Focus on Azure Database Migration Service
This topic is covered under objective 4.3: 'Design a data migration solution.' The exam tests your ability to choose the appropriate migration tool (DMS vs. Azure Data Factory vs. other tools) and configure it correctly. Key exam points:
Online vs. Offline: Know that online migrations require Premium SKU and support minimal downtime. Offline is for scenarios where downtime is acceptable. The exam will present a scenario with uptime requirements—if 'minimal downtime' or 'zero downtime' is stated, choose online.
Supported Sources and Targets: Memorize the list. Common wrong answer: choosing DMS for migrating from on-premises SQL Server to Azure Cosmos DB (not supported directly; use Azure Data Factory instead).
Assessment Requirement: Always perform an assessment first. A question might present a scenario where a customer has not assessed compatibility—the correct answer is to run DMA first.
SKU Selection: Standard for offline, Premium for online. A trap: choosing Standard for a 10-TB database (Standard supports up to 2 TB per database for offline).
Cutover Process: For online migrations, cutover is a manual step initiated by the user. The exam may ask about the final step—answer is 'perform cutover.'
Common Wrong Answers and Why
Wrong: 'Use Azure Data Factory for all database migrations.' Reality: ADF is for data transformation and bulk movement, not for continuous sync with minimal downtime. DMS is better for online migrations.
Wrong: 'Offline migration always takes less time than online.' Reality: Offline may be faster for small databases, but for large databases, online can be faster because the source remains operational.
Wrong: 'DMS can migrate to any Azure data service.' Reality: DMS supports specific targets only.
Specific Numbers and Terms
Default timeout: 24 hours.
Minimum bandwidth: 10 Mbps for online.
Maximum database size for offline: 2 TB (SQL Server).
Maximum database size for online: 1 TB (SQL Server).
SKU names: Standard_1vCore, Standard_2vCores, Standard_4vCores, Premium_4vCores, Premium_8vCores, Premium_16vCores.
Edge Cases
Cross-region migrations: DMS can migrate across regions, but latency may increase sync lag.
Encrypted databases: DMS supports transparent data encryption (TDE) for SQL Server; the certificate must be backed up and restored.
Large numbers of databases: DMS can handle multiple databases in a single project, but each database is a separate activity.
How to Eliminate Wrong Answers
If the scenario mentions 'continuous sync' or 'minimal downtime,' eliminate any answer that suggests offline migration or a tool that does not support CDC.
If the source is Oracle or PostgreSQL, verify that the target is one of the supported Azure databases. If not, the answer is wrong.
If the question asks about 'assessment,' the answer will involve DMA or Azure Migrate, not DMS directly.
DMS supports both offline (full load, downtime required) and online (minimal downtime, continuous sync) migrations.
Online migrations require Premium SKU; offline migrations can use Standard SKU.
Always perform a pre-migration assessment using DMA or Azure Migrate to identify compatibility issues.
Supported sources include SQL Server, Oracle, PostgreSQL, MySQL, and MongoDB.
Supported targets include Azure SQL Database, Azure SQL Managed Instance, Azure Database for PostgreSQL/MySQL, and Azure Cosmos DB (MongoDB API).
Maximum database size for offline migration is 2 TB (SQL Server); for online, it is 1 TB.
Minimum network bandwidth for online migration is 10 Mbps; use ExpressRoute for consistent performance.
Cutover is a manual step in online migrations; the source is taken offline only at cutover.
DMS does not support migrations to Azure Synapse Analytics or Azure Data Lake Storage.
For heterogeneous migrations (e.g., Oracle to Azure SQL), expect manual refactoring of complex stored procedures.
These come up on the exam all the time. Here's how to tell them apart.
Azure Database Migration Service (DMS)
Designed specifically for database migrations with minimal downtime.
Supports online (continuous sync) migrations using CDC.
Integrates with DMA for schema conversion and assessment.
Managed service with built-in monitoring and cutover orchestration.
Best for one-time migrations with complex source-target compatibility.
Azure Data Factory (ADF)
General-purpose data integration and ETL tool.
Does not natively support continuous sync for databases (use change tracking with custom logic).
Requires custom pipelines for schema conversion.
More flexible for data transformation and bulk loads.
Better for ongoing data movement or when significant transformation is needed.
Mistake
Azure Database Migration Service can migrate any database to any Azure data service.
Correct
DMS supports only specific source-target pairs, e.g., SQL Server to Azure SQL, Oracle to Azure SQL, PostgreSQL to Azure Database for PostgreSQL, etc. It does not support migrations to Azure Cosmos DB (except MongoDB API), Azure Synapse Analytics, or Azure Data Lake Storage. Use other tools like Azure Data Factory for those.
Mistake
Online migration requires the source database to be offline during the initial full load.
Correct
No. In online migration, the source remains fully operational throughout the migration. Only at cutover is the source briefly taken offline (usually minutes). The initial full load is performed while the source is online and accepting changes; changes are continuously synced.
Mistake
The Standard SKU of DMS supports both offline and online migrations.
Correct
The Standard SKU supports only offline migrations. Online migrations require the Premium SKU. This is a common exam trap. Always check the migration type (online vs. offline) when choosing a SKU.
Mistake
DMS automatically handles all schema conversions, including stored procedures and triggers, without any manual intervention.
Correct
For homogeneous migrations (e.g., SQL Server to Azure SQL), schema conversion is mostly automatic. For heterogeneous migrations (e.g., Oracle to Azure SQL), DMS uses DMA to convert schemas, but complex objects like stored procedures with proprietary syntax may require manual refactoring.
Mistake
DMS can migrate databases larger than 2 TB without any additional configuration.
Correct
For SQL Server, the maximum database size for offline migration is 2 TB. For online, it is 1 TB. Larger databases require splitting into smaller chunks or using alternative tools like Azure Data Factory with multiple pipelines.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
DMS is purpose-built for database migrations, offering both offline and online modes with minimal downtime. It integrates with DMA for schema conversion and provides a managed cutover process. Azure Data Factory is a general-purpose data integration tool that can move data but does not natively support continuous sync for databases without custom logic. For one-time migrations requiring minimal downtime, DMS is the preferred choice. For ongoing data integration or when heavy transformation is needed, ADF is better.
No, DMS does not support direct migration from SQL Server to Azure Cosmos DB. DMS supports SQL Server to Azure SQL Database/Managed Instance, and MongoDB to Azure Cosmos DB (MongoDB API). For SQL Server to Cosmos DB, you would need to use Azure Data Factory or write custom code to transform the data.
You need a Premium SKU (e.g., Premium_4vCores or higher) because online migrations require the Premium tier. The Standard SKU only supports offline migrations. The size (500 GB) is within the 1 TB limit for online migrations, so no splitting is required.
The default timeout for a migration activity is 24 hours. If the migration takes longer, you can extend the timeout using the REST API or PowerShell. For very large databases, consider splitting the migration or using a higher SKU to improve throughput.
No. During an online migration, the source database remains fully operational. The initial full load is performed while the source is online and accepting changes. DMS captures ongoing changes via CDC or replication and syncs them to the target. Only at cutover do you briefly take the source offline (typically a few minutes).
The pre-migration assessment (using DMA) will identify unsupported features and mark them as blocking issues. You must remediate these before starting the migration. Examples include SQL Server Agent jobs (which can be migrated to Azure SQL Managed Instance but not to Azure SQL Database) or CLR assemblies (which may need to be rewritten).
Yes, a single DMS project can contain multiple migration activities, each targeting a different database. However, each database migration is a separate activity. You can run multiple activities in parallel, but be mindful of resource limits on the DMS instance and the target.
You've just covered Azure Database Migration Service — now see how well it sticks with free AZ-305 practice questions. Full explanations included, no account needed.
Done with this chapter?