Database Migration Service (DMS) and Schema Conversion Tool
Migrate homogeneous and heterogeneous databases with DMS using full-load or CDC, and convert schema dialects with the Schema Conversion Tool.
Database Migration Service (DMS) and Schema Conversion Tool is a free AWS Solutions Architect lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Solutions Architect learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What Is AWS DMS?
AWS Database Migration Service (DMS) migrates databases to AWS with minimal downtime. It supports homogeneous migrations (e.g., Oracle to Oracle, MySQL to MySQL) and heterogeneous migrations (e.g., Oracle to Aurora PostgreSQL, SQL Server to MySQL). DMS uses a replication instance that reads from the source, optionally transforms data, and writes to the target. You pay only for the replication instance runtime.
DMS Components: Endpoints, Replication Instance
DMS has three key components. Source Endpoints define the source database connection (JDBC URL, credentials, TLS). Target Endpoints define the destination database. The Replication Instance is an EC2-based managed server that DMS provisions in your VPC to run the migration workload. Choose the replication instance size based on how much data needs to be migrated and whether you want multi-AZ for the replication instance itself.
# Create a DMS replication instance
aws dms create-replication-instance \
--replication-instance-identifier my-dms-instance \
--replication-instance-class dms.t3.medium \
--allocated-storage 50 \
--vpc-security-group-ids sg-abc123 \
--replication-subnet-group-identifier my-dms-subnet-group \
--multi-az false \
--publicly-accessible falseFull Load vs CDC Migration
DMS supports two migration modes. Full Load copies all existing data from source to target — suitable when you can afford downtime or the source is read-only during migration. Change Data Capture (CDC) captures ongoing changes from the source transaction log after the full load completes, keeping source and target in sync. A combined Full Load + CDC migration minimises downtime: migrate data while the source stays live, then cut over when the target is caught up.
# Create a DMS replication task with Full Load + CDC
aws dms create-replication-task \
--replication-task-identifier sales-migration \
--source-endpoint-arn arn:aws:dms:us-east-1:123:endpoint:SOURCE \
--target-endpoint-arn arn:aws:dms:us-east-1:123:endpoint:TARGET \
--replication-instance-arn arn:aws:dms:us-east-1:123:rep:my-dms-instance \
--migration-type full-load-and-cdc \
--table-mappings '{"rules": [{"rule-type": "selection", "rule-id": "1", "rule-name": "all", "object-locator": {"schema-name": "%", "table-name": "%"}, "rule-action": "include"}]}'Schema Conversion Tool (SCT)
The AWS Schema Conversion Tool (SCT) is a free downloadable application that automatically converts the source database schema (DDL) to a format compatible with the target database engine. It handles table definitions, views, stored procedures, functions, and triggers. For heterogeneous migrations (e.g., Oracle to PostgreSQL), SCT converts the majority of objects automatically and flags items that require manual review due to unsupported syntax differences.
# SCT is a GUI desktop tool, but here is the workflow:
# 1. Connect SCT to source Oracle database
# 2. Connect SCT to target Aurora PostgreSQL database
# 3. Run schema assessment: SCT rates conversion complexity per object
# 4. Convert schema automatically (SCT generates PostgreSQL DDL)
# 5. Apply converted DDL to target (SCT executes or exports SQL script)
# 6. Review and manually fix flagged items (e.g., PL/SQL procedures with Oracle-specific syntax)Homogeneous vs Heterogeneous Migration
For homogeneous migrations (same engine, e.g., MySQL on-premises to RDS for MySQL), SCT is usually not needed — the schema is directly compatible. DMS can run Full Load + CDC immediately. For heterogeneous migrations (different engines), SCT must convert the schema first, DMS handles the data migration, and you may need to manually rewrite stored procedures and triggers that have no equivalent in the target engine.
# Example heterogeneous migration workflow:
# On-premises Oracle -> Amazon Aurora PostgreSQL
#
# Step 1: SCT converts Oracle DDL to PostgreSQL DDL
# Step 2: Apply PostgreSQL DDL to Aurora target
# Step 3: DMS Full Load + CDC copies Oracle table data to Aurora
# Step 4: Validate row counts and checksums
# Step 5: Cut over application connections to Aurora endpoint
# Step 6: Terminate DMS task and replication instanceSupported Source and Target Databases
DMS supports a wide range of sources: Oracle, SQL Server, MySQL, MariaDB, PostgreSQL, SAP ASE, MongoDB, IBM Db2, and S3. Supported targets include all of the above plus Amazon Redshift, DynamoDB, Kinesis Data Streams, and Kafka. This makes DMS useful not just for relational migrations but also for streaming relational change events into a data lake or event-driven architecture using CDC to Kinesis.
DMS Table Mapping Rules
DMS uses table mapping rules (JSON) to control which schemas and tables to include or exclude, and to apply data transformations. You can rename schemas or tables, convert column values (e.g., uppercase all strings), add derived columns, or filter rows. This is useful when migrating to a target with different naming conventions or when you want to migrate only a subset of tables.
# Table mapping: include only the 'orders' table, rename schema
{
'rules': [
{
'rule-type': 'selection',
'rule-id': '1',
'rule-name': 'select-orders',
'object-locator': {'schema-name': 'prod_db', 'table-name': 'orders'},
'rule-action': 'include'
},
{
'rule-type': 'transformation',
'rule-id': '2',
'rule-name': 'rename-schema',
'rule-action': 'convert-uppercase',
'rule-target': 'schema',
'object-locator': {'schema-name': 'prod_db'}
}
]
}Monitoring DMS Migration Progress
DMS publishes metrics to CloudWatch: FullLoadThroughputRowsSource (rows per second loaded), CDCLatencySource (lag between source transaction log and DMS reading it), and CDCLatencyTarget (lag between DMS reading and writing to target). Monitor CDCLatencyTarget closely during the sync phase — when it drops to near zero, the target has caught up to the source and you are ready for cutover.
# Monitor CDC latency via CloudWatch CLI
aws cloudwatch get-metric-statistics \
--namespace AWS/DMS \
--metric-name CDCLatencyTarget \
--dimensions Name=ReplicationInstanceIdentifier,Value=my-dms-instance \
--start-time 2024-01-01T00:00:00Z \
--end-time 2024-01-01T01:00:00Z \
--period 60 \
--statistics AverageDMS Serverless
DMS Serverless automatically provisions and scales the replication capacity based on the migration workload, eliminating the need to choose and manage a replication instance size. You specify minimum and maximum DMS capacity units (DCUs) and DMS auto-scales within that range. This is ideal for migrations with variable load or when you want to avoid the risk of under-sizing the replication instance during peak migration load.
# Create a DMS Serverless replication
aws dms create-replication \
--replication-config-identifier my-serverless-migration \
--replication-type full-load-and-cdc \
--source-endpoint-arn arn:aws:dms:us-east-1:123:endpoint:SOURCE \
--target-endpoint-arn arn:aws:dms:us-east-1:123:endpoint:TARGET \
--compute-config '{
"MinCapacityUnits": 2,
"MaxCapacityUnits": 64,
"MultiAZ": false,
"ReplicationSubnetGroupId": "my-subnet-group",
"VpcSecurityGroupIds": ["sg-abc123"]
}'Validating Migration Completeness
After migration, validate data completeness using DMS Data Validation. Enable it in the task settings and DMS compares row counts and checksums between source and target tables, reporting mismatches to a separate validation table. For heterogeneous migrations, also run application-level smoke tests. Never cut over until validation shows zero discrepancies — reconciling data after a flawed cutover is far more costly than taking extra time to validate.
# Enable validation in DMS task settings (JSON)
{
'TargetMetadata': {'SupportLobs': true, 'FullLobMode': false},
'ValidationSettings': {
'EnableValidation': true,
'ValidationMode': 'ROW_LEVEL',
'ValidationOnly': false,
'FailureMaxCount': 10000
}
}Common DMS Exam Scenarios
For the SAA-C03 exam, DMS appears in scenarios requiring database migration with minimal downtime. Key signals: 'migrate database with ongoing replication' → DMS Full Load + CDC. 'heterogeneous engine change' → SCT first, then DMS. 'replicate changes in near real time to a data lake' → DMS CDC to Kinesis or S3. 'consolidate multiple source databases into one target' → multiple DMS tasks to one target endpoint. DMS is specifically for database migration — for server migration use MGN, for bulk data transfer use DataSync or Snowball.
Quick Check
Test your understanding of AWS Solutions Architect (SAA-C03) concepts from this lesson.
Lesson Recap
In this lesson you learned: DMS supports both homogeneous and heterogeneous database migrations using Full Load and CDC modes, SCT automates schema conversion for engine-change migrations and flags manual review items, and DMS Serverless auto-scales replication capacity eliminating instance sizing decisions. Next up we explore Amazon EventBridge for event-driven routing and bus architecture.
Frequently asked questions
Is the “Database Migration Service (DMS) and Schema Conversion Tool” lesson free?
Yes — the full text of “Database Migration Service (DMS) and Schema Conversion Tool” is free to read here on the web, and the AWS Solutions Architect course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Solutions Architect course, upgrade to CoddyKit PRO.
What will I learn in “Database Migration Service (DMS) and Schema Conversion Tool”?
Migrate homogeneous and heterogeneous databases with DMS using full-load or CDC, and convert schema dialects with the Schema Conversion Tool. You practise AWS Solutions Architect with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AWS Solutions Architect?
No prior experience is required. AWS Solutions Architect on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Database Migration Service (DMS) and Schema Conversion Tool” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AWS Solutions Architect lesson?
Yes. Every AWS Solutions Architect lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- The 7 Rs of Migration Strategy
- AWS Migration Hub and Application Discovery Service
- Application Migration Service (MGN)
- Database Migration Service (DMS) and Schema Conversion Tool