Migrating Data between Cloud SQL and External Servers

This page describes how you can move the location of your master instance between an external, self-managed server and Cloud SQL with a minimum of downtime.

Migrating data to Cloud SQL

To migrate the master copy of your data to Cloud SQL with the least downtime, you create a replica managed by Cloud SQL, then promote the replica to a stand-alone instance.

This procedure requires you to complete the following high-level steps:

  1. Configure your source database server according to the requirements for replicating it to Cloud SQL.
  2. Create a Cloud SQL replica for your source database server, following the steps in Replicating from an External Server to Cloud SQL.
  3. When the replica is fully synchronized with the source database server, take your applications offline, and update the applications to point to the replica.
  4. Follow the instructions provided in Promoting a replica to promote the replica to a stand-alone instance.
  5. Restart your applications, configured to point to the Cloud SQL instance.

Migrating data to an external server

To migrate the primary copy of your data from Cloud SQL to an external server with the least downtime, you set up your external server as an external replica, then demote the Cloud SQL instance to become the replica of the external server.

This procedure requires you to complete the following high-level steps:

  1. Create an external replica for your Cloud SQL instance, following the steps in Configuring External Replicas.
  2. When the replica is fully synchronized with the Cloud SQL master, take your applications offline, and update the applications to point to the external server.
  3. Follow the instructions provided in Demoting the master of an external replica to demote the Cloud SQL master. Demoting the master also promotes the external server, making it the new master instance.
Was this page helpful? Let us know how we did:

Send feedback about...

Cloud SQL for MySQL