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

Updated on 17 April, 2025
How to Migrate Google Cloud SQL for MySQL to Vultr Managed Databases for MySQL header image

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:

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 Customer Portal.

  2. Click Products and select Databases.

  3. Click your target Vultr Managed Databases for MySQL to open its management page.

  4. 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

    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.
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 if its not installed on your workstation.

  2. Open MySQL Workbench.

  3. Click Migration on the left navigation menu.

    Migrate with MySQL Workbench

  4. Click Start Migration at the bottom of the Overview section.

  5. Enter the following details on the Source Selection page in MySQL Workbench.

  6. Keep MySQL as the database system, Standard (TCP/IP) as the connection method.

  7. Enter your source Cloud SQL database details in the respective fields within the parameters section.

  8. Click Store in Vault, enter your Cloud SQL database password and click OK to save it.

  9. Click Test Connection to test the connection to your Cloud SQL instance.

  10. Click Next to proceed to target selection.

  11. 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

  12. Click Store in Vault, enter your Vultr Managed Databases for MySQL password and click OK to save it.

  13. Click Test Connection to test the connection to your Vultr Managed Databases for MySQL.

  14. Click Next when the test connection is successful.

  15. Select all your target databases from the Schemas Selection list to migrate.

    Database Selection

  16. Click Next to map the tables, columns, constraints, and relationships for documentation and migration planning.

  17. Keep the default selections in the Object Migration section and keep Migrate Table Objects selected.

    Object Migration

  18. Click Next to navigate to the Manual Editing options and verify any migration issues.

  19. Click Next to access the Target Creation Options.

  20. Check the Create schema in target RDMS and Create a SQL script file options to create an SQL script file.

  21. Check the Keep schemas if they already exist option and click Next to start the migration process.

    Target Creation Review

  22. When the migration is successful, click Next to specify the data transfer options.

  23. 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.

  24. Verify the migration report and click Finish to close the migration window.

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
    
  2. 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)
  3. Switch to a migrated database such as example_db.

    sql
    mysql> USE example_db;
    
  4. 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)
  5. 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.

  2. 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 for more information.

Comments

No comments yet.