Stay organized with collections Save and categorize content based on your preferences.
Creating a migration job includes:
To create a migration job to a new destination instance, do the following:
Console Define settings for the migration jobThe migration job configuration wizard page opens. This wizard contains multiple panels that walk you through each configuration step.
You can pause the creation of a migration job at any point by clicking Save and exit. All of the data that you enter up to that point is saved in a draft migration job. You can finish your draft migration job later.
This is a human-readable name for your migration job. This value is displayed in the Google Cloud console.
This is a machine-readable identifier for your migration job. You use this value to work with migration jobs by using Database Migration Service Google Cloud CLI commands or API.
The Destination database engine field is populated automatically and can't be changed.
Database Migration Service is a fully-regional product, meaning all entities related to your migration (source and destination connection profiles, migration jobs, destination databases) must be saved in a single region. Select the region based on the location of the services that need your data, such as Compute Engine instances or App Engine apps, and other services. After you choose the destination region, this selection can't be changed.
Important: If you plan to use the Cloud SQL for MySQL Enterprise Plus edition, make sure your region is supported for that edition. See Cloud SQL for MySQL Enterprise Plus edition region support.On the Define a source page, perform the following steps:
mysqlshell
utility. Database Migration Service can auto-generate this backup file for you, or you can provide your own copy.If you use a logical backup file, configure the data dump parallelism or dump flags.
Expand this section for full logical backup file stepsIn the Choose how to generate your dump file section, use one of the following options:
Auto-generate the initial dump (recommended)
This option is recommended because Database Migration Service always generates an initial database dump file after the migration job is created and started.
Database Migration Service uses this file to reproduce the original object definitions and table data of your source database so that this information can be migrated into a destination Cloud SQL database instance.
If you use the auto-generated dump, select the type of operation Database Migration Service should perform in the Configure data dump operation section:
LOCK_TABLES
). For more information on required permissions for source databases, see Configure source database.
The speed of data parallelism is related to the amount of load induced on your source database:
mysqldump
utility that's used to create the dump file.
To add a flag:
Select one of the following flags:
add-locks:
This flag surrounds each table that's contained in the dump file with LOCK TABLES
and UNLOCK TABLES
statements. This results in faster inserts when the dump file is loaded into the destination instance.ignore-error:
Use this flag to enter a list of comma-separated error numbers. These numbers represent the errors that the mysqldump
utility will ignore.max-allowed-packet:
Use this flag to set the maximum size of the buffer for communication between the MySQL client and the source MySQL database. The default size of the buffer is 24 MB; the maximum size is 1 GB. If you're using large BLOB
columns or long strings in the tables of the source database, then you must increase the size of the buffer for this flag.mysqldump
utility in the MySQL 8.0 Reference Manual.To remove a flag, click the trashcan icon to the right of the row that contains the flag.
Provide your own
This option is not recommended because by default Database Migration Service performs an initial dump as part of the migration job run.
If you want to use your own dump file, select Provide your own, click BROWSE, select your file (or the whole Cloud Storage folder if you use multiple files), and then click SELECT.
Make sure the dump was generated within the last 24 hours and adheres to the dump requirements.
Don't include sensitive or personally identifiable information in the identifier. There's no need to include the project ID in the instance name. This is done automatically where appropriate (for example, in the log files).
root
administrator account in the instance.
You can either enter the password manually or click Generate to have Database Migration Service create one for you automatically.
Click Show minor versions to view all minor versions. Learn more about cross-version migration support.
Cloud SQL for MySQL editions come with different sets of features, available machine types, and pricing. Make sure you consult the Cloud SQL documentation to choose the edition that is appropriate for your needs. For more information, see Introduction to Cloud SQL for MySQL editions.
If you are configuring your instance for high availability, select Multiple zones (Highly available). You can select both the primary and the secondary zone. The following conditions apply when the secondary zone is used during instance creation:
To enable private IP connectivity, make sure you meet all the additional networking requirements.
Optionally, under Public IP click the Authorized networks field, and either authorize a network or a proxy to connect to the Cloud SQL instance. Networks are only authorized with the addresses that you provide. See Configure public IP in the Cloud SQL documentation.
You configure the migration job connectivity in a later step. To learn more about available networking methods, see Configure connectivity.
Data cache is an optional feature available for Cloud SQL for MySQL Enterprise Plus edition instances that adds a high-speed local solid state drive to your destination database. This feature can introduce additional costs to your Cloud SQL. For more information on data cache, see Data cache overview in Cloud SQL documentation.
Make sure the instance has enough storage capacity to handle the data from your source database. You can increase this capacity at any time, but you can't decrease it.
(Optional) Configure data encryption options or resource labels for your destination instance.
Expand this section to see the optional steps.Click Show optional configurations, and then:
Specify whether you want to manage the encryption of the data that's migrated from the source to the destination. By default, your data is encrypted with a key that's managed by Google Cloud. If you want to manage your encryption, then you can use a customer-managed encryption key (CMEK). To do so:
If you don't see your key, then click Enter key resource name to provide the resource name of the key that you want to use. Example key resource name: projects/my-project-name/locations/my-location/keyRings/my-keyring/cryptoKeys/my-key
.
If Database Migration Service doesn't have these permissions, then information will appear, specifying that the Database Migration Service service account can't use the CMEK. Click Grant to give Database Migration Service permissions to use the key.
For more information about creating a CMEK, see Using customer-managed encryption keys (CMEK).
Labels help organize your instances. For example, you can organize labels by cost center or environment. Labels are also included in your bill so you can see the distribution of costs across your labels.
From the Connectivity method drop-down menu, select a network connectivity method. This method defines how the newly created Cloud SQL instance will connect to the source database. Current network connectivity methods include IP allowlist, reverse SSH tunnel, and VPC peering.
If you want to use... Then... The IP allowlist network connectivity method, You need to specify the outgoing IP address of your destination instance. If the Cloud SQL instance you created is a high availability instance, include the outgoing IP addresses for both the primary and the secondary instance. The reverse SSH tunnel network connectivity method, You need to select the Compute Engine VM instance that will host the tunnel.After specifying the instance, Google will provide a script that performs the steps to set up the tunnel between the source and destination databases. You'll need to run the script in the Google Cloud CLI.
Run the commands from a machine that has connectivity to both the source database and to Google Cloud.
The VPC peering network connectivity method, You need to select the VPC network where the source database resides. The Cloud SQL instance will be updated to connect to this network.After you select and configure network connectivity, click Configure and continue.
Test, create, and run the migration jobOn this final step, review the summary of the migration job settings, source, destination, and connectivity method, and then test the validity of the migration job setup. If any issues are encountered, then you can modify the migration job's settings. Not all settings are editable.
If the test fails, then you can address the problem in the appropriate part of the flow, and return to re-test. For information troubleshooting a failing migration job test, see Diagnose issues for MySQL.
If the job isn't started at the time that it's created, then it can be started from the Migration jobs page by clicking START. Regardless of when the migration job starts, your organization is charged for the existence of the destination instance.
Your migration is now in progress. When you start the migration job, Database Migration Service begins the full dump, briefly locking the source database. If your source is in Amazon RDS or Amazon Aurora, Database Migration Service additionally requires a short (approximately under a minute) write downtime at the start of the migration. For more information, see Known limitations.
Caution: If you used Terraform to provision your destination database, you might experience configuration drift during the migration job execution. Don't try to re-apply Terraform settings before the migration is complete. For more information, see Terraform configuration drift. Create the destination connection profile.
When you migrate to a new destination instance with Google Cloud CLI, you create the destination instance and the connection profile in a single action.
Run the following command (click the link to expand):
gcloud database-migration connection-profiles create cloudsql
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:
MYSQL_8_0
, MYSQL_8_0_32
, MYSQL_8_0_36
.
For all possible MySQL versions, see the --database-version flag reference.
You can change your edition by using the --edition
flag with one of the following values:
enterprise-plus
for the Cloud SQL for MySQL Enterprise Plus editionenterprise
for the Cloud SQL for MySQL Enterprise editiondb-n1-standard-1
, db-perf-optimized-N-2
. For a full list of available machine types and their identifiers for use with Google Cloud CLI, see Machine types in Cloud SQL for MySQL documentation.
Instances created with Google Cloud CLI by default use the Cloud SQL for MySQL Enterprise Plus edition that has different machine types available. If you want to use a machine type that is available only in the Cloud SQL for MySQL Enterprise edition, use the optional --edition=enterprise
flag to specify the edition.
By default, new instances you create with Google Cloud CLI use Cloud SQL for MySQL Enterprise Plus edition. If you plan to use Cloud SQL for MySQL Enterprise Plus edition, make sure your region is supported for that edition. See Cloud SQL for MySQL Enterprise Plus edition region support. You can change the edition by using the optional --edition
flag.
By default, new instances you create with Google Cloud CLI have a public IP address assigned, and are configured to use public IP connectivity. You can use other connectivity methods. For more information, see Configure connectivity.
You don't need to use additional flags if you want to use public IP connectivity. If you want to use private IP connectivity with VPC Network Peering or a reverse-SSH tunnel, make sure you meet the following additional network requirements for enabling private IP connectivity and include additional flags in your command.
Include the following additional flags if you want to use private IP connectivity (with VPC Network Peering or with a reverse-SSH tunnel on a Compute Engine VM):
--no-enable-ip-v4
: (Optional) To not assign a public IP address to your destination instance. You can have both a public and a private IP address assigned to your destination instance, but you might not want a public IP address if you use private IP connectivity.--private-network
: To assign a private IP address to your destination instance, specify the name of the Virtual Private Cloud where you want to have a private IP address assigned.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 \ --database-version=DATABASE_VERSION \ --tier=TIER \ --display-name=CONNECTION_PROFILE_NAMEWindows (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 ` --database-version=DATABASE_VERSION ` --tier=TIER ` --display-name=CONNECTION_PROFILE_NAMEWindows (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 ^ --database-version=DATABASE_VERSION ^ --tier=TIER ^ --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]
Create the migration job.
If you use VPC peering or a reverse-SSH tunnel connectivity, make sure to add the required flags, such as --peer-vpc
, or --vm
, --vm-ip
, --vm-port
, --vpc
. For more informations, see Configure connectivity and Google Cloud CLI examples.
Run the following command (click the link to expand):
gcloud database-migration migration-jobs create
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 migration-jobs \ create MIGRATION_JOB_ID \ --no-async \ --region=REGION \ --display-name=MIGRATION_JOB_NAME \ --source=SOURCE_CONNECTION_PROFILE_ID \ --destination=DESTINATION_CONNECTION_PROFILE_ID \ --type=MIGRATION_JOB_TYPEWindows (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 migration-jobs ` create MIGRATION_JOB_ID ` --no-async ` --region=REGION ` --display-name=MIGRATION_JOB_NAME ` --source=SOURCE_CONNECTION_PROFILE_ID ` --destination=DESTINATION_CONNECTION_PROFILE_ID ` --type=MIGRATION_JOB_TYPEWindows (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 migration-jobs ^ create MIGRATION_JOB_ID ^ --no-async ^ --region=REGION ^ --display-name=MIGRATION_JOB_NAME ^ --source=SOURCE_CONNECTION_PROFILE_ID ^ --destination=DESTINATION_CONNECTION_PROFILE_ID ^ --type=MIGRATION_JOB_TYPE
You should receive a response similar to the following:
Waiting for migration job [MIGRATION_JOB_ID] to be created with [OPERATION_ID] Waiting for operation [OPERATION_ID] to complete...done. Created migration job MIGRATION_JOB_ID [OPERATION_ID]
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-14 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-14 UTC."],[[["This guide provides instructions for creating a MySQL migration job, including defining job settings, specifying source and destination connection profiles, and setting up connectivity."],["The migration job process involves selecting between physical or logical backup methods for the initial data dump, with options to auto-generate or provide a custom dump file."],["When setting up a destination Cloud SQL instance, users can select instance type, version, region, IP configuration, machine type, storage, and optional settings such as data encryption."],["Connectivity between the source and destination databases can be configured using various methods, including IP allowlist, reverse SSH tunnel, or VPC peering."],["Users can test the migration job to validate the configuration before starting, and they can use the Google Cloud console or Google Cloud CLI for managing the entire process."]]],[]]
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