Asterrr's Handbook

Database migration

Moving databases to AWS with DMS full load and CDC, converting schemas for engine changes, using native tools, and keeping downtime short.

Exam tasks: 4.2 (select a database migration strategy and tools, plan for minimal downtime), 4.3

The decision: is the target the same engine or a different one, how big is the database, and how much downtime can the business accept at cutover?

Choosing an approach

MethodEngine changeDowntimeMoves secondary objectsBest for
DMS full load + CDCYesMinutesNo, only tables and dataHeterogeneous moves, near-zero downtime, many target types
DMS homogeneous data migrationsNoMinutesYes: indexes, views, procedures, triggersMySQL, PostgreSQL and MongoDB to their RDS, Aurora or DocumentDB equivalents
Native dump and restoreNoHours, grows with sizeYesSmall to medium DBs with a real outage window
Native backup to S3, then restoreNoHours, plus CDC to shrink itYesSQL Server .bak, Oracle Data Pump, MySQL XtraBackup to RDS or Aurora
Read replica promotionNoAbout a minuteYesRDS MySQL or PostgreSQL to Aurora, or cross-Region moves

AWS DMS

DMS reads from a source endpoint and writes to a target endpoint. It supports on-premises databases, EC2, RDS and Aurora, plus targets such as S3, Redshift, DynamoDB, OpenSearch, Kinesis and Kafka.

Migration types

  • Full load: copies existing rows. Changes made during the copy aren't captured.
  • Full load + CDC: copies existing rows while caching changes, applies the cached changes, then keeps replicating ongoing changes until you cut over. This is the default answer for minimal downtime.
  • CDC only: replicates changes from a chosen start point, after the bulk data was loaded some other way.

CDC depends on the source's change log, so the source must be configured for it: row-format binary logging on MySQL, logical replication on PostgreSQL, supplemental logging on Oracle, MS-CDC or MS-Replication on SQL Server.

Capacity: instances or Serverless

Replication instanceDMS Serverless
ProvisioningYou pick instance class, storage and Multi-AZYou set minimum and maximum DMS capacity units
ScalingManual resizeAutomatic within your limits
FitsSteady, predictable tasks, fine-grained tuningVariable loads, many migrations, no capacity planning

Use Multi-AZ replication instances for long-running CDC tasks, so an AZ failure doesn't stop replication.

Validation and assessment

  • Premigration assessments check for unsupported data types, missing primary keys, LOB settings and source configuration before you start.
  • Data validation compares source and target rows during and after the load, and reports mismatches per table.
  • Table mappings select tables and apply transformation rules such as renaming schemas or dropping columns.

DMS doesn't build your schema

Classic DMS tasks create only basic tables with primary keys. Secondary indexes, foreign keys, stored procedures, triggers and views don't come across. For an engine change, convert the schema first. For a same-engine move, use homogeneous data migrations or native tools.

Triggers and foreign keys during full load

Tables load in parallel, not in dependency order. Enabled foreign keys and triggers on the target cause failures or duplicated side effects. Disable them during the full load and turn them on at cutover.

Changing engines: schema conversion

DMS Schema ConversionAWS Schema Conversion Tool (SCT)
Where it runsManaged, in the DMS consoleDesktop application you install
DoesAssesses complexity, converts schemas and code objects, with generative AI help for harder objectsThe same, plus data extraction agents for data warehouses
Typical pathsOracle or SQL Server to Aurora or RDS for PostgreSQL or MySQLAlso Teradata, Netezza, Greenplum and others to Redshift

Both produce an assessment report showing what converts automatically and what needs manual work. That report is the input to your 7R decision: a database full of vendor-specific code may be better replatformed than converted.

Heterogeneous means two tools

An engine change is always two steps: schema conversion, with DMS Schema Conversion or SCT, then data movement with DMS. An answer offering only DMS for Oracle to PostgreSQL is missing the conversion step.

Native tools

  • pg_dump and pg_restore, mysqldump: simple, and they carry every object, but downtime grows with size.
  • Oracle Data Pump: export to a dump file, copy it to S3, and import into RDS for Oracle through S3 integration.
  • SQL Server native backup and restore: restore a .bak file from S3 into RDS for SQL Server.
  • Percona XtraBackup: restore a physical MySQL backup from S3 into Aurora MySQL.
  • Aurora read replica of an RDS instance: create an Aurora replica of RDS for MySQL or PostgreSQL, let it catch up, then promote it. Downtime is the promotion plus the endpoint change.

Large databases

When the database is too large to copy over the network in time:

Start CDC capture first, or note the log position, so no change made during the bulk copy is lost.

Move the bulk offline or natively. Use SCT data extraction agents to write to a Snowball Edge device, or take a native backup and send it over Direct Connect to S3.

Load the target from S3, using DMS or native restore.

Run a DMS CDC-only task from the recorded start point until lag is near zero, then cut over.

Full load + CDC
The default answer for migrating with minimal downtime.
Tables only
What classic DMS tasks create on the target. Everything else needs conversion or native tools.
Multi-AZ
Replication instance setting for long-running CDC that must survive an AZ failure.

Keeping downtime short

  • Replicate with CDC until the CDC latency metrics are near zero, then stop application writes.
  • Lower the DNS TTL well before cutover so clients move to the new endpoint quickly.
  • Run DMS validation and application smoke tests before reopening writes.
  • Keep a rollback path: a reverse DMS task from the new target back to the old source, until you trust it.

Scenarios

Scenario · choose 2
A company is moving a 6 TB Oracle database with many PL/SQL packages to Aurora PostgreSQL. The business accepts no more than 15 minutes of downtime. Which TWO steps should the architect include?
Scenario
A team runs Amazon RDS for PostgreSQL and wants to move to Aurora PostgreSQL with the least downtime and effort. What should it do?
Scenario
After a DMS full load from MySQL into Aurora MySQL, developers report that queries are very slow and that stored procedures are missing. What is the MOST likely cause?

Further reading

On this page