DMS and schema conversion
AWS Database Migration Service for homogeneous and heterogeneous migrations, sources and targets, schema conversion with SCT or DMS Schema Conversion, continuous replication, Multi-AZ, and migrating RDS and external databases to Aurora.
AWS DMS
AWS Database Migration Service (DMS) migrates databases to AWS quickly and securely; it's resilient and self-healing.
- The source database remains available during the migration.
- Supports:
- homogeneous migrations: for example Oracle to Oracle;
- heterogeneous migrations: for example Microsoft SQL Server to Aurora.
- Continuous data replication using CDC (change data capture).
- A replication instance is created (an EC2 instance managed by DMS) to perform the replication tasks.
Updated since the slides
DMS Serverless now provisions and scales the replication capacity automatically, so no replication instance needs sizing. DMS Schema Conversion converts schemas in the console as a managed alternative to downloading SCT, and DMS Fleet Advisor inventories the source databases.
Sources and targets
Sources:
- on-premises and EC2 databases: Oracle, MS SQL Server, MySQL, MariaDB, PostgreSQL, MongoDB, SAP, Db2;
- Azure SQL Database (and other clouds' databases);
- Amazon RDS, including Aurora;
- Amazon S3;
- DocumentDB.
Targets:
- on-premises and EC2 databases: Oracle, MS SQL Server, MySQL, MariaDB, PostgreSQL, SAP;
- Amazon RDS (and Aurora);
- Redshift, DynamoDB, S3;
- OpenSearch Service;
- Kinesis Data Streams;
- Apache Kafka;
- DocumentDB and Amazon Neptune;
- Redis and Babelfish.
Schema conversion (SCT)
- The AWS Schema Conversion Tool (SCT) converts a database's schema from one engine to another.
- Example OLTP: SQL Server or Oracle → MySQL, PostgreSQL, Aurora.
- Example OLAP: Teradata or Oracle → Amazon Redshift.
- Prefer compute-intensive instances to optimize data conversions.
- SCT is not needed when migrating to the same DB engine:
- for example, on-premises PostgreSQL → RDS PostgreSQL;
- the DB engine is still PostgreSQL (RDS is just the platform).
Continuous replication
- A server with AWS SCT converts the Oracle schema and creates it in the target (Aurora MySQL or RDS for MySQL).
- The DMS replication instance does a full load of the data, then CDC keeps replicating ongoing changes.
- When the target is in sync, switch the application over: minimal downtime.
DMS Multi-AZ deployment
- When Multi-AZ is enabled, DMS provisions and maintains a synchronous standby replica in a different AZ.
- Advantages: data redundancy, eliminates I/O freezes, minimizes latency spikes.
RDS and Aurora migrations
RDS MySQL → Aurora MySQL:
- Option 1: DB snapshot from RDS MySQL restored as a MySQL Aurora DB.
- Option 2: create an Aurora read replica from the RDS MySQL instance, and when the replication lag is 0, promote it as its own DB cluster (can take time and cost $).
External MySQL → Aurora MySQL:
- Option 1: use Percona XtraBackup to create a file backup in Amazon S3, then create an Aurora MySQL DB from Amazon S3.
- Option 2: create an Aurora MySQL DB, then use the mysqldump utility to migrate MySQL into Aurora (slower than the S3 method).
RDS PostgreSQL → Aurora PostgreSQL: the same two options (snapshot, or Aurora read replica then promote).
External PostgreSQL → Aurora PostgreSQL: create a backup and put it in Amazon S3, then import it using the aws_s3 Aurora extension.
Use DMS if both databases are up and running (ongoing replication with minimal downtime).
Real-world examples
- A company moves a 3 TB Oracle database to Aurora PostgreSQL: SCT converts the schema and flags stored procedures to rewrite by hand, then DMS does a full load and CDC for two weeks until cut-over on a Sunday night.
Exam tips
- "Migrate a database with minimal downtime, source stays live" → DMS (full load + CDC).
- "Different engines (Oracle → Aurora, SQL Server → MySQL)" → schema conversion (SCT or DMS Schema Conversion) + DMS.
- "Same engine (PostgreSQL → RDS PostgreSQL)" → DMS (or native tools) without SCT.
- "Teradata or Oracle data warehouse to Redshift" → SCT + DMS.
- "RDS MySQL to Aurora" → snapshot restore, or Aurora read replica then promote.
- "Stream database changes to Kinesis" → DMS with Kinesis Data Streams as the target.
Common traps
- "SCT is needed for every migration." Only when the engine changes.
- "DMS takes the source offline." It stays available during the migration.
Check yourself
A DMS replication instance and two databases cost money per hour, so instead:
Convert the schema with AWS SCT (or DMS Schema Conversion), then run a DMS task with full load and ongoing replication (CDC); cut over when the target has caught up.
AWS documentation
Transferring large amounts of data
Working out how long a large data transfer takes over the internet, Direct Connect or Snowball, and which options suit one-off and ongoing transfers.
Application Discovery Service and MGN
AWS Application Discovery Service for planning migrations with agentless and agent-based discovery, AWS Migration Hub, and AWS Application Migration Service (MGN) for lift-and-shift server migrations.