πŸŽ‰ 75% of content is free forever β€” Unlock Premium from $10/mo β†’
CW
Search courses…
πŸ’Ό Servicesℹ️ Aboutβœ‰οΈ ContactView Pricing Plansfrom $10

Data Migration: Database Migration Service & AzCopy

Azure Data EngineeringData Migration⭐ Premium

Advertisement

Data Migration: Database Migration Service & AzCopy

Enterprise data migration strategies with DMS, AzCopy, and Azure Data Box

Migration Architecture

Architecture Diagram
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    MIGRATION ARCHITECTURE                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                     β”‚
β”‚  SOURCE                 MIGRATION              TARGET                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚ SQL      │────────>β”‚ Database     │──────>β”‚ Azure SQL    β”‚     β”‚
β”‚  β”‚ Server   β”‚         β”‚ Migration    β”‚       β”‚ Managed Inst β”‚     β”‚
β”‚  β”‚ On-Prem  β”‚         β”‚ Service      β”‚       β”‚              β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚ Files/   │────────>β”‚ AzCopy /     │──────>β”‚ ADLS Gen2    β”‚     β”‚
β”‚  β”‚ Folders  β”‚         β”‚ Data Box     β”‚       β”‚              β”‚     β”‚
β”‚  β”‚ On-Prem  β”‚         β”‚              β”‚       β”‚              β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚                                                                     β”‚
β”‚  MIGRATION PHASES:                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ 1. ASSESS    2. MIGRATE    3. VALIDATE    4. CUTOVER       β”‚   β”‚
β”‚  β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚   β”‚
β”‚  β”‚ β”‚Schema    β”‚ β”‚Full/     β”‚ β”‚Data      β”‚ β”‚Switch    β”‚      β”‚   β”‚
β”‚  β”‚ β”‚Analysis  β”‚ β”‚Incrementalβ”‚ β”‚Validationβ”‚ β”‚Traffic   β”‚      β”‚   β”‚
β”‚  β”‚ β”‚          β”‚ β”‚Load      β”‚ β”‚          β”‚ β”‚          β”‚      β”‚   β”‚
β”‚  β”‚ β”‚Perf      β”‚ β”‚CDC       β”‚ β”‚Row       β”‚ β”‚DNS       β”‚      β”‚   β”‚
β”‚  β”‚ β”‚Baseline  β”‚ β”‚Sync      β”‚ β”‚Counts    β”‚ β”‚Update    β”‚      β”‚   β”‚
β”‚  β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

AzCopy Commands

# Copy from on-prem to ADLS Gen2
azcopy copy "C:\data\sales\*" "https://stdatalake001.dfs.core.windows.net/raw/sales/?<SAS>" --recursive

# Sync directory (incremental)
azcopy sync "https://stdatalake001.dfs.core.windows.net/raw/sales/?<SAS>" "C:\backup\sales" --delete-destination

# Copy with access tier
azcopy copy "https://source.blob.core.windows.net/container/*" "https://stdatalake001.blob.core.windows.net/archive/?<SAS>" --block-blob-tier=Cool

# Parallel transfer
azcopy copy "https://source/*" "https://stdatalake001.dfs.core.windows.net/raw/?<SAS>" --recursive --parallel=32

DMS Migration

{
  "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
    }
  }
}

ℹ️

Pro Tip: Use AzCopy for file-based migrations (terabytes). Use DMS for database migrations with ongoing sync. Use Data Box for petabyte-scale offline migrations.

Interview Questions

Q1: How do you validate data after migration? A: 1) Compare row counts, 2) Validate checksums/hashes for critical columns, 3) Run business validation queries, 4) Compare aggregate metrics (sums, counts), 5) Test application functionality against target.

Q2: What is the difference between online and offline migration? A: Online migration keeps source running during migration (minimal downtime). Offline migration requires source downtime. Use online for production systems; offline for non-critical or batch workloads.

Q3: How do you handle schema changes during migration? A: Use DMS schema synchronization for ongoing migrations. For AzCopy/file migrations, implement schema validation checks and transformation pipelines post-migration.

Advertisement