
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create a new connection profile for the Amazon RDS instance for MySQL
/ 10
Create one time migration job
/ 10
Configure the IP allowlist on source instance
/ 10
Test, run and review status of a one-time migration job
/ 20
Confirm the data in Cloud SQL for MySQL
/ 10
Database Migration Service provides options for one-time and continuous jobs to migrate data to Cloud SQL using different connectivity options, including IP allowlists, VPC peering, and reverse SSH tunnels. Learn more about connectivity options from the configure connectivity guide).
In this lab, you migrate a MySQL database from an Amazon RDS instance for MySQL to Cloud SQL for MySQL using a one-time Database Migration Service job and an IP allowlist for connectivity. After you create and run the migration job, you will check that the database has been successfully migrated to your Cloud SQL for MySQL instance.
In this lab, you learn how to configure a one-time Database Migration Service job to migrate databases from a cloud-based MySQL instance to Cloud SQL for MySQL.
When you start the lab, it can take up to 10 minutes to fully provision the Google Cloud and Amazon RDS resources.
The Amazon RDS resources are fully provisioned when a value is generated for AWS RDS Database - Source (such as mysql://qmflvsilronjc8.cyla72gcy8zl.us-east-1.rds.amazonaws.com:3306/SourceMySQLDatabase
) within the AWS access information on this page.
When you see values for the Google Console Username and Password, you may proceed to the Setup tasks.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.
This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud
is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Output:
gcloud
, in Google Cloud, refer to the gcloud CLI overview guide.
In the Google Cloud Console, enter Database Migration API in the top search bar.
Click on the result for Database Migration API. This page will either show status information or give you the option to enable the API.
If necessary, enable the API.
Amazon RDS instance hostnames are often longer than the MySQL limit of 60 characters for hostnames. To configure a successful migration connection for MySQL, you can provide the IP address of the Amazon RDS instance, instead of the hostname. In this setup task, you install and use dig, a command-line utility, to obtain the IP address.
For the next step, identify the hostname from the AWS RDS Database - Source (such as mysql://qmflvsilronjc8.cyla72gcy8zl.us-east-1.rds.amazonaws.com:3306/SourceMySQLDatabase
) within the AWS access information on this page.
qmflvsilronjc8.cyla72gcy8zl.us-east-1.rds.amazonaws.com
. Do not include the prefix mysql://
or the suffix :3306/SourceMySQLDatabase
as part of the hostname.The IP address is provided in the last line of the Answer output section, such as 54.84.181.60.
Note this IP address for use throughout this lab.
Although AWS configuration tasks can be completed in the AWS console, this lab uses the AWS CLI to complete these tasks in Cloud Shell. In this task, you install the AWS CLI tool in Cloud Shell to access the AWS resources from Google Cloud.
Property | Value |
---|---|
AWS Access Key ID [None] | enter the provided value for AWS Access Key |
AWS Secret Access Key [None] | enter the provided value for AWS Secret Key |
Default region name [None] | us-east-1 |
Default output format [None] | to accept the default, do not enter a value |
You have now configured the AWS CLI tool.
A connection profile stores information about the source database instance (such as Amazon RDS for MySQL) and is used by Database Migration Service to migrate data from the source to your destination Cloud SQL database instance. After you create a connection profile, it can be reused across migration jobs.
In the Google Cloud Console, on the Navigation menu (), click Database Migration > Connection profiles.
Click Create Profile.
For Profile Role, select Source.
For Database engine, select Amazon RDS for MySQL.
Enter the required information for a connection profile:
Property | Value |
---|---|
Connection profile name | mysql-rds |
Connection profile ID | keep the auto-generated value |
Hostname or IP address | enter the IP address you identified for the Amazon RDS instance in the Setup tasks (such as 54.84.181.60) |
Port | 3306 |
Username | admin |
Password | changeme |
Because you will use an IP allowlist as the connectivity option, you are providing a public address for the source. Learn more about connectivity options from the Database Migration Service documentation .
For Region, select
For the Encryption Type, select None.
You will an IP allowlist as the connectivity option, so you can consider using SSL/TLS certificates to encrypt the data migrating from the source to the destination instance. Learn more about using an IP allowlist from the Cloud SQL documentation.
A new connection profile named mysql-rds will appear in the Connections profile list.
Click Check my progress to verify the objective.
When you create a new migration job, you first define the source database instance using a previously created connection profile. Then, you create a new destination database instance and configure connectivity between the source and destination instances.
In this task, you will use the migration job interface to create a new Cloud SQL for MySQL instance and set it as the destination for the one-time migration job from the source Amazon RDS for MySQL instance.
In the Google Cloud Console, on the Navigation menu (), click Database Migration > Migration jobs.
Click Create Migration Job.
For Create a migration job, on the Get Started tab, use the following values:
Property | Value |
---|---|
Migration job name | rds-to-cloudsql |
Migration job ID | keep the auto-generated value |
Source database engine | Amazon RDS for MySQL |
Destination region | |
Migration job type | One-time |
Leave all other settings as default.
For source connection profile, select mysql-rds.
Leave the defaults for the other settings.
Property | Value |
---|---|
Type of destination instance | New instance |
Destination Instance ID | mysql-cloudsql |
Root password | supersecret |
Cloud SQL edition | Enterprise |
Database version | Cloud SQL for MySQL 5.7 |
Zone | Multiple zones |
Connections | Public IP |
Machine shapes | 1 vCPU, 3.75 GB |
Storage type | SSD |
Storage capacity | 10 GB |
Click Create & Continue.
When prompted to confirm, click Create Destination & Continue.
A message will state that your destination database instance is being created. Continue to step 1 while you wait.
When the destination database (Cloud SQL for MySQL) is created, the outgoing IP addresses will be available.
Copy the Destination outgoing IP addresses (such as 35.239.140.158
and 34.172.105.39
) to configure the IP allowlist on the Amazon RDS instance.
Click Save & Continue.
Leave this window open. You modify the IP allowlist on the Amazon RDS instance in the next task.
Click Check my progress to verify the objective.
To allow connections between the source and destination instances, you need to modify the IP allowlist on the source. For Amazon RDS, you accomplish this by modifying a Database Security Group with the public IP address of the destination instance (such as Cloud SQL).
Although this task can be completed in the AWS console, you will use the AWS CLI to complete this task in Cloud Shell.
To modify the IP allowlist on the Amazon RDS instance, run the following command in Cloud Shell:
Replace <sg_id>
with the provided value for AWS RDS Database Security Group (such as sg-06700713f70076ad8
) on this page, and replace <a.b.c.d>
with the first Destination outgoing IP address of your Cloud SQL instance (such as 35.239.140.158
).
34.172.105.39
).Note that the <sg_id>
remains the same from step 1; it is only --cidr <a.b.c.d>/32
that needs to be updated for the second outgoing IP address (such as --cidr 34.172.105.39/32
).
The IP addresses for the Cloud SQL instance have now been added to the IP allowlist on the Amazon RDS instance.
Click Check my progress to verify the objective.
Return to the migration job window and review the summary.
Click Test Job.
After a successful test, click Create & Start Job.
In the Google Cloud Console, on the Navigation menu (), click Database Migration > Migration jobs.
Click the migration job rds-to-cloudsql to see the details page.
Review the migration job status.
Click Check my progress to verify the objective.
In the Google Cloud Console, on the Navigation menu (), click Databases > SQL.
Click on the instance ID called mysql-cloudsql.
In the Primary Instance menu, click Databases.
Notice that the databases called customers_data and sales_data have been migrated to Cloud SQL.
In the Primary Instance menu, click Overview.
In Connect to this instance panel, click on Open cloud shell button.
The command to connect to MySQL will pre-populate in Cloud Shell:
If prompted, click Authorize for the API.
You have now activated the MySQL interactive console.
There are 5,030 records in the customers table that was migrated from the Amazon RDS instance for MySQL.
Click Check my progress to verify the objective.
You migrated a MySQL database from an Amazon RDS instance for MySQL to Cloud SQL for MySQL using a one-time Database Migration Service job and an IP allowlist for connectivity.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated November 27, 2024
Lab Last Tested November 27, 2024
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one