Lab setup instructions and requirements
Protect your account and progress. Always use a private browser window and lab credentials to run this lab.

Migrating to Cloud SQL from Amazon RDS for MySQL Using Database Migration Service

Lab 55 годин universal_currency_alt 1 кредит show_chart Початковий
info This lab may incorporate AI tools to support your learning.
This content is not yet optimized for mobile devices.
For the best experience, please visit us on a desktop computer using a link sent by email.

GSP859

Google Cloud self-paced labs logo

Overview

Database Migration Service provides options for one-time and continuous jobs to migrate data to Cloud SQL. It offers various connectivity methods, including IP allowlists, reverse SSH tunnels, VPC peering, and Private Service Connect interfaces. 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. You use a one-time Database Migration Service job and an IP allowlist for connectivity. After you create and run the migration job, you check that the database has been successfully migrated to your Cloud SQL for MySQL instance.

migration-to-gcp-getting-started-migration-path

What you'll learn

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.

  • Create a profile for a source connection to a cloud-based MySQL instance (Amazon RDS for MySQL).
  • Configure connectivity between source and destination instances using an IP allowlist.
  • Create and run a one-time migration job using Database Migration Service.
  • Verify that the migration job has completed successfully.

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 qmflvsilronjc8.cyla72gcy8zl.us-east-1.rds.amazonaws.com) within the AWS access information on this page.

When you see values for the Google Cloud Username and Password, you may proceed to the Setup tasks.

Setup and requirements

Before you click the Start Lab button

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 are made available to you.

This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.

How to start your lab and sign in to the Google Cloud console

  1. Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:

    • The Open Google Cloud console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. 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.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab Details pane.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab Details pane.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field. Navigation menu icon and Search field

Activate Cloud Shell

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.

  1. Click Activate Cloud Shell Activate Cloud Shell icon at the top of the Google Cloud console.

  2. Click through the following windows:

    • Continue through the Cloud Shell information window.
    • Authorize Cloud Shell to use your credentials to make Google Cloud API calls.

When you are connected, you are already authenticated, and the project is set to your Project_ID, . The output contains a line that declares the Project_ID for this session:

Your Cloud Platform project in this session is set to {{{project_0.project_id | "PROJECT_ID"}}}

gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.

  1. (Optional) You can list the active account name with this command:
gcloud auth list
  1. Click Authorize.

Output:

ACTIVE: * ACCOUNT: {{{user_0.username | "ACCOUNT"}}} To set the active account, run: $ gcloud config set account `ACCOUNT`
  1. (Optional) You can list the project ID with this command:
gcloud config list project

Output:

[core] project = {{{project_0.project_id | "PROJECT_ID"}}} Note: For full documentation of gcloud, in Google Cloud, refer to the gcloud CLI overview guide.

Verify that the Database Migration API is enabled

  1. In the Google Cloud console title bar, enter Database Migration API in the Search field and then click Database Migration API in the search results.

The Manage button is visible when the API is enabled.

  1. If necessary, click Enable to enable the API.

Install a command-line utility to identify IP addresses

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 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.

  1. In Cloud Shell, run the following command to install dig:
sudo apt-get update && sudo apt-get install dnsutils -y

For the next step, identify the hostname from the AWS RDS Database - Source within the AWS access information on this page.

  1. To obtain the IP address of the Amazon RDS instance, run the following command in Cloud Shell (replace [HOSTNAME] with the Amazon RDS database - source, which is found in the Lab details pane in the lab instructions):
dig HOSTNAME

The IP address is provided in the last line of the Answer output section, such as 54.84.181.60.

;; ANSWER SECTION: qls-43123050feb97e21add454a6fa74bc9c-mydb-oocs9qo4aem6.ct0brribqcxe.us-east-1.rds.amazonaws.com. 5 IN CNAME ec2-54-84-181-60.compute-1.amazonaws.com. ec2-54-84-181-60.compute-1.amazonaws.com. 21600 IN A 54.84.181.60
  1. Record this IP address for use throughout this lab.

Task 1. Install and configure the AWS CLI tool in Cloud Shell

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.

  1. In Cloud Shell, run the following commands to install the AWS CLI tool in Cloud Shell:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install
  1. To configure the AWS CLI tool in Cloud Shell, run the following command:
aws configure
  1. Enter the required information to configure the AWS CLI tool:
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] Do not enter a value to accept the default

Note: The default region us-east-1, is an exception and uses one more hyphen than the standard gcloud region naming convention. Use this exact string when copying.

You have now configured the AWS CLI tool.

Task 2. Create a new connection profile for the Amazon RDS instance for MySQL

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.

  1. In the Google Cloud console, on the Navigation menu (Navigation menu icon), click View all products.

  2. Under Databases, click Database migration.

  3. On the left pane, click Connection profiles and then click Create profile.

  4. For Source engine, select Amazon RDS for MySQL.

  5. For Destination engine, select Cloud SQL for MySQL.

  6. For Choose the profile type to create, select Source.

  7. Enter the required information below 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 for the AWS RDS Database you recorded earlier.
Port 3306
Username admin
Password changeme

Because you 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 .

  1. For Region, select .

  2. For Encryption type, select None.

When using IP allowlist as the connectivity option in a production environment, you can use 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.

  1. Click Create.

