---
title: How to Migrate Google Cloud SQL for MySQL to Vultr Managed Databases for MySQL
url: https://docs.vultr.com/how-to-migrate-google-cloud-sql-for-mysql-to-vultr-managed-databases-for-mysql
description: Learn the step-by-step process to migrate your Google Cloud SQL for MySQL database to Vultr Managed Databases for MySQL with minimal downtime and data loss.
publish_date: 2025-04-17T15:16:36.811025Z
last_updated: 2026-09-24T21:03:33.502531Z
author: Martin Sustak
header_image: https://docs.vultr.com/public/doc-assets/2150/aa4d9b99-bdfa-496f-bc82-36fb386c95a1.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

Vultr Managed Databases for MySQL is a high-performance, fully managed database solution offering scalability, reliability, and ease of use for your applications. With automatic backups, enhanced security features, and seamless scalability, Vultr ensures your database performs at its best while minimizing the management overhead. You can migrate an existing Google Cloud SQL for MySQL instance to a Vultr Managed Databases for MySQL cluster to transfer specific databases and cut over applications with new performance improvements.

Follow this guide to migrate from Google Cloud SQL for MySQL to Vultr Managed Databases for MySQL. You will set up a migration environment, transfer your data, and verify the integrity of the migrated database with minimal downtime for any linked applications.

## Prerequisites

Before you begin, you need to:

