This page describes how to move your data from a First Generation instance to an Second Generation instance.
The steps for moving your data from a First Generation instance to a Second Generation instance involve exporting data from the current instance and importing that data into a new Second Generation instance. This process involves downtime; you put the current instance into read-only mode before starting the export.
Before you begin
Before moving your data to Second Generation, you should familiarize yourself with the differences between First Generation and Second Generation and the connection options for Second Generation instances.
To move your data to Second Generation:
Create a Second Generation instance.
Make sure the target instance has:
- Sufficient storage to hold all of the current instance's data.
- The same authorized networks as the current instance. Learn more.
- The same user accounts, with the same MySQL privileges and passwords.
For help with creating an instance, see Creating an instance.
Confirm that you can connect to the new instance with your local MySQL client and a copy of your application.
Put your current Cloud SQL instance into read-only mode by setting the
read_onlydatabase flag to
For help, see Configuring Database Flags.
On your local workstation, export the current instance's data to a local SQL dump file, following the instructions in Exporting data for Import into Cloud SQL.
You must use
mysqldumpto perform the export. You cannot use the export provided by Google Cloud Platform Console.
Create a Cloud Storage bucket if needed, and upload your SQL dump file from your workstation to the bucket.
Import the SQL dump file to the target instance, following the instructions in Importing SQL dump files to a Cloud SQL instance.
Update your applications to connect to the new instance.
When you are confident that your new instance is operating successfully, delete the old instance.