🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Azure Data Migration: DMS, AzCopy, Data Box

Azure Data EngineeringData Migration⭐ Premium

Migrations go wrong for reasons that have little to do with bandwidth. The data arrives but nobody can prove it is complete, a schema assumption breaks on the target, and the rollback plan turns out to be a sentence in a document rather than a rehearsed procedure. A good migration plan is mostly a plan for verification and reversal, with the actual transfer being the shortest part.

In this lesson you will learn how to:

  • Pick the right transfer tool for volume, format, and downtime tolerance.
  • Assess the source estate before committing to a target design.
  • Validate a moved dataset with more than a row count.
  • Stage a cutover with a rollback path you have actually tested.

Prerequisites

  • !Comfort with Azure CLI or PowerShell
  • !Basic database backup and restore concepts
  • !An agreed source and target architecture

Pick the transfer method before you start

The tool choice drives cost, timeline, and risk, so make it early and write down the reasoning. Network-based tools suit data that can move during ordinary hours, while offline devices win when volume exceeds what a weekend window allows.

ScenarioToolStrengthWatch out for
Files up to a few TB, ongoingAzCopyRecursive, resumable, cheapBandwidth limits at peak
Structured database, low downtimeDatabase Migration ServiceCDC keeps target in syncSchema drift during the run
Hundreds of TB or air-gapped sourceData BoxPhysical, predictable durationShipping and handling schedule
Continuous application replicationAzure Migrate or log shippingNear-zero downtimeCompatibility of engines
Cross-cloud large object transferAzCopy or SFTP relayWorks with existing toolingEgress charges

A useful calculation is the effective transfer rate required to finish inside your window: total terabytes divided by available hours, then adjusted for protocol overhead. If that number approaches the measured line speed, the plan has no slack, and any hiccup becomes a missed cutover.

Assess the source before designing the target

Assessment is the phase teams skip when the deadline is tight, and it is where the expensive surprises live. Inventory schemas, stored procedures, job scheduling, character encodings, and any vendor-specific extensions the source engine tolerates. Tools such as Azure Migrate and the DMS assessment reports can enumerate these, but someone still has to read the results and decide what to rebuild versus retire.

Include the operational surface. External jobs that write to the source, hard-coded server names in applications, linked servers, and agents that assume a particular collation all become migration work items. Listing them now costs an afternoon; discovering them during cutover costs the cutover.

Moving files with AzCopy

AzCopy is the default for file movement because it is resumable, parallel, and scriptable, which means the same command works for the first copy and for every incremental run afterwards.

SAS=$(az storage container generate-sas \
  --account-name stadls001 --name raw \
  --permissions racwl --expiry-time 2026-12-31T00:00:00Z \
  --auth-mode login -o tsv)

azcopy copy "/data/sales/*" \
  "https://stadls001.dfs.core.windows.net/raw/sales?$SAS" \
  --recursive --cap-mbps 400 --check-length

azcopy sync "/data/sales" \
  "https://stadls001.dfs.core.windows.net/raw/sales?$SAS" \
  --delete-destination true --exclude-pattern "*.tmp"

azcopy copy "https://source.blob.core.windows.net/archive/*" \
  "https://stadls001.blob.core.windows.net/cold?$SAS" \
  --block-blob-tier Cool --recursive --parallel 32

The sync mode with delete semantics is what makes the second and third passes cheap: only changed files transfer, and files removed at the source disappear at the target so the two stay genuinely comparable. Use a transfer window and throttle with --cap-mbps if the link is shared with production traffic, because a saturated network will generate a support ticket long before the migration finishes.

Database migration with continuous synchronization

For databases, the pattern is a full load followed by change data capture so the target stays current while applications continue against the source. The final cutover then only needs to drain the last seconds of changes.

{
  "properties": {
    "sourceConnectionInfo": {
      "dataSource": "sqlserver",
      "connectionDetails": {
        "dataSource": "onprem-sql.company.com",
        "authentication": "Windows",
        "encryptConnection": true
      }
    },
    "targetConnectionInfo": {
      "dataSource": "sql-managed-instance.database.windows.net",
      "connectionDetails": {
        "dataSource": "sql-managed-instance.database.windows.net",
        "authentication": "SQL",
        "encryptConnection": true
      }
    },
    "databaseSettings": {
      "selectedDatabases": ["sales_db", "inventory_db"],
      "databasesOfflineMigration": false,
      "backupMode": "BackupOnCompletion"
    }
  }
}

Let the sync run for several days before you even discuss a cutover date. That period exposes the schema changes, blocked transactions, and long-running jobs that a static assessment cannot see, and it gives you a lag figure you can quote when someone asks how long the freeze will last.

Validation that is more than a row count

