About data migration in Cloud SQL

This page describes data migration options in Cloud SQL.

Database Migration Service

To migrate data from an external server into Cloud SQL, you can use Database Migration Service.

When you use Database Migration Service, you can create the destination Cloud SQL instance when you create a migration job. Database Migration Service uses migration jobs to migrate data from your source database instance to the destination Cloud SQL instance. For more information, see Create a migration job to a new destination instance.

However, you might want to create your destination Cloud SQL instance outside of Database Migration Service. For example, you can use Terraform or other Infrastructure-As-Code (IaC) tools. In that case, after creating the Cloud SQL instance, you can still use Database Migration Service to migrate data to it. For more information, see Create a migration job to an existing destination instance.

Replicate from an external server

Another option for migrating data from an external server into Cloud SQL is to use replication. Cloud SQL supports various replication modes to migrate data into your instance.

For more information, see About replicating from an external server.

To set up Cloud SQL for data migration by using replication, see Configure Cloud SQL and the external server for replication.

Limitations

  • Migrating data to a Cloud SQL instance that either has Private Service Connect enabled or already contains data isn't supported.
  • If your instance has customized backup settings (for example, a custom backup location), then after you promote the instance, we recommend that you customize your backup settings again. During the promotion process, Cloud SQL resets your backup settings to their default values.
  • After you promote an instance, we recommend that you enable point-in-time recovery.