Database migrations can be performed in a number of ways, and for the purpose of this workshop we will perform a continuous data replication migration using AWS Database Migrations Service (DMS).
Before you configure AWS DMS, you will need to create your target database in the AWS account provided. Use AWS Relation Database Service (RDS) to perform this activity making it easy to set up, operate, and scale a relational database in the cloud.
Go to the AWS Console, from Services choose RDS, select Subnet groups from the menu on the left and click Create DB Subnet Group
On the Create DB subnet group enter the following information
|Description||Subnets where RDS will be deployed|
In the Add subnets panel add one subnet from each Availability Zone (us-west-2a and us-west-2b) with CIDRs 10.0.101.0/24 and 10.0.201.0/24, then press Create button.
Now select Databases from the menu on the left and click Create database
From the Engine options, select MySQL and Version MySQL 5.7.33
You can confirm the source MySQL version from the source database using SQL query - SELECT@@version;
In the Template section select “Free Tier”.
Chosing of “Free Tier” template limits your options in the next steps of the wizard, so that you stay within the limits of AWS Free Tier.
In the Settings section, configure the DB instance identifier (e.g. database-1), Master username (e.g. admin) and Master password for your new database instance.
Make sure to write down Master username and Master password, as you will use it later.
Select db.t2.micro from the Burstable DB instance class, General Purpose (SSD) for Storage Type and uncheck “Enable storage autoscaling” (we dont need more than 20 GB of storage for this database).
For the Availability & durability, keep the Do not create a standby instance option selected.
For production workloads, we recommend enabling the standby instance to enable Multi-AZ Deployment for higher availability.
In the Connectivity section:
Note: You will edit the DB-SG VPC security group later to make sure that the DMS Replication Instance is able to access the target database and to allow access from your Webserver.
For the Database authentication, choose Password authentication.
(AWS hosted events only) In the Additional configuration, make sure to uncheck Enable Enhanced monitoring under the Monitoring section as indicated below:
Using Enhanced monitoring is a very good idea for production workloads, during AWS hosted events we uncheck it because of limitations of IAM Role that was provisioned for attendees.
Finally, review the Estimated monthly costs and click the Create database button.