Row counts are necessary and nowhere near sufficient. A migration can match on count while every numeric column has been silently truncated or every date shifted by a timezone.

Compare aggregates per key column, checksums over representative tables, and a sample of full rows pulled at random from both sides. Then run the business queries the audience actually depends on and compare the results with the pre-migration baseline. For large tables, partition the comparison so it completes inside the validation window rather than becoming a single query that runs for hours.

SELECT
    count(*)                        AS row_count,
    sum(total_amount)               AS revenue,
    min(order_date)                 AS first_order,
    max(order_date)                 AS last_order,
    count(DISTINCT customer_id)     AS customers
FROM dbo.fact_sales;

-- Re-run the identical query against the target and diff the output

Record the results as an artifact attached to the change record. When someone asks three weeks later whether the migration was correct, you want a document rather than a recollection.

Cutover, and the rollback you hope not to use

A cutover is a short, scripted sequence: stop writes to the source, confirm replication lag is zero, run final validation, repoint the application, verify, and open the doors. Assign each step an owner, an expected duration, and a decision point for aborting.

Rehearse the rollback in a lower environment. In practice rollback means pointing the application back at the source and accepting the loss of anything written during the attempt, so decide in advance how much loss is tolerable. If the answer is none, the migration must run with the source frozen for the entire validation window, which changes the schedule you promised.

Keeping the transfer affordable

Migration costs are easy to underestimate because they arrive after the project ends. Egress from the source environment, storage in the target at the redundancy you selected, and Data Box device fees all accumulate during a project that may run for months while data is copied, validated, then copied again.

Use access tiers deliberately. Land initial copies in cool or archive storage if they will not be queried during validation, and promote to hot only when the target becomes the system of record. Reuse the same target paths for repeated sync runs so you are not paying twice to hold identical data in two locations.

Also account for the destination redundancy choice. Geo-redundant storage roughly doubles the storage charge, which may be justified for a production lake but wasteful for a staging area that exists for a fortnight. Making those decisions per path rather than per account keeps the bill proportional to what actually needs protection.

Common Mistakes

Skipping assessment to start copying sooner

Fix: Inventory schemas, jobs, and connections first; unknown dependencies are the most common cause of cutover failure.

Validating with row counts only

Fix: Compare aggregates, checksums, and a sample of full rows, then run the queries your users rely on.

Planning a rollback as a sentence rather than a procedure

Fix: Rehearse the rollback in a lower environment and record the acceptable data-loss window in advance.

Sharing the network link with production without throttling

Fix: Cap AzCopy throughput and schedule heavy windows so the migration never starves live traffic.

Best Practices

  • Run continuous sync for several days before naming a cutover date
  • Attach validation results to the change record as evidence
  • Size the required transfer rate against measured line speed with margin
  • Freeze writes for the validation window when zero data loss is required
  • Keep the source intact until at least one full business cycle has passed

Questions interviewers ask about migration

đŸŽ¯Interview Tip

Interviewers often probe the trade between online and offline approaches. Answer with the constraint that decides it: acceptable downtime and total volume. That framing shows you are reasoning from requirements rather than from tool familiarity.

Interview Questions

Q1: When would you choose Data Box over AzCopy?

When volume makes network transfer impractical inside the available window, typically hundreds of terabytes or more, or when the source is bandwidth-constrained or disconnected. Data Box moves data physically and then uploads it from an Azure staging area.

Q2: How do you achieve near-zero downtime for a database migration?

Take an initial full load, then keep the target synchronized with change data capture until lag is minimal, briefly freeze writes, drain the remaining changes, validate, and repoint the application. The freeze window is measured in minutes.

Q3: How do you handle schema changes discovered mid-migration?

Because sync runs for days before cutover, these surface early. Apply compatible changes to the target schema, revalidate the affected objects, and use the DMS schema synchronization capability where the engine supports it.

Q4: What is your rollback strategy?

Point the application back at the source, accept the agreed data-loss window for anything written during the attempt, and restore any writes captured from the target if necessary. The strategy is only credible once it has been rehearsed.

Key Takeaways

  • Choose the transfer tool from volume, downtime, and network constraints
  • Assessment work items belong in the plan, not in the cutover
  • AzCopy sync keeps repeated runs cheap and comparable
  • Full load plus CDC is the standard path to a short freeze window
  • Validation needs aggregates and checksums, not just counts
  • Rehearse rollback and agree the data-loss window before cutover day
🔒

Premium Content

Azure Data Migration: DMS, AzCopy, Data Box

You've previewed the first section. Unlock this full lesson and 900+ advanced tutorials with a Premium plan.

đŸŽ¯End-to-end Projects
đŸ’ŧInterview Prep
📜Certificates
🤝Community Access

Already a member? Log in

CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-13

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Advertisement