Upgrading MySQL for an Instance

This page describes how to move your data to an instance running a later version of MySQL.

Introduction

The steps for moving your data from one version of MySQL to another involve exporting data from the current instance and importing that data into a new instance running the later version of MySQL. 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 an instance running a newer version of MySQL, you should familiarize yourself with the differences between the MySQL versions:

Upgrading

To move your data to a Cloud SQL instance running a later version of MySQL:

  1. Create the target instance, with the desired MySQL version.

    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.
    • For First Generation instances, the same authorized networks. Learn more.
    • The same user accounts, with the same MySQL privileges and passwords.

    For help with creating an instance, see Creating an instance.

  2. Confirm that you can connect to the new instance with your local MySQL tools and update them if necessary.

  3. Put your current Cloud SQL instance into read-only mode by setting the read_only database flag to On.

    For help, see Configuring Database Flags.

  4. Export the current instance's data to a SQL dump file, following the instructions in Exporting data for Import into Cloud SQL.

    Do not export the mysql system database.

  5. Create a Cloud Storage bucket if needed, and upload your SQL dump file to the bucket.

  6. Import the data to the target instance, following the instructions in Importing MySQL databases from Cloud Storage.

  7. Update your applications to connect to the new instance.

  8. When you are confident that your new instance is operating successfully, delete the old instance.

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud SQL for MySQL