gcloud alpha database-migration migration-jobs create

NAME
gcloud alpha database-migration migration-jobs create - create a Database Migration Service migration job
SYNOPSIS
gcloud alpha database-migration migration-jobs create(MIGRATION_JOB :--region=REGION)--destination=DESTINATION--source=SOURCE--type=TYPE[--no-async][--display-name=DISPLAY_NAME][--labels=[KEY=VALUE,…]][--dump-flags=[KEY=VALUE,…]    |--dump-path=DUMP_PATH][--peer-vpc=PEER_VPC    |--static-ip    | [--vm-ip=VM_IP--vm-port=VM_PORT--vpc=VPC :--vm=VM]][GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA) Create a Database Migration Service migration job.Recommended steps before creating the migration job:
  • Create a source connection profile. See prerequisiteshere.
  • Create a destination connection profile. For migrating to Cloud SQL for MySQL orCloud SQL for PostgreSQL, use the cloudsql connection profile for DMS to createthe CloudSQL replica for you.
  • Configure the connectivity method. See prerequisiteshere.
EXAMPLES
To create a continuous migration job with IP allowlist connectivity:
gcloudalphadatabase-migrationmigration-jobscreatemy-migration-job--region=us-central1--type=CONTINUOUS--source=cp1--destination=cp2

To create a continuous migration job with VPC peering connectivity:

gcloudalphadatabase-migrationmigration-jobscreatemy-migration-job--region=us-central1--type=CONTINUOUS--source=cp1--destination=cp2--peer-vpc=projects/my-project/global/networks/my-network

To create a one-time migration job with reverse-SSH tunnel connectivity:

gcloudalphadatabase-migrationmigration-jobscreatemy-migration-job--region=us-central1--type=ONE_TIME--source=cp1--destination=cp2--vm=vm1--vm-ip=1.1.1.1--vm-port=1111--vpc=projects/my-project/global/networks/my-network
POSITIONAL ARGUMENTS
Migration job resource - The migration job to create. The arguments in thisgroup can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.

To set theproject attribute:

  • provide the argumentmigration_job on the command line with a fullyspecified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

This must be specified.

MIGRATION_JOB
ID of the migration_job or fully qualified identifier for the migration_job.

To set themigration_job attribute:

  • provide the argumentmigration_job on the command line.

This positional argument must be specified if any of the other arguments in thisgroup are specified.

--region=REGION
The Cloud region for the migration_job.

To set theregion attribute:

  • provide the argumentmigration_job on the command line with a fullyspecified name;
  • provide the argument--region on the command line.
REQUIRED FLAGS
Connection profile resource - ID of the destination connection profile,representing the destination database. This represents a Cloud resource. (NOTE)Some attributes are not given arguments in this group but can be set in otherways.

To set theproject attribute:

  • provide the argument--destination on the command line with a fullyspecified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

To set theregion attribute:

  • provide the argument--destination on the command line with a fullyspecified name;
  • provide the argument--region on the command line.

This must be specified.

--destination=DESTINATION
ID of the connection_profile or fully qualified identifier for theconnection_profile.

To set theconnection_profile attribute:

  • provide the argument--destination on the command line.
Connection profile resource - ID of the source connection profile, representingthe source database. This represents a Cloud resource. (NOTE) Some attributesare not given arguments in this group but can be set in other ways.

To set theproject attribute:

  • provide the argument--source on the command line with a fullyspecified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

To set theregion attribute:

  • provide the argument--source on the command line with a fullyspecified name;
  • provide the argument--region on the command line.

This must be specified.

--source=SOURCE
ID of the connection_profile or fully qualified identifier for theconnection_profile.

To set theconnection_profile attribute:

  • provide the argument--source on the command line.
--type=TYPE
Type of the migration job.TYPE must be one of:ONE_TIME,CONTINUOUS.
OPTIONAL FLAGS
--no-async
Waits for the operation in progress to complete before returning.
--display-name=DISPLAY_NAME
A user-friendly name for the migration job. The display name can includeletters, numbers, spaces, and hyphens, and must start with a letter.
--labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to add.

Keys must start with a lowercase character and contain only hyphens(-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers.

At most one of these can be specified:
--dump-flags=[KEY=VALUE,…]
A list of dump flags. An object containing a list of "key": "value" pairs.
--dump-path=DUMP_PATH
Path to the dump file in Google Cloud Storage, in the format:gs://[BUCKET_NAME]/[OBJECT_NAME].
The connectivity method used by the migration job. If a connectivity methodisn't specified, then it isn't added to the migration job.

At most one of these can be specified:

--peer-vpc=PEER_VPC
Name of the VPC network to peer with the Cloud SQL private network.
--static-ip
Use the default IP allowlist method. This method creates a public IP that willbe used with the destination Cloud SQL database. The method works by configuringthe source database server to accept connections from the outgoing IP of theCloud SQL instance.
Parameters for the reverse-SSH tunnel connectivity method.
--vm-ip=VM_IP
Bastion Virtual Machine IP.

This flag argument must be specified if any of the other arguments in this groupare specified.

--vm-port=VM_PORT
Forwarding port for the SSH tunnel.

This flag argument must be specified if any of the other arguments in this groupare specified.

--vpc=VPC
Name of the VPC network where the VM is hosted.

This flag argument must be specified if any of the other arguments in this groupare specified.

--vm=VM
Name of VM that will host the SSH tunnel bastion.
GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

NOTES
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. This variant is also available:
gclouddatabase-migrationmigration-jobscreate

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

Last updated 2025-10-21 UTC.