migration_jobs
Creates, updates, deletes, gets or lists a migration_jobs resource.
Overview
| Name | migration_jobs |
| Type | Resource |
| Id | google.datamigration.migration_jobs |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | The name (URI) of this migration job resource, in the form of: projects/{project}/locations/{location}/migrationJobs/{migrationJob}. |
cmekKeyName | string | The CMEK (customer-managed encryption key) fully qualified key name used for the migration job. This field supports all migration jobs types except for: * Mysql to Mysql (use the cmek field in the cloudsql connection profile instead). * PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql connection profile instead). * PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb connection profile instead). Each Cloud CMEK key has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] |
conversionWorkspace | object | The conversion workspace used by the migration. (id: ConversionWorkspaceInfo) |
createTime | string (google-datetime) | Output only. The timestamp when the migration job resource was created. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". |
destination | string | Required. The resource name (URI) of the destination connection profile. |
destinationDatabase | object | The database engine type and provider of the destination. (id: DatabaseType) |
displayName | string | The migration job display name. |
dumpFlags | object | The initial dump flags. This field and the "dump_path" field are mutually exclusive. (id: DumpFlags) |
dumpPath | string | The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive. |
dumpType | string | Optional. The type of the data dump. Supported for MySQL to CloudSQL for MySQL migrations only. (DUMP_TYPE_UNSPECIFIED, LOGICAL, PHYSICAL) |
duration | string (google-duration) | Output only. The duration of the migration job (in seconds). A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". |
endTime | string (google-datetime) | Output only. If the migration job is completed, the time when it was completed. |
error | object | Output only. The error details in case of state FAILED. (id: Status) |
filter | string | This field can be used to select the entities to migrate as part of the migration job. It uses AIP-160 notation to select a subset of the entities configured on the associated conversion-workspace. This field should not be set on migration-jobs that are not associated with a conversion workspace. |
labels | object | The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs. An object containing a list of "key": "value" pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. |
mysqlHomogeneousConfig | object | Optional. Configuration for MySQL homogeneous migration. (id: MySqlHomogeneousConfig) |
objectsConfig | object | Optional. The objects that need to be migrated. (id: MigrationJobObjectsConfig) |
oracleToPostgresConfig | object | Configuration for heterogeneous Oracle to Cloud SQL for PostgreSQL and Oracle to AlloyDB for PostgreSQL migrations. (id: OracleToPostgresConfig) |
originalMigrationName | string | Optional. A failback replication pointer to the resource name (URI) of the original migration job. |
performanceConfig | object | Optional. Data dump parallelism settings used by the migration. (id: PerformanceConfig) |
phase | string | Output only. The current migration job phase. (PHASE_UNSPECIFIED, FULL_DUMP, CDC, PROMOTE_IN_PROGRESS, WAITING_FOR_SOURCE_WRITES_TO_STOP, PREPARING_THE_DUMP, READY_FOR_PROMOTE) |
postgresHomogeneousConfig | object | Optional. Configuration for PostgreSQL homogeneous migration. (id: PostgresHomogeneousConfig) |
postgresToSqlserverConfig | object | Configuration for heterogeneous failback migrations from PostgreSQL to SQL Server. (id: PostgresToSqlServerConfig) |
purpose | string | Output only. Migration job mode. Migration jobs can be standard forward jobs or failback migration jobs. (PURPOSE_UNSPECIFIED, MIGRATE, FAILBACK) |
reverseSshConnectivity | object | The details needed to communicate to the source over Reverse SSH tunnel connectivity. (id: ReverseSshConnectivity) |
satisfiesPzi | boolean | Output only. Reserved for future use. |
satisfiesPzs | boolean | Output only. Reserved for future use. |
source | string | Required. The resource name (URI) of the source connection profile. |
sourceDatabase | object | The database engine type and provider of the source. (id: DatabaseType) |
sqlserverHomogeneousMigrationJobConfig | object | Optional. Configuration for SQL Server homogeneous migration. (id: SqlServerHomogeneousMigrationJobConfig) |
sqlserverToPostgresConfig | object | Configuration for heterogeneous SQL Server to Cloud SQL for PostgreSQL migrations. (id: SqlServerToPostgresConfig) |
state | string | The current migration job state. (STATE_UNSPECIFIED, MAINTENANCE, DRAFT, CREATING, NOT_STARTED, RUNNING, FAILED, COMPLETED, DELETING, STOPPING, STOPPED, DELETED, UPDATING, STARTING, RESTARTING, RESUMING) |
staticIpConnectivity | object | static ip connectivity data (default, no additional details needed). (id: StaticIpConnectivity) |
type | string | Required. The migration job type. (TYPE_UNSPECIFIED, ONE_TIME, CONTINUOUS) |
updateTime | string (google-datetime) | Output only. The timestamp when the migration job resource was last updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". |
vpcPeeringConnectivity | object | The details of the VPC network that the source database is located in. (id: VpcPeeringConnectivity) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name (URI) of this migration job resource, in the form of: projects/{project}/locations/{location}/migrationJobs/{migrationJob}. |
cmekKeyName | string | The CMEK (customer-managed encryption key) fully qualified key name used for the migration job. This field supports all migration jobs types except for: * Mysql to Mysql (use the cmek field in the cloudsql connection profile instead). * PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql connection profile instead). * PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb connection profile instead). Each Cloud CMEK key has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] |
conversionWorkspace | object | The conversion workspace used by the migration. (id: ConversionWorkspaceInfo) |
createTime | string (google-datetime) | Output only. The timestamp when the migration job resource was created. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". |
destination | string | Required. The resource name (URI) of the destination connection profile. |
destinationDatabase | object | The database engine type and provider of the destination. (id: DatabaseType) |
displayName | string | The migration job display name. |
dumpFlags | object | The initial dump flags. This field and the "dump_path" field are mutually exclusive. (id: DumpFlags) |
dumpPath | string | The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive. |
dumpType | string | Optional. The type of the data dump. Supported for MySQL to CloudSQL for MySQL migrations only. (DUMP_TYPE_UNSPECIFIED, LOGICAL, PHYSICAL) |
duration | string (google-duration) | Output only. The duration of the migration job (in seconds). A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s". |
endTime | string (google-datetime) | Output only. If the migration job is completed, the time when it was completed. |
error | object | Output only. The error details in case of state FAILED. (id: Status) |
filter | string | This field can be used to select the entities to migrate as part of the migration job. It uses AIP-160 notation to select a subset of the entities configured on the associated conversion-workspace. This field should not be set on migration-jobs that are not associated with a conversion workspace. |
labels | object | The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs. An object containing a list of "key": "value" pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. |
mysqlHomogeneousConfig | object | Optional. Configuration for MySQL homogeneous migration. (id: MySqlHomogeneousConfig) |
objectsConfig | object | Optional. The objects that need to be migrated. (id: MigrationJobObjectsConfig) |
oracleToPostgresConfig | object | Configuration for heterogeneous Oracle to Cloud SQL for PostgreSQL and Oracle to AlloyDB for PostgreSQL migrations. (id: OracleToPostgresConfig) |
originalMigrationName | string | Optional. A failback replication pointer to the resource name (URI) of the original migration job. |
performanceConfig | object | Optional. Data dump parallelism settings used by the migration. (id: PerformanceConfig) |
phase | string | Output only. The current migration job phase. (PHASE_UNSPECIFIED, FULL_DUMP, CDC, PROMOTE_IN_PROGRESS, WAITING_FOR_SOURCE_WRITES_TO_STOP, PREPARING_THE_DUMP, READY_FOR_PROMOTE) |
postgresHomogeneousConfig | object | Optional. Configuration for PostgreSQL homogeneous migration. (id: PostgresHomogeneousConfig) |
postgresToSqlserverConfig | object | Configuration for heterogeneous failback migrations from PostgreSQL to SQL Server. (id: PostgresToSqlServerConfig) |
purpose | string | Output only. Migration job mode. Migration jobs can be standard forward jobs or failback migration jobs. (PURPOSE_UNSPECIFIED, MIGRATE, FAILBACK) |
reverseSshConnectivity | object | The details needed to communicate to the source over Reverse SSH tunnel connectivity. (id: ReverseSshConnectivity) |
satisfiesPzi | boolean | Output only. Reserved for future use. |
satisfiesPzs | boolean | Output only. Reserved for future use. |
source | string | Required. The resource name (URI) of the source connection profile. |
sourceDatabase | object | The database engine type and provider of the source. (id: DatabaseType) |
sqlserverHomogeneousMigrationJobConfig | object | Optional. Configuration for SQL Server homogeneous migration. (id: SqlServerHomogeneousMigrationJobConfig) |
sqlserverToPostgresConfig | object | Configuration for heterogeneous SQL Server to Cloud SQL for PostgreSQL migrations. (id: SqlServerToPostgresConfig) |
state | string | The current migration job state. (STATE_UNSPECIFIED, MAINTENANCE, DRAFT, CREATING, NOT_STARTED, RUNNING, FAILED, COMPLETED, DELETING, STOPPING, STOPPED, DELETED, UPDATING, STARTING, RESTARTING, RESUMING) |
staticIpConnectivity | object | static ip connectivity data (default, no additional details needed). (id: StaticIpConnectivity) |
type | string | Required. The migration job type. (TYPE_UNSPECIFIED, ONE_TIME, CONTINUOUS) |
updateTime | string (google-datetime) | Output only. The timestamp when the migration job resource was last updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z". |
vpcPeeringConnectivity | object | The details of the VPC network that the source database is located in. (id: VpcPeeringConnectivity) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, migrationJobsId | Gets details of a single migration job. | |
list | select | projectsId, locationsId | orderBy, filter, pageSize, pageToken | Lists migration jobs in a given project and location. |
create | insert | projectsId, locationsId | migrationJobId, requestId | Creates a new migration job in a given project and location. |
patch | update | projectsId, locationsId, migrationJobsId | updateMask, requestId | Updates the parameters of a single migration job. |
delete | delete | projectsId, locationsId, migrationJobsId | force, requestId | Deletes a single migration job. |
verify | exec | projectsId, locationsId, migrationJobsId | Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met. | |
resume | exec | projectsId, locationsId, migrationJobsId | Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase). | |
fetch_source_objects | exec | projectsId, locationsId, migrationJobsId | Retrieves objects from the source database that can be selected for data migration. This is applicable for the following migrations: 1. PostgreSQL to Cloud SQL for PostgreSQL 2. PostgreSQL to AlloyDB for PostgreSQL. | |
stop | exec | projectsId, locationsId, migrationJobsId | Stops a running migration job. | |
demote_destination | exec | projectsId, locationsId, migrationJobsId | Demotes the destination database to become a read replica of the source. This is applicable for the following migrations: 1. MySQL to Cloud SQL for MySQL 2. PostgreSQL to Cloud SQL for PostgreSQL 3. PostgreSQL to AlloyDB for PostgreSQL. | |
promote | exec | projectsId, locationsId, migrationJobsId | Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database. | |
generate_tcp_proxy_script | exec | projectsId, locationsId, migrationJobsId | Generate a TCP Proxy configuration script to configure a cloud-hosted VM running a TCP Proxy. | |
start | exec | projectsId, locationsId, migrationJobsId | Start an already created migration job. | |
restart | exec | projectsId, locationsId, migrationJobsId | Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch. | |
generate_ssh_script | exec | projectsId, locationsId, migrationJobsId | Generate a SSH configuration script to configure the reverse SSH connectivity. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
locationsId | string | |
migrationJobsId | string | |
projectsId | string | |
filter | string | |
force | boolean | |
migrationJobId | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
Gets details of a single migration job.
SELECT
name,
cmekKeyName,
conversionWorkspace,
createTime,
destination,
destinationDatabase,
displayName,
dumpFlags,
dumpPath,
dumpType,
duration,
endTime,
error,
filter,
labels,
mysqlHomogeneousConfig,
objectsConfig,
oracleToPostgresConfig,
originalMigrationName,
performanceConfig,
phase,
postgresHomogeneousConfig,
postgresToSqlserverConfig,
purpose,
reverseSshConnectivity,
satisfiesPzi,
satisfiesPzs,
source,
sourceDatabase,
sqlserverHomogeneousMigrationJobConfig,
sqlserverToPostgresConfig,
state,
staticIpConnectivity,
type,
updateTime,
vpcPeeringConnectivity
FROM google.datamigration.migration_jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND migrationJobsId = '{{ migrationJobsId }}' -- required
;
Lists migration jobs in a given project and location.
SELECT
name,
cmekKeyName,
conversionWorkspace,
createTime,
destination,
destinationDatabase,
displayName,
dumpFlags,
dumpPath,
dumpType,
duration,
endTime,
error,
filter,
labels,
mysqlHomogeneousConfig,
objectsConfig,
oracleToPostgresConfig,
originalMigrationName,
performanceConfig,
phase,
postgresHomogeneousConfig,
postgresToSqlserverConfig,
purpose,
reverseSshConnectivity,
satisfiesPzi,
satisfiesPzs,
source,
sourceDatabase,
sqlserverHomogeneousMigrationJobConfig,
sqlserverToPostgresConfig,
state,
staticIpConnectivity,
type,
updateTime,
vpcPeeringConnectivity
FROM google.datamigration.migration_jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- create
- Manifest
Creates a new migration job in a given project and location.
INSERT INTO google.datamigration.migration_jobs (
data__reverseSshConnectivity,
data__type,
data__sourceDatabase,
data__dumpPath,
data__name,
data__vpcPeeringConnectivity,
data__mysqlHomogeneousConfig,
data__postgresToSqlserverConfig,
data__performanceConfig,
data__sqlserverHomogeneousMigrationJobConfig,
data__cmekKeyName,
data__destinationDatabase,
data__conversionWorkspace,
data__filter,
data__oracleToPostgresConfig,
data__destination,
data__originalMigrationName,
data__sqlserverToPostgresConfig,
data__state,
data__source,
data__objectsConfig,
data__labels,
data__postgresHomogeneousConfig,
data__dumpType,
data__displayName,
data__dumpFlags,
data__staticIpConnectivity,
projectsId,
locationsId,
migrationJobId,
requestId
)
SELECT
'{{ reverseSshConnectivity }}',
'{{ type }}',
'{{ sourceDatabase }}',
'{{ dumpPath }}',
'{{ name }}',
'{{ vpcPeeringConnectivity }}',
'{{ mysqlHomogeneousConfig }}',
'{{ postgresToSqlserverConfig }}',
'{{ performanceConfig }}',
'{{ sqlserverHomogeneousMigrationJobConfig }}',
'{{ cmekKeyName }}',
'{{ destinationDatabase }}',
'{{ conversionWorkspace }}',
'{{ filter }}',
'{{ oracleToPostgresConfig }}',
'{{ destination }}',
'{{ originalMigrationName }}',
'{{ sqlserverToPostgresConfig }}',
'{{ state }}',
'{{ source }}',
'{{ objectsConfig }}',
'{{ labels }}',
'{{ postgresHomogeneousConfig }}',
'{{ dumpType }}',
'{{ displayName }}',
'{{ dumpFlags }}',
'{{ staticIpConnectivity }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ migrationJobId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: migration_jobs
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the migration_jobs resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the migration_jobs resource.
- name: reverseSshConnectivity
description: |
The details needed to communicate to the source over Reverse SSH tunnel connectivity.
value:
vmIp: "{{ vmIp }}"
vpc: "{{ vpc }}"
vmPort: {{ vmPort }}
vm: "{{ vm }}"
- name: type
value: "{{ type }}"
description: |
Required. The migration job type.
valid_values: ['TYPE_UNSPECIFIED', 'ONE_TIME', 'CONTINUOUS']
- name: sourceDatabase
description: |
The database engine type and provider of the source.
value:
provider: "{{ provider }}"
engine: "{{ engine }}"
- name: dumpPath
value: "{{ dumpPath }}"
description: |
The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- name: name
value: "{{ name }}"
description: |
The name (URI) of this migration job resource, in the form of: projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- name: vpcPeeringConnectivity
description: |
The details of the VPC network that the source database is located in.
value:
vpc: "{{ vpc }}"
- name: mysqlHomogeneousConfig
description: |
Optional. Configuration for MySQL homogeneous migration.
value:
isPrimaryDestination: {{ isPrimaryDestination }}
- name: postgresToSqlserverConfig
description: |
Configuration for heterogeneous failback migrations from **PostgreSQL to SQL Server**.
value:
postgresSourceConfig:
skipFullDump: {{ skipFullDump }}
sqlserverDestinationConfig:
maxConcurrentConnections: {{ maxConcurrentConnections }}
transactionTimeout: "{{ transactionTimeout }}"
- name: performanceConfig
description: |
Optional. Data dump parallelism settings used by the migration.
value:
dumpParallelLevel: "{{ dumpParallelLevel }}"
- name: sqlserverHomogeneousMigrationJobConfig
description: |
Optional. Configuration for SQL Server homogeneous migration.
value:
databaseBackups:
- encryptionOptions:
pvkPath: "{{ pvkPath }}"
pvkPassword: "{{ pvkPassword }}"
certPath: "{{ certPath }}"
database: "{{ database }}"
promoteWhenReady: {{ promoteWhenReady }}
dagConfig:
linkedServer: "{{ linkedServer }}"
sourceAg: "{{ sourceAg }}"
backupFilePattern: "{{ backupFilePattern }}"
useDiffBackup: {{ useDiffBackup }}
- name: cmekKeyName
value: "{{ cmekKeyName }}"
description: |
The CMEK (customer-managed encryption key) fully qualified key name used for the migration job. This field supports all migration jobs types except for: * Mysql to Mysql (use the cmek field in the cloudsql connection profile instead). * PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql connection profile instead). * PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb connection profile instead). Each Cloud CMEK key has the following format: projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
- name: destinationDatabase
description: |
The database engine type and provider of the destination.
value:
provider: "{{ provider }}"
engine: "{{ engine }}"
- name: conversionWorkspace
description: |
The conversion workspace used by the migration.
value:
name: "{{ name }}"
commitId: "{{ commitId }}"
- name: filter
value: "{{ filter }}"
description: |
This field can be used to select the entities to migrate as part of the migration job. It uses AIP-160 notation to select a subset of the entities configured on the associated conversion-workspace. This field should not be set on migration-jobs that are not associated with a conversion workspace.
- name: oracleToPostgresConfig
description: |
Configuration for heterogeneous **Oracle to Cloud SQL for PostgreSQL** and **Oracle to AlloyDB for PostgreSQL** migrations.
value:
oracleSourceConfig:
maxConcurrentFullDumpConnections: {{ maxConcurrentFullDumpConnections }}
cdcStartPosition: "{{ cdcStartPosition }}"
skipFullDump: {{ skipFullDump }}
maxConcurrentCdcConnections: {{ maxConcurrentCdcConnections }}
logMiner: "{{ logMiner }}"
binaryLogParser:
logFileDirectories:
archivedLogDirectory: "{{ archivedLogDirectory }}"
onlineLogDirectory: "{{ onlineLogDirectory }}"
oracleAsmLogFileAccess: "{{ oracleAsmLogFileAccess }}"
postgresDestinationConfig:
maxConcurrentConnections: {{ maxConcurrentConnections }}
transactionTimeout: "{{ transactionTimeout }}"
- name: destination
value: "{{ destination }}"
description: |
Required. The resource name (URI) of the destination connection profile.
- name: originalMigrationName
value: "{{ originalMigrationName }}"
description: |
Optional. A failback replication pointer to the resource name (URI) of the original migration job.
- name: sqlserverToPostgresConfig
description: |
Configuration for heterogeneous **SQL Server to Cloud SQL for PostgreSQL** migrations.
value:
sqlserverSourceConfig:
cdcStartPosition: "{{ cdcStartPosition }}"
maxConcurrentFullDumpConnections: {{ maxConcurrentFullDumpConnections }}
maxConcurrentCdcConnections: {{ maxConcurrentCdcConnections }}
skipFullDump: {{ skipFullDump }}
postgresDestinationConfig:
maxConcurrentConnections: {{ maxConcurrentConnections }}
transactionTimeout: "{{ transactionTimeout }}"
- name: state
value: "{{ state }}"
description: |
The current migration job state.
valid_values: ['STATE_UNSPECIFIED', 'MAINTENANCE', 'DRAFT', 'CREATING', 'NOT_STARTED', 'RUNNING', 'FAILED', 'COMPLETED', 'DELETING', 'STOPPING', 'STOPPED', 'DELETED', 'UPDATING', 'STARTING', 'RESTARTING', 'RESUMING']
- name: source
value: "{{ source }}"
description: |
Required. The resource name (URI) of the source connection profile.
- name: objectsConfig
description: |
Optional. The objects that need to be migrated.
value:
sourceObjectsConfig:
objectConfigs:
- objectIdentifier:
database: "{{ database }}"
type: "{{ type }}"
schema: "{{ schema }}"
table: "{{ table }}"
objectsSelectionType: "{{ objectsSelectionType }}"
- name: labels
value: "{{ labels }}"
description: |
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs. An object containing a list of "key": "value" pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
- name: postgresHomogeneousConfig
description: |
Optional. Configuration for PostgreSQL homogeneous migration.
value:
maxAdditionalSubscriptions: {{ maxAdditionalSubscriptions }}
isNativeLogical: {{ isNativeLogical }}
- name: dumpType
value: "{{ dumpType }}"
description: |
Optional. The type of the data dump. Supported for MySQL to CloudSQL for MySQL migrations only.
valid_values: ['DUMP_TYPE_UNSPECIFIED', 'LOGICAL', 'PHYSICAL']
- name: displayName
value: "{{ displayName }}"
description: |
The migration job display name.
- name: dumpFlags
description: |
The initial dump flags. This field and the "dump_path" field are mutually exclusive.
value:
dumpFlags:
- name: "{{ name }}"
value: "{{ value }}"
- name: staticIpConnectivity
value: "{{ staticIpConnectivity }}"
description: |
static ip connectivity data (default, no additional details needed).
- name: migrationJobId
value: "{{ migrationJobId }}"
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- patch
Updates the parameters of a single migration job.
UPDATE google.datamigration.migration_jobs
SET
data__reverseSshConnectivity = '{{ reverseSshConnectivity }}',
data__type = '{{ type }}',
data__sourceDatabase = '{{ sourceDatabase }}',
data__dumpPath = '{{ dumpPath }}',
data__name = '{{ name }}',
data__vpcPeeringConnectivity = '{{ vpcPeeringConnectivity }}',
data__mysqlHomogeneousConfig = '{{ mysqlHomogeneousConfig }}',
data__postgresToSqlserverConfig = '{{ postgresToSqlserverConfig }}',
data__performanceConfig = '{{ performanceConfig }}',
data__sqlserverHomogeneousMigrationJobConfig = '{{ sqlserverHomogeneousMigrationJobConfig }}',
data__cmekKeyName = '{{ cmekKeyName }}',
data__destinationDatabase = '{{ destinationDatabase }}',
data__conversionWorkspace = '{{ conversionWorkspace }}',
data__filter = '{{ filter }}',
data__oracleToPostgresConfig = '{{ oracleToPostgresConfig }}',
data__destination = '{{ destination }}',
data__originalMigrationName = '{{ originalMigrationName }}',
data__sqlserverToPostgresConfig = '{{ sqlserverToPostgresConfig }}',
data__state = '{{ state }}',
data__source = '{{ source }}',
data__objectsConfig = '{{ objectsConfig }}',
data__labels = '{{ labels }}',
data__postgresHomogeneousConfig = '{{ postgresHomogeneousConfig }}',
data__dumpType = '{{ dumpType }}',
data__displayName = '{{ displayName }}',
data__dumpFlags = '{{ dumpFlags }}',
data__staticIpConnectivity = '{{ staticIpConnectivity }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND migrationJobsId = '{{ migrationJobsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;
DELETE examples
- delete
Deletes a single migration job.
DELETE FROM google.datamigration.migration_jobs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND migrationJobsId = '{{ migrationJobsId }}' --required
AND force = '{{ force }}'
AND requestId = '{{ requestId }}'
;
Lifecycle Methods
- verify
- resume
- fetch_source_objects
- stop
- demote_destination
- promote
- generate_tcp_proxy_script
- start
- restart
- generate_ssh_script
Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.
EXEC google.datamigration.migration_jobs.verify
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
@@json=
'{
"updateMask": "{{ updateMask }}",
"migrationJob": "{{ migrationJob }}"
}'
;
Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).
EXEC google.datamigration.migration_jobs.resume
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
@@json=
'{
"skipValidation": {{ skipValidation }}
}'
;
Retrieves objects from the source database that can be selected for data migration. This is applicable for the following migrations: 1. PostgreSQL to Cloud SQL for PostgreSQL 2. PostgreSQL to AlloyDB for PostgreSQL.
EXEC google.datamigration.migration_jobs.fetch_source_objects
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
;
Stops a running migration job.
EXEC google.datamigration.migration_jobs.stop
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
;
Demotes the destination database to become a read replica of the source. This is applicable for the following migrations: 1. MySQL to Cloud SQL for MySQL 2. PostgreSQL to Cloud SQL for PostgreSQL 3. PostgreSQL to AlloyDB for PostgreSQL.
EXEC google.datamigration.migration_jobs.demote_destination
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
;
Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.
EXEC google.datamigration.migration_jobs.promote
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
@@json=
'{
"objectsFilter": "{{ objectsFilter }}"
}'
;
Generate a TCP Proxy configuration script to configure a cloud-hosted VM running a TCP Proxy.
EXEC google.datamigration.migration_jobs.generate_tcp_proxy_script
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
@@json=
'{
"vmName": "{{ vmName }}",
"vmMachineType": "{{ vmMachineType }}",
"vmSubnet": "{{ vmSubnet }}",
"vmZone": "{{ vmZone }}"
}'
;
Start an already created migration job.
EXEC google.datamigration.migration_jobs.start
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
@@json=
'{
"skipValidation": {{ skipValidation }}
}'
;
Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.
EXEC google.datamigration.migration_jobs.restart
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
@@json=
'{
"skipValidation": {{ skipValidation }},
"objectsFilter": "{{ objectsFilter }}",
"restartFailedObjects": {{ restartFailedObjects }}
}'
;
Generate a SSH configuration script to configure the reverse SSH connectivity.
EXEC google.datamigration.migration_jobs.generate_ssh_script
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@migrationJobsId='{{ migrationJobsId }}' --required
@@json=
'{
"vm": "{{ vm }}",
"vmCreationConfig": "{{ vmCreationConfig }}",
"vmSelectionConfig": "{{ vmSelectionConfig }}",
"vmPort": {{ vmPort }}
}'
;