Database Migration on AWS: DMS, Schema Conversion Tool, Homogeneous and Heterogeneous Migrations and Zero-Downtime Cutover
What DMS Does
AWS Database Migration Service (DMS) copies data from a source database to a target and can keep them in sync using change data capture (CDC), so the source stays online during the migration. DMS moves data; for different engines, schema and code conversion is a separate step.
text
Source DB ─► DMS replication instance (or DMS Serverless) ─► Target DB
(on premises, EC2, RDS) full load + ongoing changes (CDC) (RDS, Aurora, Redshift, S3, DynamoDB ...)
Components
| Part | Meaning |
| Replication instance (or DMS Serverless) | The managed compute that runs migration tasks. Size by memory and CPU. For serverless DMS capacity scales automatically |
| Source and target endpoints | Connection details and credentials for each database |
| Task | Defines what to migrate: table mappings, selection rules, transformation rules, and the type: full load, CDC only, or full load + CDC |
| Validation | Compares source and target data to prove correctness |
| Premigration assessments | Check for problems before you start |
Migration Types
| Type | Source → Target | Tools |
| Homogeneous | Same engine: MySQL → RDS/Aurora MySQL, PostgreSQL → Aurora PostgreSQL, Oracle → RDS Oracle | Native tools (dump/restore, replication, RDS snapshot import, Aurora read replica from RDS) are often simplest. DMS homogeneous data migrations can use native tools for you |
| Heterogeneous | Different engine: Oracle → Aurora PostgreSQL, SQL Server → Aurora MySQL, SQL Server → PostgreSQL | Schema conversion (SCT or DMS Schema Conversion) + DMS for data |
Schema Conversion
- AWS Schema Conversion Tool (SCT): desktop application. Reads the source schema and code (tables, views, procedures, functions, triggers), converts to the target engine and produces an assessment report showing what converted automatically and what needs manual work
- DMS Schema Conversion: the same idea inside the DMS console (no installation)
- Generative AI assistance in newer tools can help convert complex code. Always review and test
- Typical automation levels vary: simple schemas convert almost fully, PL/SQL and T-SQL logic needs manual effort. The assessment report estimates this
Supported Targets
| Target | Use |
| RDS and Aurora engines, RDS Custom, EC2-hosted databases | Operational databases |
| Amazon Redshift | Data warehouse loading |
| Amazon S3 | Data lake (Parquet or CSV) with ongoing changes |
| DynamoDB, DocumentDB, Neptune, OpenSearch | NoSQL targets |
| Kinesis Data Streams, Kafka/MSK | Stream changes to consumers |
Typical Steps for a Heterogeneous Migration
- Assess with SCT or DMS Schema Conversion: report and effort estimate
- Convert and apply the schema on the target. Fix manual items; create indexes and constraints after the full load to speed it up
- Create endpoints and a task (full load + CDC). Use a replication instance in the target Region/VPC, with enough memory
- Run premigration assessment, then start the task. Full load copies existing data while CDC records changes
- When the full load ends, CDC applies the cached and new changes, and latency drops close to zero
- Run validation and application tests against the target. Compare row counts and checksums
- Cutover: stop writes on the source, wait for CDC latency to reach 0, validate, point the application to the target, keep the source for rollback
- Afterwards: stop the task, tune the target, drop old objects
bash
aws dms create-replication-instance --replication-instance-identifier dms-1 --replication-instance-class dms.r6i.large --allocated-storage 100 \
--vpc-security-group-ids sg-dms --replication-subnet-group-identifier dms-subnets --no-publicly-accessible --multi-az
aws dms create-endpoint --endpoint-identifier src-oracle --endpoint-type source --engine-name oracle --server-name ora.corp.local --port 1521 --database-name ORCL --username dms --password $PW
aws dms create-endpoint --endpoint-identifier tgt-aurora --endpoint-type target --engine-name aurora-postgresql --server-name shop-aurora.cluster-xxxx.ap-south-1.rds.amazonaws.com --port 5432 --database-name shop --username dms --password $PW2
aws dms create-replication-task --replication-task-identifier oracle-to-aurora --migration-type full-load-and-cdc \
--source-endpoint-arn $SRC --target-endpoint-arn $TGT --replication-instance-arn $RI \
--table-mappings file://mappings.json --replication-task-settings file://settings.json
aws dms start-replication-task --replication-task-arn $TASK --start-replication-task-type start-replicatio
json
{
"rules": [
{"rule-type": "selection", "rule-id": "1", "rule-name": "include-shop", "object-locator": {"schema-name": "SHOP", "table-name": "%"}, "rule-action": "include"},
{"rule-type": "transformation", "rule-id": "2", "rule-name": "lowercase-schema", "rule-target": "schema", "object-locator": {"schema-name": "SHOP"}, "rule-action": "convert-lowercase"},
{"rule-type": "transformation", "rule-id": "3", "rule-name": "lowercase-tables", "rule-target": "table", "object-locator": {"schema-name": "SHOP", "table-name": "%"}, "rule-action": "convert-lowercase"}
]
}
Source Preparation Notes
| Source | For CDC you usually need |
| Oracle | Supplemental logging enabled and ARCHIVELOG mode; Oracle LogMiner or Binary Reader |
| MySQL / MariaDB | Binary logging enabled with binlog_format=ROW and retention long enough |
| PostgreSQL | wal_level=logical, replication slots (pglogical or test_decoding) |
| SQL Server | Full recovery model, CDC or replication (MS-CDC) enabled |
| MongoDB | Change streams or oplog access |
Native Alternatives for Homogeneous Moves
| Source → Target | Option |
| MySQL/MariaDB → RDS or Aurora MySQL | mysqldump, Percona XtraBackup to S3 → Aurora, binlog replication, DMS |
| PostgreSQL → RDS/Aurora PostgreSQL | pg_dump/pg_restore, logical replication, DMS |
| RDS MySQL/PostgreSQL → Aurora | Create an Aurora read replica of the RDS instance, then promote it, or restore a snapshot into Aurora |
| Oracle → RDS Oracle | Oracle Data Pump with S3 integration, Oracle GoldenGate, DMS |
| SQL Server → RDS SQL Server | Native backup and restore through S3, DMS |
Choosing a Method
| Situation | Choice |
| Same engine, can accept a maintenance window | Native dump/restore or snapshot |
| Same engine, minimal downtime | Native replication or DMS (full load + CDC) |
| Different engines | SCT or DMS Schema Conversion + DMS |
| Very large database, slow network | Snowball Edge for the initial copy, then DMS CDC |
| Load data into Redshift or the S3 lake continuously | DMS (target S3 or Redshift) |
| Continuous analytics from Aurora/RDS to Redshift without ETL | Zero-ETL integration |
Performance and Reliability Tips
- Use Multi-AZ replication instances for important tasks
- Put the replication instance close to the target and size memory for large transactions (LOB handling can slow tasks: use limited LOB mode if possible)
- Run parallel tasks or parallel load for large tables, split by ranges
- Disable foreign keys, triggers and secondary indexes on the target during full load, enable after
- Monitor CDC source and target latency in CloudWatch, set alarms
- Make sure transaction logs and binlogs are retained long enough
- Test the rollback plan
Common Pitfalls
| Pitfall | Result |
| Skipping schema assessment | Big surprises with stored procedures later |
| Not enabling supplemental logging / binlog / logical replication | CDC fails or misses changes |
| Identity/sequence values not synced | Duplicate keys after cutover. Reset sequences |
| Time zone, character set or case differences | Data mismatch or broken queries |
| No validation | Silent data differences |
| Cutover without lowering DNS TTL or testing | Longer downtime |
Practice Tasks
- Create a DMS replication instance, a MySQL source endpoint (RDS) and an Aurora target and run a full load + CDC task
- Insert rows on the source during CDC and confirm they reach the target
- Enable validation and find a deliberately changed row
- List the manual conversion work you expect for a PL/SQL package migrating to PostgreSQL
- Write the cutover steps for a database that must be offline for less than 5 minutes
Conclusion
DMS migrates data with full load and continuous change capture while the source stays online. For different engines convert the schema first with SCT or DMS Schema Conversion, use native tools for simple same-engine moves, validate carefully, and cut over by stopping writes, letting latency reach zero, and switching the application.
Quick Summary: DMS parts; homogeneous vs heterogeneous; SCT + assessment; steps; CLI + mappings; CDC prerequisites; native alternatives; method choice; tips; pitfalls.