Tuesday, November 11, 2025

AWS DMS for Data Migration and more

 🧠 DBA Tip: AWS DMS Isn’t Just for Migrations — It’s a Hidden Gem for Continuous Replication

If you’ve ever had to move a live production database with near-zero downtime, AWS Database Migration Service (DMS) can save your weekend.

Here’s a quick example setup I recently used to replicate an on-prem Oracle DB to Amazon Aurora PostgreSQL — while keeping both in sync until cutover 👇


⚙️ Step 1: Create a Replication Instance

aws dms create-replication-instance \ --replication-instance-identifier dms-repl-prod \ --replication-instance-class dms.r6i.large \ --allocated-storage 100 \ --multi-az

⚙️ Step 2: Define Source and Target Endpoints

aws dms create-endpoint \ --endpoint-identifier oracle-src \ --endpoint-type source \ --engine-name oracle \ --username admin \ --password '****' \ --server-name oradb01.example.com \ --port 1521 \ --database-name PRODDB aws dms create-endpoint \ --endpoint-identifier aurora-target \ --endpoint-type target \ --engine-name aurora-postgresql \ --username dbauser \ --password '****' \ --server-name aurora-cluster.cluster-xyz.us-east-1.rds.amazonaws.com \ --port 5432 \ --database-name prod_migrated

⚙️ Step 3: Create and Start the Migration Task

aws dms create-replication-task \ --replication-task-identifier oracle-to-aurora-task \ --source-endpoint-arn arn:aws:dms:...:endpoint/oracle-src \ --target-endpoint-arn arn:aws:dms:...:endpoint/aurora-target \ --migration-type full-load-and-cdc \ --table-mappings file://table-mappings.json \ --replication-task-settings file://task-settings.json

Then start it:

aws dms start-replication-task \ --replication-task-arn arn:aws:dms:...:task/oracle-to-aurora-task \ --start-replication-task-type start-replication

🔍 Pro Tips for DBAs:

  • Use --migration-type full-load-and-cdc to keep the target updated while users are still writing to the source.

  • Check task status & latency:

    aws dms describe-replication-tasks \ --filters "Name=replication-task-id,Values=oracle-to-aurora-task" \ --query "ReplicationTasks[*].{Status:Status,CDCStartTime:ReplicationStats.FullLoadProgressPercent}"
  • Always validate with:

    aws dms describe-table-statistics --replication-task-arn <task-arn>
  • Combine with AWS SCT (Schema Conversion Tool) for object conversion before DMS handles data replication.


💡 Bonus use case: You can repurpose DMS for ongoing replication — e.g., feeding an analytics cluster or keeping a DR instance up to date.

Curious — how many of you have used DMS for continuous sync rather than one-time migrations?

#AWS #DMS #DBA #CloudMigration #PostgreSQL #Oracle #AWSCLI #DataEngineering #DevOps