A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/database-migration/docs/mysql/migrate-with-physical-xtrabackup below:

Migrate your databases by using a Percona XtraBackup physical file | Database Migration Service

Skip to main content Migrate your databases by using a Percona XtraBackup physical file

Stay organized with collections Save and categorize content based on your preferences.

You can migrate your MySQL databases to Cloud SQL by using physical database backup files created with the Percona XtraBackup for MySQL utility. Migrating with physical backup files offers increased data restoration speeds over migrations that use logical backup files. This makes them a great choice for moving big databases that contain multiple terabytes of data.

This migration flow involves the following tasks:

  1. Backing up your source MySQL instance and preparing the physical backup files by using the Percona XtraBackup for MySQL utility.

  2. Uploading your backup files to a Cloud Storage bucket.

  3. Creating and running the migration job in Database Migration Service.

    Depending on your scenario, you can create the destination instance on your own, or have Database Migration Service create the destination instance for you as a part of the migration job creation flow. For more information, see the Configure and run the migration job step.

  4. Promoting the migration job after the data is fully migrated.

Offline migrations

This guide describes migration scenarios for environments where you can ensure network connectivity between your source and destination database instances.

It is possible to perform a test migration where Database Migration Service doesn't connect to your source instance. Instead, Database Migration Service only reads the backup files you upload to the Cloud Storage bucket and replicates their contents to the Cloud SQL for MySQL destination. A migration flow that doesn't use network connectivity isn't recommended for production migrations, as Database Migration Service can't fully perform data validation.

If you want to try to perform an offline migration job, adjust the procedures in the following way:

Limitations

This section lists limitations for the migrations that use Percona XtraBackup physical files:

Costs

For homogenous migrations to Cloud SQL, Database Migration Service is offered at no additional charge. However, Cloud SQL and Cloud Storage pricing applies for network charges as well as Cloud SQL and Cloud Storage entities created for migration purposes.

In this document, you use the following billable components of Google Cloud:

To generate a cost estimate based on your projected usage, use the pricing calculator.

New Google Cloud users might be eligible for a

free trial

.

Before you begin
  1. Consider in which region you want to create the destination database. Database Migration Service is a fully-regional product, meaning all entities related to your migration (source and destination connection profiles, migration jobs, destination databases, storage buckets) must be saved in a single region.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Enable the Database Migration Service, Compute Engine, and Cloud SQL Admin APIs.

    Enable the APIs

Required roles

To get the permissions that you need to perform homogeneous MySQL migrations by using physical backup files, ask your administrator to grant you the following IAM roles on your project:

For more information about granting roles, see Manage access to projects, folders, and organizations.

These predefined roles contain the permissions required to perform homogeneous MySQL migrations by using physical backup files. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to perform homogeneous MySQL migrations by using physical backup files:

You might also be able to get these permissions with custom roles or other predefined roles.

Step 1. Consider your network connectivity requirements

There are different networking methods you can use to configure connectivity between your source and the Cloud SQL destination instances. Depending on which method you use, there might be additional steps you need to perform during the migration process.

Consider which connectivity method is right for your scenario before you proceed to the next steps, as your choice might impact the settings you need to use. For more information, see Configure connectivity.

Step 2. Prepare your source data

