Now let’s try something really fun. Let’s say you’ve already got an application using Amazon Aurora or RDS for MySQL and you want to migrate the database to MySQL HeatWave on AWS.
First, we’ll need to have a MySQL DB System with HeatWave enabled. You will need to ensure the system was created with enough storage to support your dataset with room for growth, and then confirm the database port configured during creation. The default is 3306 but we should double-check just to be certain:
You can leave this browser tab open since we need to come back later and make an adjustment to the Allowed client addresses
Great! Now let’s head over to AWS.
- Log in to your AWS console and use search for “DMS” — Database Migration Service, it’ll be the top result.
- Click Create replication instance.
- Fill out a Name, an optional Descriptive Amazon Resource Name (ARN), and description. You may use whichever shape you like, but keep in mind the performance: cost ratio here. For engine version, the latest should be fine, as well as the default Allocated storage (unless you have a truly massive database, in which case, adjust accordingly).
- For VPC, choose one you have previously set up with the appropriate access controls for development work. Make sure it is publicly accessible. For the Multi AZ option, simply select Dev or test workload to use a single availability zone.
- Click to open the Advanced security and network configurations. The subnet group will follow the VPC you chose above, and the availability zone should correspond to the region you’re using. The security groups should be populated with any you created earlier, ensuring appropriate ports are configured for ingress / egress access. Also make sure the Publicly accessible checkbox is selected.
- It will take a few minutes for the replication instance to spin up. Coffee time!
- Once it’s ready, we’ll need to get the Public IP address for our replication instance. You should see it in the table on the Replication Instances console.
- Now it is time to establish a connection to both source and destination DB endpoints. Go to the Endpoints section. On the right you’ll see a Create Endpoint button, click it.
- Select Source endpoint, and check Select RDS DB Instance. You should see the RDS Instance field populate with what’s
- For Endpoint configuration, you’ll have the identifier, ARN, and source engine pre-filled, but we want to provide the access to endpoint database information manually, so click that radio button. Then, enter the appropriate database information for the db you’re moving over.
- You should now be able to test the endpoint connection below.
- Next, we’ll create a second endpoint as our destination. To do this, we need to execute two actions in the MySQL HeatWave console. Return to the MySQL HeatWave on AWS Console, and click MySQL tab.
Then, click on the DB System you wish to use and Edit DB System. Add the public IP address from the DMS Replication Instance to the Allowed Client Addresses, making sure to append /32 at the end. Click Save. Next, locate the Host Name value in the instance Summary section. Copy the string.
- Go back to the AWS DMS console and click to create another endpoint. This time we’ll create a Target endpoint (naturally).
- In Endpoint configuration, give it a name (identifier), choose MySQL under Target Engine. ARN is optional.
- Once again, we’ll provide access information manually. The server name is the host name you previously copied. Port is 3306 (unless you chose another port). The username/password will match the one you created for the target database.
- Now we’ll create a migration task.
- On the nav, choose Tasks
- Create Task: Here’s where those endpoints come in handy!
- For now we’ll use default table mappings
After selecting the default table mappings, you should be able to save and run the task.
Note: MySQL Shell is the recommended utility for exporting data from a source MySQL Server and importing it into a DB System/MySQL HeatWave on AWS. MySQL Shell dump and load utilities are purpose-built for use with MySQL DB Systems. For more on running queries with HeatWave, please refer to the MySQL documentation.