arrow_back

Migrate MySQL Data to Cloud SQL using Database Migration Service: Challenge Lab

Test and share your knowledge with our community!
done
Get access to over 700 hands-on labs, skill badges, and courses

Migrate MySQL Data to Cloud SQL using Database Migration Service: Challenge Lab

Lab 1 heure 30 minutes universal_currency_alt 1 crédit show_chart Débutant
Test and share your knowledge with our community!
done
Get access to over 700 hands-on labs, skill badges, and courses

GSP351

Google Cloud self-paced labs logo

Overview

In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.

When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.

To score 100% you must successfully complete all tasks within the time period!

This lab is recommended for students enrolled in the Migrate MySQL Data to Cloud SQL using Database Migration Service skill badge. Are you ready for the challenge?

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

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito or private browser window 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.
  • Time to complete the lab---remember, once you start, you cannot pause a lab.
Note: If you already have your own personal Google Cloud account or project, do not use it for this lab to avoid extra charges to your account.

Set your region and zone

Certain Compute Engine resources live in regions and zones. A region is a specific geographical location where you can run your resources. Each region has one or more zones.

Run the following gcloud commands in Cloud Console to set the default region and zone for your lab:

gcloud config set compute/zone "{{{project_0.default_zone|ZONE}}}" export ZONE=$(gcloud config get compute/zone) gcloud config set compute/region "{{{project_0.default_region|REGION}}}" export REGION=$(gcloud config get compute/region)

Challenge scenario

Your employer has existing MySQL databases running on a Compute Engine instance. They want to migrate this database to two new Cloud SQL instances using two different migration strategies. For the initial migration you must perform a one-time migration using the external IP address of the compute instance to gain access to the source database. For the second migration you have been instructed to use VPC Peering for access to the source database to remove the dependency on the external ip-address.

Before you cut over to the newly migrated database, you must carry out a test to confirm that the migration has been successful. To perform this final test you must make some changes to the source database after the continuous migration job has been started, and then check that those changes are propagated by the Database Migration Service. Finally the destination instance (Cloud SQL for MySQL) must be promoted to a stand-alone database for reading and writing data.

Note: For the purposes of this lab, all of your resources should be created in the following region: and zone: .

Task 1. Configure a Database Migration Service connection profile for a stand-alone MySQL database

  • To complete this task you must configure a connection profile for the migration of the MySQL source instance, running on a compute instance named , to Cloud SQL using a Database Migration Service one-time migration and the external IP address of the source instance.

The credentials for this source database are provided in the table below:

Property Value
Username admin
Password changeme
Note: You should use the external IP address of the MySQL source instance to provide access to the source database for this connection profile, and the following region: . Configure a Database Migration Service connection profile for a stand-alone MySQL database.

Task 2. Perform a one-time migration of a stand-alone MySQL database to Cloud SQL

  1. You must migrate this compute instance based MySQL database to a Cloud SQL instance configured with the following properties:
Property Value
Cloud SQL Destination Instance ID
Root password supersecret!
Choose a Cloud SQL edition Enterprise
Database version Cloud SQL for MySQL 8
Machine type Standard
CPU 1 vCPU, 3.75GB
Storage type SSD
Storage capacity 10GB
  1. Once you have migrated this database to a Cloud SQL instance you can confirm that the data has populated the Cloud SQL MySQL database by connecting to the new Cloud SQL MySQL database and running the following query:
use customers_data; select count(*) from customers;

If the data are migrated, this query should return a row count of 5030.

Perform a one-time migration of a stand-alone MySQL database to Cloud SQL.

Task 3. Create a continuous Database Migration Service migration job to migrate a stand-alone MySQL database to Cloud SQL

  1. To complete this task you must create a continuous Database Migration Service migration job to migrate a stand-alone MySQL database to a second Cloud SQL instance using VPC peering.

  2. You must migrate the same stand-alone MySQL database to a second Cloud SQL instance configured with the following properties:

Property Value
Cloud SQL Destination Instance ID
Root password supersecret!
Choose a Cloud SQL edition Enterprise
Database version Cloud SQL for MySQL 8
Machine type Standard
CPU 1 vCPU, 3.75GB
Storage type SSD
Storage capacity 10GB
Note: You should use the same source connection profile that you created in Task 1. For the continuous migration job you must use VPC Peering to provide access to the source compute instance and its database.
  1. To complete this task you must start the continuous migration job you have created. Wait until the job is in the Running state before checking your progress below.
Migrate the stand-alone MySQL database to Cloud SQL using continuous migration.

Task 4. Test that the continuous Database Migration Service job replicates updated source data

  1. To complete this task you must connect to the source stand-alone MySQL instance and modify the database with the following query:
use customers_data; update customers set gender = 'FEMALE' where addressKey = 934;
  1. Allow a minute for the change to be propagated by the continuous migration job and then check the changes at the destination.
Check that the updated source data in the stand-alone MySQL database has been migrated to continuous replication Cloud SQL instance.

Task 5. Promote the destination Cloud SQL for MySQL database to a stand-alone database

  • In this task you must promote the Cloud SQL for MySQL instance to a stand-alone database for reading and writing data.
Check that the Cloud SQL for MySQL continuous migration job has been promoted to a stand-alone database for reading and writing.

Congratulations!

In this lab, you learned how to: configure a Database Migration Service connection profile for a stand-alone MySQL database; perform a one-time migration of a stand-alone MySQL database to Cloud SQL; create a continuous Database Migration Service migration job to migrate a stand-alone MySQL database to Cloud SQL; test that the continuous Database Migration Service job replicates updated source data; and promote the destination Cloud SQL for MySQL database to a stand-alone database.

migrate-mysql-skill-badge-green.png

Earn your next skill badge

This self-paced lab is part of the Migrate MySQL Data to Cloud SQL using Database Migration Service skill badge. Completing this skill badge quest earns you the badge above, to recognize your achievement. Share your badge on your resume and social platforms, and announce your accomplishment using #GoogleCloudBadge.

This skill badge quest is part of Google Cloud’s Database Engineer learning path. If you have already completed the other skill badges in this learning path, search the catalog for other skill badges in which you can enroll.

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 April 18, 2024

Lab Last Tested April 17, 2024

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