A new connection profile named mysql-rds shows in the Connections profile list.

Click Check my progress to verify the objective. Create a connection profile for the MySQL source instance.

Task 3. Create a one-time migration job

When you create a new migration job, you first define the source database instance using a pre-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.

Create a new migration job

  1. In the Google Cloud console, on the Navigation menu (Navigation menu icon), click View all products.

  2. Under Databases, click Database migration.

  3. On the left menu, click Migration jobs, and then click Create migration job.

  4. For Create a migration job, in 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.

  1. Click Save & continue.

Define the source instance

  1. In the Define a source tab, for source connection profile, select mysql-rds.

  2. Leave the defaults for the other settings.

Note: After you select the source connection profile, you can see its configuration details, including source hostname or IP address, port, username, and encryption type.
  1. Click Save & continue.

Select the destination instance

  1. In the Define a destination tab, for Type of destination instance, select Existing instance.

  2. For instance ID, select mysql-cloudsql.

  3. Click Select & continue.

  4. If prompted to confirm, confirm by typing the instance name and click Confirm & continue.

Define the connectivity method

  1. In Define connectivity method, for Connectivity method, select IP allowlist.

  2. 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.

  3. Click Save & continue.

This action saves the migration job in a draft state.

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. Create a one-time migration job.

Task 4. Configure the IP allowlist on source instance

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

In Cloud Shell, you use the AWS CLI to complete this task.

  1. In Cloud Shell, run the following command to modify the IP allowlist on the Amazon RDS instance:

    Replace [a.b.c.d] with the first Destination outgoing IP address of your Cloud SQL instance (such as 35.239.140.158).

aws ec2 authorize-security-group-ingress \ --group-id {{{aws_account.startup_script.SourceMySQLDatabaseSecurityGroup | AWS RDS Database Security Group }}} \ --protocol tcp \ --port 3306 \ --cidr [a.b.c.d]/32
  1. Repeat step 1 for all Destination outgoing IP address of your Cloud SQL instance (such as 34.172.105.39).

Note that it's only the --cidr [a.b.c.d]/32 line that needs to be updated for the remaining outgoing IP addresses (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. Configure the IP allowlist on the source instance.

Task 5. Test and run a one-time migration job

In this task, you test the migration job settings firsrt, and then start the migration job.

  1. Return to the migration job window and review the summary.

If you previously closed the window, you can return to the migration job by opening the Navigation menu (Navigation menu icon), and clicking View all products. Under Databases, click Database migration, and on the left side menu, click Migration jobs. Click on the draft migration job named rds-to-cloudsql under the Drafts tab of the table.

  1. Click Test job.

  2. After a successful test, click Create & start job.

  3. In the Create & start migration job dialog, click Create & start.

Review status of the one-time migration job in Database Migration Service

  1. In the Google Cloud console, on the Navigation menu (Navigation menu icon), click View all products, and under Databases, click Database migration. On the left menu, click Migration jobs.

  2. Click the migration job rds-to-cloudsql to see the details page.

  3. Review the migration job status.

    • If you have not started the job, the status will show as Not started. You can choose to start or delete the job.
    • After the job has started, the status will show as Starting and then transition to Running.
    • When the job status changes to Completed, the migration job has completed successfully, and you can move on to the next task.

Click Check my progress to verify the objective. Test and run a one-time migration job.

Task 6. Confirm the data in Cloud SQL for MySQL

Check MySQL databases in Cloud SQL

  1. In the Google Cloud console, on the Navigation menu (Navigation menu icon), click View all products. Under Databases, click Cloud SQL.

  2. Click the instance ID called mysql-cloudsql.

  3. In the Primary instance menu, click Databases.

Notice that the databases called customers_data and sales_data have been migrated to Cloud SQL.

Connect to MySQL database

  1. In the Primary instance menu, click Overview.

  2. In Connect to this instance panel, click Open cloud shell.

The command to connect to MySQL pre-populates in Cloud Shell:

gcloud sql connect mysql-cloudsql --user=root --quiet
  1. Run the pre-populated command.

  2. If prompted, click Authorize for the API.

  3. When prompted for a password, which you previously set, enter:

supersecret

You have now activated the MySQL interactive console.

Review data in Cloud SQL for MySQL database

  1. To select the database in the MySQL interactive console, run the following command:
use customers_data;
  1. Query the number of records in the customers table:
select count(*) from customers;

There are 5,030 records in the customers table that were migrated from the Amazon RDS instance for MySQL.

  1. Exit the MySQL interactive console:
exit

Click Check my progress to verify the objective. Confirm the data in Cloud SQL for MySQL.

Congratulations!

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.

Next steps / Learn more

Learn more about data migration, Cloud SQL databases, and Database Migration Service:

Google Cloud training and certification

...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 February 12, 2026

Lab Last Tested February 12, 2026

Copyright 2026 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.

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

Use private browsing

  1. Copy the provided Username and Password for the lab
  2. Click Open console in private mode

Sign in to the Console

  1. Sign in using your lab credentials. Using other credentials might cause errors or incur charges.
  2. Accept the terms, and skip the recovery resource page
  3. Don't click End lab unless you've finished the lab or want to restart it, as it will clear your work and remove the project

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

Use private browsing to run the lab

Using an Incognito or private browser window is the best way to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.