To prepare your data for migration, perform the following steps:

  1. Install the correct version of the Percona XtraBackup utility on your source instance. You must use a version of Percona XtraBackup that is equal to or later than your source instance version. For more information, see Server version and backup version comparison in the Percona XtraBackup documentation.
  2. Export and prepare the physical backup file of your source instance by using Percona XtraBackup. For complete information on using Percona XtraBackup, refer to the tool's documentation. You can also expand the following section for an example of recommended steps. Sample recommended steps for creating and preparing physical backup files by using Percona XtraBackup

    Before using any of the command data below, make the following replacements:

    1. Perform a full physical backup of your source instance. Run the following command:
        xtrabackup --backup \
          --target-dir=TARGET_DIR \
          --user=USERNAME \
          --password=PASSWORD
            
    2. When the backup file is ready, use the --prepare command to ensure file consistency. Run the following command:
        xtrabackup --prepare --target-dir=TARGET_DIR
            
  3. Create your bucket to store the backup files. Make sure you use the same region as the one where you intend to create your destination Cloud SQL for MySQL instance.

    Database Migration Service is a fully-regional product, meaning that all entities related to your migration (source and destination connection profiles, migration jobs, destination databases, storage buckets for backup files) must be saved in a single region.

  4. Upload the backup files to your Cloud Storage bucket. Make sure you upload the backup files to a dedicated Cloud Storage folder that doesn't contain any other files. See Upload objects from a file system in the Cloud Storage documentation.
  5. Create the source connection profile for your source database instance. Console

    To create a source connection profile, follow these steps:

    1. Go to the Connection profiles page in the Google Cloud Console.
    2. Click Create profile.
    3. On the Create a connection profile page, from the Database engine drop-down menu, select MySQL
    4. In the Connection profile name field, enter a human-readable name for your connection profile. This value is displayed in the connection profile list.
    5. Keep the auto-generated Connection profile ID.
    6. Enter a Hostname or IP address.
      • If the source database is hosted in Google Cloud, or if a reverse SSH tunnel is used to connect the destination database to the source database, then specify the private (internal) IP address for the source database. This address will be accessible by the Cloud SQL destination. For more information, see Configure connectivity using VPC peering.

        For other connectivity methods, such as IP allowlist, provide the public IP address.

    7. Enter the Port that's used to access the host. The default MySQL default port is 3306.
    8. Enter a username and password for the destination database. The user account must have the required privileges to access your data. For more information, see Configure your source database.
    9. In the Connection profile region section of the page, select the region where you want to save the connection profile. Connection profiles, like all resources, are saved in a region. Region selection doesn't impact which migration jobs can use them, or which regions can connect to the data location itself, but can impact availability in the case of regional downtime.
    10. Optional: If the connection is made over a public network (by using IP allowlists), then we recommend using SSL/TLS encryption for the connection between the source and destination databases.

      There are three options for the SSL/TLS configuration that you can select from the Secure your connection section of the page:

      1. None: The Cloud SQL destination instance connects to the source database without encryption.
      2. Server-only authentication: When the Cloud SQL destination instance connects to the source database, the instance authenticates the source, ensuring that the instance is connecting to the correct host securely. This prevents person-in-the-middle attacks. For server-only authentication, the source doesn't authenticate the instance.

        To use server-only authentication, you must provide the x509 PEM-encoded certificate of the certificate authority (CA) that signed the external server's certificate.

        For more information about creating certificates and keys for your external server, see Creating SSL and RSA Certificates and Keys using MySQL.
      3. Server-client authentication: When the destination instance connects to the source, the instance authenticates the source and the source authenticates the instance.

        Server-client authentication provides the strongest security. However, if you don't want to provide the client certificate and private key when you create the Cloud SQL destination instance, you can still use server-only authentication.

        To use server-client authentication, you must provide the following items when you create the destination connection profile:

        • The certificate of the CA that signed the source database server's certificate (the CA certificate).
        • The certificate used by the instance to authenticate against the source database server (the client certificate).
        • The private key associated with the client certificate (the client key).
        For more information about creating certificates and keys for your source database server, see Creating SSL and RSA Certificates and Keys using MySQL.

        If you're having trouble uploading the key, then select the Enter manually option, and copy and paste the key into the text area.

    11. Click Create. Your connection profile is now created.
    gcloud

    This sample uses the optional --no-async flag so that all operations are performed synchronously. This means that some commands might take a while to complete. You can skip the --no-async flag to run commands asynchronously. If you do, you need to use the gcloud database-migration operations describe command to verify if your operation is successful.

    Before using any of the command data below, make the following replacements:

    Execute the following command:

    Linux, macOS, or Cloud Shell Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running either gcloud init; or gcloud auth login and gcloud config set project.
    gcloud database-migration connection-profiles \
    create mysql CONNECTION_PROFILE_ID \
      --no-async \
      --region=REGION \
      --host=HOST_IP_ADDRESS \
      --port=PORT_NUMBER \
      --username=USERNAME \
      --password=PASSWORD \
      --display-name=CONNECTION_PROFILE_NAME
    Windows (PowerShell) Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running either gcloud init; or gcloud auth login and gcloud config set project.
    gcloud database-migration connection-profiles `
    create mysql CONNECTION_PROFILE_ID `
      --no-async `
      --region=REGION `
      --host=HOST_IP_ADDRESS `
      --port=PORT_NUMBER `
      --username=USERNAME `
      --password=PASSWORD `
      --display-name=CONNECTION_PROFILE_NAME
    Windows (cmd.exe) Note: Ensure you have initialized the Google Cloud CLI with authentication and a project by running either gcloud init; or gcloud auth login and gcloud config set project.
    gcloud database-migration connection-profiles ^
    create mysql CONNECTION_PROFILE_ID ^
      --no-async ^
      --region=REGION ^
      --host=HOST_IP_ADDRESS ^
      --port=PORT_NUMBER ^
      --username=USERNAME ^
      --password=PASSWORD ^
      --display-name=CONNECTION_PROFILE_NAME

    You should receive a response similar to the following:

    Waiting for connection profile [CONNECTION_PROFILE_ID]
    to be created with [OPERATION_ID]
    
    Waiting for operation [OPERATION_ID] to complete...done.
    
    Created connection profile CONNECTION_PROFILE_ID [OPERATION_ID]
    
Step 3. Configure and run the migration job

When you migrate with Percona XtraBackup, you might want to create the Cloud SQL destination instance on your own, or have Database Migration Service create it for you. For more information, see Migration job creation overview.

Each of these approaches requires you to follow a slightly different set of procedures. Use the drop-down menu to show the procedures relevant for your scenario:

Step 4. (Optional) Stop the migration

You can stop and delete your migration job at any point if you want to cancel the data migration process. You can manage the migration job in the Google Cloud console or with Google Cloud CLI.

Step 5. Finalize the migration

When the migration job completes successfully, finalize the migration job by performing one of the following steps:

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["Migrating MySQL to Cloud SQL using Percona XtraBackup provides faster data restoration for large databases by employing a physical backup method."],["The migration process involves backing up the source MySQL instance, uploading files to Cloud Storage, creating a DMS migration job, and promoting the migration to complete the operation."],["Percona XtraBackup is the exclusive supported backup utility, only allowing for full backups, and it must be installed on the source machine for backup, but the version must be compatible with the source MySQL version."],["Database Migration Service is free for these homogenous migrations, but the user will still have to pay for the Cloud Storage and Cloud SQL resources used in the process."],["There are limitations to be considered before beginning, such as the fact that MySQL versions 5.6 and 8.4 are not supported, cross-version migrations are restricted to the same major version, and tables over 5TB are also not supported."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4