Create Target DB

Database Migration

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.

Create the subnet group for target database

  1. Go to the AWS Console, from Services choose RDS, select Subnet groups from the menu on the left and click Create DB Subnet Group

  2. On the Create DB subnet group enter the following information

    Parameter Value
    Name database-subnet-group
    Description Subnets where RDS will be deployed
    VPC TargetVPC

    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.

    RDS Subnet group creation

Create the target database

  1. Now select Databases from the menu on the left and click Create database

  2. From the Engine options, select MySQL and Version MySQL 5.7.33

    1

    You can confirm the source MySQL version from the source database using SQL query - SELECT@@version;

    In the Template section select “Free Tier”.

    Free tier template selection

    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.

    3_db

    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). 4_db

  3. For the Availability & durability, keep the Do not create a standby instance option selected.

    5_db

    For production workloads, we recommend enabling the standby instance to enable Multi-AZ Deployment for higher availability.

  4. In the Connectivity section:

    • In Virtual Private Cloud (VPC), select TargetVPC (this is the Amazon Virtual Private Cloud that was automatically created for this lab)
    • In Additional connectivity configuration -> VPC Security Group, select Create new VPC security group and give it a name (e.g. “DB-SG”).
    • Note that the DB Subnet group you have created earlier will be automatically selected

    6_db

    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.

  5. For the Database authentication, choose Password authentication.

  6. (AWS hosted events only) In the Additional configuration, make sure to uncheck Enable Enhanced monitoring under the Monitoring section as indicated below:

    6_2_db

    8_db

    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.

  7. Finally, review the Estimated monthly costs and click the Create database button.

    8_2_db