Migrate AWS RDS to GCP Cloud SQL in Five Simple Steps
On March 31, 2021, there was a great announcement from Google Cloud Platform on Database Migration Service(DMS) that makes it easier for you to “lift and shift” (Rehost) your MySQL and PostgreSQL workloads into Cloud SQL for MySQL and Cloud SQL for PostgreSQL respectively.
Since DMS currently focuses on homogeneous migrations, migrations across compatible database engines in this article, we explore how to migrate AWS RDS for MySQL 8.0 to Cloud SQL for MySQL 8.0.
Prerequisite
Existing AWS RDS for MySQL 8.0 with Public accessibility in any availability zone of your choice. For demonstration purpose Employees database from GitHub is used.
The game starts now...
Make sure you have a GCP Project with Billing enabled and APIs like Compute Engine API, Database Migration API and so on are enabled
Create a Connection Profile
2. Now lets create a migration job using Migration Job wizard with Migration job type set to One-time
3. Define the source using the Connection Profile creation in step #1
4. Create a destination, make sure you use the same MySQL version which was provisioned in AWS RDS. For simplicity reason Cloud SQL for MySQL used will have Public IP with db-n1-standard-1 machine type and 10GB HDD storage
You can go to Cloud SQL Page to view the destination Cloud SQL for MySQL instance provisioned
5. Define the connectivity method as IP allowlist
Now, copy the Destination outgoing IP address and go to AWS Security Group page and whitelist it for 3306 port
6. The final is to Test and Create Migration Job by clicking on Create Job button
Now, click on the start
After few minutes the status keeps changing from DRAFT → CREATING → STARTING → RUNNING, FULL_DUMP → PROMOTE_IN_PROCESS → COMPLETED
Lastly, as a verification go to Cloud SQL instance’s Databases page to see employees database successfully migrated
Benefits
Easy-to-use and Serverless Migration tool
Database Migration Service is offered at no additional cost. Also there’s no additional charge for network ingress from AWS RDS for MySQL.
Conclusion
Easily migrate AWS RDS for MySQL and AWS RDS for PostgreSQL instance to Cloud SQL for MySQL and Cloud SQL for PostgreSQL respectively using completely a Free & Serverless migration service in simple 5 fives