MariaDB 10.6 to MySQL Aurora 8.0 Migration Guide — 5-Part Series
- Part 1: Pre-Migration Requirements
- Part 2: AWS DMS Infrastructure Setup
- Part 3: Schema and User Migration
- Part 4: DMS Endpoints, Task Configuration, and Assessments
- Part 5: Execution, Validation, Cutover, and Cleanup (You Are Here)
With the schema imported, endpoints tested, and the migration task configured, the final phase covers starting the migration, monitoring its progress, validating data consistency, performing the cutover, and removing all temporary AWS resources created for the migration.
Final Checks Before Starting
Before starting the migration task, verify these items are in place:
| Item | Location | Required State |
|---|---|---|
| Schema imported to Aurora | Aurora target | All tables present, verified with mysqlcheck |
| Secondary indexes dropped on target | Aurora target | drop_indexes.sql executed, only PRIMARY KEYs remain |
| Foreign key checks disabled on target endpoint | DMS target endpoint | Initstmt=SET FOREIGN_KEY_CHECKS=0; in extra connection attributes |
| Pre-migration assessments passed | DMS console | No Error severity findings |
| CloudWatch logging enabled on task | DMS task settings | On |
| Data Validation disabled | DMS task settings | Disabled (will be enabled after full load) |
| Task startup configuration | DMS task settings | Manual start |
Start the Migration Task
Select the migration task in the DMS console and click Actions → Restart/Resume. The task enters the Full load phase immediately.
Monitor progress from the Table statistics tab of the task details. Key columns:
- Full load rows — rows loaded so far for each table
- Inserts / Updates / Deletes — CDC changes applied (will be 0 until full load completes)
- Validation state — will show
Not enableduntil you enable validation
Monitoring the Migration
CloudWatch Logs
Navigate to CloudWatch Logs → Log groups → find the log group for your DMS task (named /aws/dms/tasks/<task-id>). Monitor for:
[ERROR]entries — indicate failed row operations or connectivity issuesLOBwarnings — if DMS cannot retrieve a LOB value, it logs the table, row, and column- Latency metrics — available in the DMS CloudWatch metrics tab of the task
Replication Lag During CDC
Once the full load completes, DMS switches automatically to CDC mode and begins applying binlog events from the source. Monitor the CDCLatencySource and CDCLatencyTarget CloudWatch metrics on the replication instance. These values should trend toward zero as CDC catches up with the current position on the source.
A sustained increase in latency indicates the replication instance is under-sized for the write throughput of the source, or the target is a bottleneck (check Aurora CloudWatch metrics for CPU and write IOPS).
Enable Data Validation
Once the Full load percentage reaches 100% in the task overview, enable data validation. Do not enable it during the full load — validation runs queries against both source and target simultaneously, which adds load and slows the migration.
To enable validation:
- Stop the task temporarily (Actions → Stop)
- Edit the task settings → enable Data validation
- Restart the task
DMS data validation compares row counts and checksums between source and target tables. View results in the Table statistics tab under the Validation state column:
Validated— row counts and checksums matchValidation errors— discrepancies found, requires investigationValidation suspended— DMS skipped validation for a table (usually due to unsupported data types or missing primary keys)
Any Validation errors findings must be investigated before proceeding with cutover. The AWS DMS data validation documentation covers resolution steps for common discrepancy types.
Enable Batch Apply
Once data validation shows all tables as Validated, enable Batch Apply mode on the CDC replication. Batch Apply groups multiple row-level events per table and applies them as bulk INSERT, UPDATE, or DELETE sets per transaction rather than one row at a time. This reduces commit frequency by up to 90% and significantly lowers write latency on the Aurora target.
To enable Batch Apply:
- Edit the migration task
- Under Advanced task settings, find CDC batch apply mode and enable it
Batch Apply and LOBs: Batch Apply cannot be used together with Full LOB mode. If your migration uses Full LOB mode, skip Batch Apply and instead monitor CDC lag directly — Aurora's distributed storage handles the write load well for most workloads.
Cutover Procedure
Cutover is the moment you stop writing to MariaDB and redirect application traffic to Aurora MySQL. The goal is to minimize the window between stopping writes on the source and resuming writes on the target.
Step-by-Step Cutover
-
Choose a low-traffic window. Identify a period where application write rates are at their daily minimum. This reduces the time needed for CDC lag to reach zero.
-
Stop the application from writing to MariaDB. This is application-specific — options include:
- Putting the application into maintenance mode
- Redirecting traffic to a holding page
- Disabling background jobs and cron tasks that write to the database
-
Wait for CDC lag to reach zero. Watch the CDCLatencySource metric in CloudWatch. It should drop to 0 seconds, indicating DMS has consumed all pending binlog events. Allow at least 2–3 minutes at zero lag before proceeding to confirm stability.
-
Run final validation queries. On both MariaDB and Aurora, compare row counts for critical tables:
-- Run on both databases and compare SELECT table_name, table_rows FROM information_schema.TABLES WHERE table_schema = '<schema_name>' ORDER BY table_name;Note that
table_rowsininformation_schemais an estimate. For exact counts on critical tables, runSELECT COUNT(*)directly. -
Create secondary indexes on Aurora. Now that the full load is complete and CDC has caught up, rebuild the secondary indexes that were dropped before the migration:
mysql -h <aurora-endpoint> -u admin -p -P 3306 <schema_name> < create_indexes.sqlMonitor index creation progress in Aurora — on large tables this can take significant time. You can monitor progress in a separate session:
SHOW PROCESSLIST; -
Redirect the application to Aurora MySQL. Update the application's database connection string to point to the Aurora cluster endpoint. Aurora's cluster endpoint automatically routes to the current writer instance and handles failovers transparently.
-
Verify the application. Run smoke tests on the critical application paths. Check application logs for database errors.
-
Disable or stop the DMS migration task. Once the application is verified on Aurora, the DMS task is no longer needed.
Post-Migration Validation
After the cutover, run a thorough validation of the Aurora target:
- Compare table counts between MariaDB and Aurora for all tables in the migrated schema
- Test all stored procedures and functions that are critical to application functionality
- Verify scheduled events and triggers fire as expected
- Check application error rates in your APM tool for the first 30–60 minutes after cutover
If critical issues are discovered post-cutover, the rollback path is to redirect the application connection string back to the original MariaDB instance. The MariaDB source remains untouched throughout this process — DMS reads from it but never writes to it.
Cleanup
After successful cutover and a validation period (typically 24–48 hours), clean up all resources created for the migration.
Remove DMS Resources
Remove DMS resources in this order (dependencies must be removed first):
- Stop and delete migration tasks — select each task, Actions → Stop, then Actions → Delete
- Delete both endpoints — source (MariaDB) and target (Aurora) endpoints
- Delete the replication instance — go to Replication instances and delete
Delete DMS Certificate
Go to DMS → Certificates and delete the imported CA certificate.
Revoke DMS User Privileges
Remove the dms_user accounts from both databases once the migration task is deleted:
-- On MariaDB source
DROP USER 'dms_user'@'<replication_instance_ip>';
FLUSH PRIVILEGES;
-- On Aurora MySQL target
DROP USER 'dms_user'@'<replication_instance_ip>';
FLUSH PRIVILEGES;
Remove Temporary Security Group Rules
Remove any inbound rules added to the MariaDB and Aurora security groups specifically for the DMS replication instance. If you reused an existing security group for the replication instance, ensure the rules for port 3306 still make sense for the remaining resources that use that security group.
Delete IAM Roles and Policies
Delete the IAM resources created for DMS:
- Role:
dms-vpc-role - Role:
dms-cloudwatch-logs-role - Role:
DMSS3AccessRole-*(the S3 access role created during premigration assessments) - Policy:
DMSS3BucketPolicy-DMSS3AccessRole-*
Delete the S3 Bucket
If the S3 bucket created for migration logs is no longer needed, delete it:
- Empty the bucket first (required by S3 before deletion)
- Delete the bucket from the S3 console
Complete Migration Checklist
| # | Task | Part | Status |
|---|---|---|---|
| 1 | MariaDB timeout settings ≥ 300s | Part 1 | |
| 2 | MariaDB binlog_format=ROW | Part 1 | |
| 3 | MariaDB binlog_row_image=FULL | Part 1 | |
| 4 | MariaDB binary logging enabled | Part 1 | |
| 5 | MariaDB binlog retention ≥ 26 hours | Part 1 | |
| 6 | Aurora binlog_format=ROW | Part 1 | |
| 7 | Timezone identical on source and target | Part 1 | |
| 8 | Aurora local_infile=1 | Part 1 | |
| 9 | IAM role dms-vpc-role created | Part 2 | |
| 10 | IAM role dms-cloudwatch-logs-role created | Part 2 | |
| 11 | DMS replication instance created | Part 2 | |
| 12 | Security groups configured for DMS access | Part 2 | |
| 13 | Schema exported with compatibility pipeline | Part 3 | |
| 14 | Schema reviewed for incompatible objects | Part 3 | |
| 15 | Schema imported to Aurora, mysqlcheck clean | Part 3 | |
| 16 | Secondary indexes dropped on Aurora target | Part 3 | |
| 17 | DB users migrated to Aurora | Part 3 | |
| 18 | DMS user created on MariaDB source | Part 4 | |
| 19 | DMS user created on Aurora target | Part 4 | |
| 20 | Source endpoint created and tested | Part 4 | |
| 21 | Target endpoint created and tested (FK checks disabled) | Part 4 | |
| 22 | Migration task created (Full Load + CDC) | Part 4 | |
| 23 | Pre-migration assessments run, errors resolved | Part 4 | |
| 24 | Migration task started | Part 5 | |
| 25 | Full load reached 100% | Part 5 | |
| 26 | Data validation enabled and all tables Validated | Part 5 | |
| 27 | CDC lag at zero before cutover | Part 5 | |
| 28 | Application writes stopped on MariaDB | Part 5 | |
| 29 | Secondary indexes recreated on Aurora | Part 5 | |
| 30 | Application redirected to Aurora | Part 5 | |
| 31 | Post-migration validation passed | Part 5 | |
| 32 | DMS tasks, endpoints, and replication instance deleted | Part 5 | |
| 33 | DMS user revoked from both databases | Part 5 | |
| 34 | Temporary security group rules removed | Part 5 | |
| 35 | IAM roles and policies deleted | Part 5 | |
| 36 | S3 migration bucket deleted | Part 5 |