* Have access to an existing Google Cloud SQL for MySQL instance.
* [Configure your source Google Cloud SQL for MySQL Database](https://cloud.google.com/sql/docs/mysql/authorize-networks) to accept connections from all sources (`0.0.0.0/0`).
* [Back up](https://cloud.google.com/sql/docs/mysql/backup-recovery/backing-up) your source Google Cloud SQL for MySQL database to ensure a recovery option is available.
* Provision a [Vultr Managed Databases for MySQL](https://docs.vultr.com/products/managed-database/mysql/provisioning) cluster with the same MySQL version, and a similar or higher size as your source Cloud SQL for MySQL database.
* Install MySQL Workbench or the [`mysql` client tool on your workstation](https://docs.vultr.com/how-to-install-mysql-on-ubuntu-24-04).

## Migrate Google Cloud SQL for MySQL to Vultr Managed Databases for MySQL

You can migrate your databases from your Google Cloud SQL instance to Vultr Managed Dabatabase for MySQL cluster using two methods, live replication or backup and restore. Follow the step below to migrate your Cloud SQL for MySQL instance to a Vultr Managed Databases for MySQL cluster.

1. Log in to the Vultr Console.
1. Click **Products** and select **Databases**.
1. Click your target Vultr Managed Databases for MySQL to open its management page.
1. Verify the access credentials within the **Connection Details** section to use when migrating to the Vultr Managed Databases for MySQL cluster.

    ![Verify the destination cluster credentials](https://docs.vultr.com/public/doc-assets/2150/92009eec-0962-4642-9ffe-acad3581ccca.png)

    > [!NOTE]
    >
    > This guide uses the `example_db` database with a `users` table that contains multiple records to test the migration process. Replace the values with your actual database and table names.

???+ note "Using MySQL Workbench"

    Follow the steps below to migrate from Google Cloud SQL for MySQL to Vultr Managed Databases for MySQL using the MySQL Workbench application.

    1. Download and install [MySQL Workbench](https://downloads.mysql.com/archives/workbench/) if its not installed on your workstation.
    1. Open MySQL Workbench.
    1. Click **Migration** on the left navigation menu.

        ![Migrate with MySQL Workbench](https://docs.vultr.com/public/doc-assets/2150/8314fb19-0e6e-4068-8c92-203467124fe6.png)

    1. Click **Start Migration** at the bottom of the **Overview** section.
    1. Enter the following details on the **Source Selection page** in MySQL Workbench.
    1. Keep `MySQL` as the database system, `Standard (TCP/IP)` as the connection method.
    1. Enter your source Cloud SQL database details in the respective fields within the parameters section.
    1. Click **Store in Vault**, enter your Cloud SQL database password and click **OK** to save it.
    1. Click **Test Connection** to test the connection to your Cloud SQL instance.
    1. Click **Next** to proceed to target selection.
    1. Keep `Standard (TCP/IP)` as the connection method and enter your destination Vultr Managed Databases for MySQL credentials in the respective fields.

        ![MySQL Workbench Target Selection](https://docs.vultr.com/public/doc-assets/2150/369a27fd-3aae-4123-8d8a-9bd9b1578a32.png)

    1. Click **Store in Vault**, enter your Vultr Managed Databases for MySQL password and click **OK** to save it.
    1. Click **Test Connection** to test the connection to your Vultr Managed Databases for MySQL.
    1. Click **Next** when the test connection is successful.
    1. Select all your target databases from the `Schemas Selection` list to migrate.

        ![Database Selection](https://docs.vultr.com/public/doc-assets/2150/b7bf30fa-f37b-47e3-a372-be95e9f965d2.png)

    1. Click **Next** to map the tables, columns, constraints, and relationships for documentation and migration planning.
    1. Keep the default selections in the **Object Migration** section and keep `Migrate Table Objects` selected.

        ![Object Migration](https://docs.vultr.com/public/doc-assets/2150/a834e583-23f2-4052-97f1-d3c23b7a68b0.png)

    1. Click **Next** to navigate to the **Manual Editing** options and verify any migration issues.
    1. Click **Next** to access the **Target Creation Options**.
    1. Check the **Create schema in target RDMS** and **Create a SQL script file** options to create an SQL script file.
    1. Check the **Keep schemas if they already exist** option and click **Next** to start the migration process.

        ![Target Creation Review](https://docs.vultr.com/public/doc-assets/2150/63500cf4-1180-4c17-9d28-3db0754ef4c9.png)

    1. When the migration is successful, click **Next** to specify the data transfer options.
    1. Keep the **Online copy of table data to target RDMS** checked and click **Next** to keep a copy of the migration in your Vultr Managed Databases for MySQL cluster.
    1. Verify the migration report and click **Finish** to close the migration window.

??? note "Using mysqldump Backup and Restore"

    Mysqldump is a MySQL command-line tool for creating database backups. Follow the steps below to backup your Cloud SQL for MySQL databases and import the backup to your Vultr Managed Databases for MySQL cluster to migrate the target databases.

    1. Verify that `mysqldump` is available on your system.

        ```console
        $ mysqldump --version
        ```

        Output:

        ```
        mysqldump  Ver 8.0.41-0ubuntu0.24.04.1 for Linux on x86_64 ((Ubuntu))
        ```

        [Install the MySQL client tool](https://docs.vultr.com/how-to-install-mysql-on-debian-12) if `mysqldump` is not installed on your workstation.

    1. Use the `mysqldump` to export all databases in your source Cloud SQL for MySQL Managed Databases cluster into a single `migratetovultr.sql` file. Replace `192.0.2.1` with your actual Cloud SQL database's IP address, and `example_user` with your target user.

        ```console
        $ mysqldump --host=192.0.2.1 --user=example_user --set-gtid-purged=OFF --password=example-password --all-databases > migratetovultr.sql 
        ```

    1. Export a specific Cloud SQL for MySQL database. Replace `example_DB` with your target database.

        ```console
        $ mysqldump --host=192.0.2.1 --user=example_user --set-gtid-purged=OFF --password=example-password example_db > db_backup.sql
        ```

        The `--set-gtid-purged=OFF` option in the above command prevents MySQL from including Global Transaction Identifiers (GTIDs) in the backup to avoid issues when importing the data to the source database later. GTIDs are system-level identifiers used for tracking replication transactions and are not part of user data. Excluding does not impact your actual data during migration.

    1. Verify that the backup file exists in your working directory after backup.

        ```console
        $ ls
        ```

    1. Log in to your Vultr Managed Databases for MySQL cluster and enter your user password when prompted.

        ```console
        $ mysql --host=vultr-prod.vultrdb.com --port=18140 --user=vultradmin --password
        ```

    1. Create the target database such as `example_db`.

        ```sql
        mysql> CREATE DATABASE example_db;
        ```

    1. Exit the MySQL console.

        ```sql
        mysql> EXIT;
        ```

    1. Import the exported database to your Vultr Managed Database for MySQL cluster to migrate it and all tables.

        ```console
        $ mysql --host=vultr-prod.vultrdb.com --port=1671 --user=vultradmin --database=example_db --password < db_backup.sql
        ```

        Repeat the above process for all databases that require migration.

## Test the Vultr Managed Databases for MySQL

Follow the steps below to test your Vultr Managed Databases for MySQL cluster and verify that the migration from your source Cloud SQL for MySQL instance is successful.

1. Log in to the Vultr Managed Databases for MySQL cluster. Replace `vultr-prod.vultrdb.com`, `18140` and `vultradmin` with your actual details.

    ```console
    $ mysql --host=vultr-prod.vultrdb.com --port=18140 --user=vultradmin --password
    ```

1. List all available databases and verify that your source databases are migrated.

    ```sql
    mysql> SHOW DATABASES;
    ```

    Your output should be similar to the one below.

    ```
    +--------------------+
    | Database           |
    +--------------------+
    | defaultdb          |
    | information_schema |
    | mysql              |
    | performance_schema |
    | example_db         |
    | sys                |
    +--------------------+
    6 rows in set (0.03 sec)
    ```

1. Switch to a migrated database such as `example_db`.

    ```sql
    mysql> USE example_db;
    ```

1. List all tables in the database and verify that the records match with your source database.

    ```sql
    mysql> SHOW TABLES;
    ```

    Your output should be similar to the one below.

    ```
    +----------------------+
    | Tables_in_example_db |
    +----------------------+
    | users                |
    +----------------------+
    1 row in set (0.01 sec)
    ```

1. List all rows in the `users` table and verify that they match with your source table.

    ```sql
    mysql> SELECT * FROM users;
    ```

    Your output should be similar to the one below.

    ```
    +----+---------+---------------------+
    | id | name    | email               |
    +----+---------+---------------------+
    |  1 | Alice   | alice@example.com   |
    |  2 | Bob     | bob@example.com     |
    |  3 | Charlie | charlie@example.com |
    |  4 | Santa   | santa@example.com   |
    |  5 | Sophie  | sophie@example.com  |
    +----+---------+---------------------+
    5 rows in set (0.00 sec)
    ```

## Cutover Applications to Vultr Managed Databases for MySQL

Follow the recommendations below to cutover applications to your Vultr Managed Databases for MySQL when the migration is successful.

1. Update your application's configurations with your Vultr Managed Database for MySQL cluster's credentials. For example, follow the steps below to cutover WordPress applications to the Vultr Managed Databases for MySQL.

    * Navigate to the WordPress installation directory.

        ```console
        $ cd /path/to/wordpress/directory/
        ```

    * Create a backup of the configuration file to ensure safe rollback in case of any issues.

        ```console
        $ sudo cp wp-config.php wp-config.ORIG
        ```

    * Open the configuration file using a text editor such as `nano`.

        ```console
        $ sudo nano wp-config.php
        ```

    * Update database credentials. Locate the following section and replace the values with your Vultr Managed Databases for MySQL credentials.

        ```php
        /** The name of the database for WordPress */
        define('DB_NAME', '<example-wordpress-db>');

        /** MySQL database username */
        define('DB_USER', '<example-user>');

        /** MySQL database password */
        define('DB_PASSWORD', '<example-password>');

        /** MySQL hostname */
        define( 'DB_HOST', '<vultr-database-host>');

        /** MySQL port */
        define( 'DB_PORT', '<vultr-database-port>');
        ```

        Replace the following:

        * `<example-wordpress-db>` with the database name in your Vultr Managed Databases cluster.
        * `<example-user>` with the appropriate database username.
        * `<example-password>` with the password of your database user.
        * `<vultr-database-host>` with the host of your Vultr Managed Databases for MySQL cluster.
        * `<vultr-database-port>` with the Vultr Managed Databases for MySQL cluster port.

        Save and close the file.

    * Restart the web server to apply the configuration changes. The command may vary depending on the web server and Linux distribution you are using.

        For Apache:

        * On Debian-based systems (Ubuntu, Debian):

            ```console
            $ sudo systemctl restart apache2
            ```

        * On RHEL-based systems (CentOS, Rocky Linux, AlmaLinux):

            ```console
            $ sudo systemctl restart httpd
            ```

        For Nginx:

        * On all major distributions:

            ```console
            $ sudo systemctl restart nginx
            ```

        If your system uses an alternative init system, such as SysVinit or OpenRC, use the appropriate restart command. Refer to your distribution’s documentation for details.

1. Delete the source Google Cloud SQL for MySQL instance after verifying that the migration is successful.

## Conclusion

You have migrated from Google Cloud SQL for MySQL to Vultr Managed Databases for MySQL using back up and restore methods with mysqldump and MySQL Workbench. You exported your database from the Google Cloud SQL instance, imported it to the Vultr Managed Database for MySQL cluster, and verified the data integrity by retrieving and checking data. This process ensures that your applications run with minimal downtime as a result of the migration. Visit the [Vultr Managed Databases for MySQL documentation](https://docs.vultr.com/products/managed-database/mysql) for more information.
