To migrate MySQL 8 to Amazon Aurora we will be using AWS Data Migration Service (DMS). AWS is currently offering free use for 6 months per instance if you are migrating Amazon Aurora, Amazon Redshift, Amazon DynamoDB or Amazon DocumentDB. For more on this visit this link.
Data Migration Service Setup
Step 1 – Create Amazon Aurora instance on RDS
Step 2 – Create Replication Instance
- Log on to AWS console and go to AWS DMS.
- Click on Create replication instance button.
Replication instance configuration
- Name the replication instance.
- As an optional setting, you can provide a friendly name to override the default DMS Amazon Resource Name (ARN).
- Provide Description of the replication instance.
- Set Instance class depending on your requirement.
- Set AWS DMS Engine version or choose default.
- Allocated storage (GiB) based on your requirement.
- Select VPC to ensure that you can collect to Source and Destination.
- Choose Multi AZ option if required for High Availability and fault tolerant setup.
Advanced security and network configuration
- Select replication subnet group within the VPC selected.
- Select Availability zone of your choice.
- Select VPC security group and ensure that DMS, Source and Destination can connect.
- KMS master key is selected by default.
Maintenance window and tags
Select Maintenance window for DMS minor version upgrade. Set optional Tags if required.
Click Create button.
The replication instance will go from Status Creating to Available.
Step 3 – Create endpoint for Source
- Select Source endpoint.
- Select RDS DB instance checkbox and elect the RDS instance from the dropdown.
KMS master key
Test endpoint connection (optional)
If the test fails check the Message to troubleshoot.
In this case the replication instance private IP needs to be allowed on port 3306 in the security group.
Step 4 – Create endpoint for Destination
- Select Target endpoint
- Select RDS DB Instance
Follow Step 3 for the rest of the steps. In Endpoint configuration ensure that Target engine is set correctly to Amazon Aurora MySQL.
Endpoints created for Source and Target.
Step 5 – Create database migration
- Select Database migration tasks option
- Click Create task button
- Set Task identifier.
- Set optional Descriptive Amazon Resource Name (ARN).
- Select Replication instance.
- Select Source database endpoint.
- Select Target database endpoint.
- Select Migration type to Migrate existing data. Other options (i.e replicate changes) will require additional configuration on MySQL source database.
- Exclude the following MySQL schemas using Selection rules
- Include all other schemas
Premigration assessment, Migration task startup configuration, Tags
Leave it at default. Enable premigration assessment run for large workloads.
Database migration task list
Database migration task will not start if there are connectivity issues on the endpoints. Fix it and click Actions > Restart/Resume.
Ensure that Status is Running and monitor Progress of data migration.
Once data has been migrated Status will go to Load complete.
Check Table statistics to troubleshoot any migration issues. You can also enable CloudWatch logs.
Step 6 – Connect to Amazon Aurora from your application.