migrations
Creates, updates, deletes, gets or lists a migrations resource.
Overview
| Name | migrations |
| Type | Resource |
| Id | azure.postgresql_flexible_servers.migrations |
Fields
The following fields are returned by SELECT queries:
- check_name_availability
- get
- list_by_target_server
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the migration to check for validity and availability. Required. |
message | string | Migration name availability message. |
nameAvailable | boolean | Indicates if the migration name is available. |
reason | string | Migration name availability reason. Known values are: "Invalid" and "AlreadyExists". (Invalid, AlreadyExists) |
type | string | Type of resource. Required. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
cancel | string | Indicates if cancel must be triggered for the entire migration. Known values are: "True" and "False". (True, False) |
currentStatus | object | Current status of a migration. |
dbsToCancelMigrationOn | array | When you want to trigger cancel for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array. |
dbsToMigrate | array | Names of databases to migrate. |
dbsToTriggerCutoverOn | array | When you want to trigger cutover for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array. |
location | string | The geo-location where the resource lives. Required. |
migrateRoles | string | Indicates if roles and permissions must be migrated. Known values are: "True" and "False". (True, False) |
migrationId | string | Identifier of a migration. |
migrationInstanceResourceId | string | Identifier of the private endpoint migration instance. |
migrationMode | string | Mode used to perform the migration: Online or Offline. Known values are: "Offline" and "Online". (Offline, Online) |
migrationOption | string | Supported option for a migration. Known values are: "Validate", "Migrate", and "ValidateAndMigrate". (Validate, Migrate, ValidateAndMigrate) |
migrationWindowEndTimeInUtc | string (date-time) | End time (UTC) for migration window. |
migrationWindowStartTimeInUtc | string (date-time) | Start time (UTC) for migration window. |
overwriteDbsInTarget | string | Indicates if databases on the target server can be overwritten when already present. If set to 'False', when the migration workflow detects that the database already exists on the target server, it will wait for a confirmation. Known values are: "True" and "False". (True, False) |
secretParameters | object | Migration secret parameters. |
setupLogicalReplicationOnSourceDbIfNeeded | string | Indicates whether to setup logical replication on source server, if needed. Known values are: "True" and "False". (True, False) |
sourceDbServerFullyQualifiedDomainName | string | Fully qualified domain name (FQDN) or IP address of the source server. This property is optional. When provided, the migration service will always use it to connect to the source server. |
sourceDbServerMetadata | object | Metadata of source database server. |
sourceDbServerResourceId | string | Identifier of the source database server resource, when 'sourceType' is 'PostgreSQLSingleServer'. For other source types this must be set to ipaddress:port@username or hostname:port@username. |
sourceType | string | Source server type used for the migration: ApsaraDB_RDS, AWS, AWS_AURORA, AWS_EC2, AWS_RDS, AzureVM, Crunchy_PostgreSQL, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, EDB, EDB_Oracle_Server, EDB_PostgreSQL, GCP, GCP_AlloyDB, GCP_CloudSQL, GCP_Compute, Heroku_PostgreSQL, Huawei_Compute, Huawei_RDS, OnPremises, PostgreSQLCosmosDB, PostgreSQLFlexibleServer, PostgreSQLSingleServer, or Supabase_PostgreSQL. Known values are: "OnPremises", "AWS", "GCP", "AzureVM", "PostgreSQLSingleServer", "AWS_RDS", "AWS_AURORA", "AWS_EC2", "GCP_CloudSQL", "GCP_AlloyDB", "GCP_Compute", "EDB", "EDB_Oracle_Server", "EDB_PostgreSQL", "PostgreSQLFlexibleServer", "PostgreSQLCosmosDB", "Huawei_RDS", "Huawei_Compute", "Heroku_PostgreSQL", "Crunchy_PostgreSQL", "ApsaraDB_RDS", "Digital_Ocean_Droplets", "Digital_Ocean_PostgreSQL", and "Supabase_PostgreSQL". (OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, Supabase_PostgreSQL) |
sslMode | string | SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'. Known values are: "Prefer", "Require", "VerifyCA", and "VerifyFull". (Prefer, Require, VerifyCA, VerifyFull) |
startDataMigration | string | Indicates if data migration must start right away. Known values are: "True" and "False". (True, False) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
targetDbServerFullyQualifiedDomainName | string | Fully qualified domain name (FQDN) or IP address of the target server. This property is optional. When provided, the migration service will always use it to connect to the target server. |
targetDbServerMetadata | object | Metadata of target database server. |
targetDbServerResourceId | string | Identifier of the target database server resource. |
triggerCutover | string | Indicates if cutover must be triggered for the entire migration. Known values are: "True" and "False". (True, False) |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
cancel | string | Indicates if cancel must be triggered for the entire migration. Known values are: "True" and "False". (True, False) |
currentStatus | object | Current status of a migration. |
dbsToCancelMigrationOn | array | When you want to trigger cancel for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array. |
dbsToMigrate | array | Names of databases to migrate. |
dbsToTriggerCutoverOn | array | When you want to trigger cutover for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array. |
location | string | The geo-location where the resource lives. Required. |
migrateRoles | string | Indicates if roles and permissions must be migrated. Known values are: "True" and "False". (True, False) |
migrationId | string | Identifier of a migration. |
migrationInstanceResourceId | string | Identifier of the private endpoint migration instance. |
migrationMode | string | Mode used to perform the migration: Online or Offline. Known values are: "Offline" and "Online". (Offline, Online) |
migrationOption | string | Supported option for a migration. Known values are: "Validate", "Migrate", and "ValidateAndMigrate". (Validate, Migrate, ValidateAndMigrate) |
migrationWindowEndTimeInUtc | string (date-time) | End time (UTC) for migration window. |
migrationWindowStartTimeInUtc | string (date-time) | Start time (UTC) for migration window. |
overwriteDbsInTarget | string | Indicates if databases on the target server can be overwritten when already present. If set to 'False', when the migration workflow detects that the database already exists on the target server, it will wait for a confirmation. Known values are: "True" and "False". (True, False) |
secretParameters | object | Migration secret parameters. |
setupLogicalReplicationOnSourceDbIfNeeded | string | Indicates whether to setup logical replication on source server, if needed. Known values are: "True" and "False". (True, False) |
sourceDbServerFullyQualifiedDomainName | string | Fully qualified domain name (FQDN) or IP address of the source server. This property is optional. When provided, the migration service will always use it to connect to the source server. |
sourceDbServerMetadata | object | Metadata of source database server. |
sourceDbServerResourceId | string | Identifier of the source database server resource, when 'sourceType' is 'PostgreSQLSingleServer'. For other source types this must be set to ipaddress:port@username or hostname:port@username. |
sourceType | string | Source server type used for the migration: ApsaraDB_RDS, AWS, AWS_AURORA, AWS_EC2, AWS_RDS, AzureVM, Crunchy_PostgreSQL, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, EDB, EDB_Oracle_Server, EDB_PostgreSQL, GCP, GCP_AlloyDB, GCP_CloudSQL, GCP_Compute, Heroku_PostgreSQL, Huawei_Compute, Huawei_RDS, OnPremises, PostgreSQLCosmosDB, PostgreSQLFlexibleServer, PostgreSQLSingleServer, or Supabase_PostgreSQL. Known values are: "OnPremises", "AWS", "GCP", "AzureVM", "PostgreSQLSingleServer", "AWS_RDS", "AWS_AURORA", "AWS_EC2", "GCP_CloudSQL", "GCP_AlloyDB", "GCP_Compute", "EDB", "EDB_Oracle_Server", "EDB_PostgreSQL", "PostgreSQLFlexibleServer", "PostgreSQLCosmosDB", "Huawei_RDS", "Huawei_Compute", "Heroku_PostgreSQL", "Crunchy_PostgreSQL", "ApsaraDB_RDS", "Digital_Ocean_Droplets", "Digital_Ocean_PostgreSQL", and "Supabase_PostgreSQL". (OnPremises, AWS, GCP, AzureVM, PostgreSQLSingleServer, AWS_RDS, AWS_AURORA, AWS_EC2, GCP_CloudSQL, GCP_AlloyDB, GCP_Compute, EDB, EDB_Oracle_Server, EDB_PostgreSQL, PostgreSQLFlexibleServer, PostgreSQLCosmosDB, Huawei_RDS, Huawei_Compute, Heroku_PostgreSQL, Crunchy_PostgreSQL, ApsaraDB_RDS, Digital_Ocean_Droplets, Digital_Ocean_PostgreSQL, Supabase_PostgreSQL) |
sslMode | string | SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'. Known values are: "Prefer", "Require", "VerifyCA", and "VerifyFull". (Prefer, Require, VerifyCA, VerifyFull) |
startDataMigration | string | Indicates if data migration must start right away. Known values are: "True" and "False". (True, False) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
targetDbServerFullyQualifiedDomainName | string | Fully qualified domain name (FQDN) or IP address of the target server. This property is optional. When provided, the migration service will always use it to connect to the target server. |
targetDbServerMetadata | object | Metadata of target database server. |
targetDbServerResourceId | string | Identifier of the target database server resource. |
triggerCutover | string | Indicates if cutover must be triggered for the entire migration. Known values are: "True" and "False". (True, False) |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
check_name_availability | select | resource_group_name, server_name, subscription_id | Check the validity and availability of the given name, to assign it to a new migration. Checks if a proposed migration name is valid and available. | |
get | select | resource_group_name, server_name, migration_name, subscription_id | Gets information about a migration. | |
list_by_target_server | select | resource_group_name, server_name, subscription_id | migrationListFilter | Lists all migrations of a target flexible server. |
create | insert | resource_group_name, server_name, migration_name, subscription_id, location | Creates a new migration. | |
update | update | resource_group_name, server_name, migration_name, subscription_id | Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions. | |
cancel | delete | resource_group_name, server_name, migration_name, subscription_id | Cancels an active migration. |
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 |
|---|---|---|
migration_name | string | Name of migration. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
server_name | string | The name of the server. Required. |
subscription_id | string | |
migrationListFilter | string | Migration list filter. Indicates if the request should retrieve only active migrations or all migrations. Defaults to Active. Known values are: "Active" and "All". Default value is None. |
SELECT examples
- check_name_availability
- get
- list_by_target_server
Check the validity and availability of the given name, to assign it to a new migration. Checks if a proposed migration name is valid and available.
SELECT
name,
message,
nameAvailable,
reason,
type
FROM azure.postgresql_flexible_servers.migrations
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets information about a migration.
SELECT
id,
name,
cancel,
currentStatus,
dbsToCancelMigrationOn,
dbsToMigrate,
dbsToTriggerCutoverOn,
location,
migrateRoles,
migrationId,
migrationInstanceResourceId,
migrationMode,
migrationOption,
migrationWindowEndTimeInUtc,
migrationWindowStartTimeInUtc,
overwriteDbsInTarget,
secretParameters,
setupLogicalReplicationOnSourceDbIfNeeded,
sourceDbServerFullyQualifiedDomainName,
sourceDbServerMetadata,
sourceDbServerResourceId,
sourceType,
sslMode,
startDataMigration,
systemData,
tags,
targetDbServerFullyQualifiedDomainName,
targetDbServerMetadata,
targetDbServerResourceId,
triggerCutover,
type
FROM azure.postgresql_flexible_servers.migrations
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND migration_name = '{{ migration_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all migrations of a target flexible server.
SELECT
id,
name,
cancel,
currentStatus,
dbsToCancelMigrationOn,
dbsToMigrate,
dbsToTriggerCutoverOn,
location,
migrateRoles,
migrationId,
migrationInstanceResourceId,
migrationMode,
migrationOption,
migrationWindowEndTimeInUtc,
migrationWindowStartTimeInUtc,
overwriteDbsInTarget,
secretParameters,
setupLogicalReplicationOnSourceDbIfNeeded,
sourceDbServerFullyQualifiedDomainName,
sourceDbServerMetadata,
sourceDbServerResourceId,
sourceType,
sslMode,
startDataMigration,
systemData,
tags,
targetDbServerFullyQualifiedDomainName,
targetDbServerMetadata,
targetDbServerResourceId,
triggerCutover,
type
FROM azure.postgresql_flexible_servers.migrations
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND migrationListFilter = '{{ migrationListFilter }}'
;
INSERT examples
- create
- Manifest
Creates a new migration.
INSERT INTO azure.postgresql_flexible_servers.migrations (
tags,
location,
properties,
resource_group_name,
server_name,
migration_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ resource_group_name }}',
'{{ server_name }}',
'{{ migration_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: migrations
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the migrations resource.
- name: server_name
value: "{{ server_name }}"
description: Required parameter for the migrations resource.
- name: migration_name
value: "{{ migration_name }}"
description: Required parameter for the migrations resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the migrations resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
Migration properties.
value:
migrationId: "{{ migrationId }}"
currentStatus:
state: "{{ state }}"
error: "{{ error }}"
currentSubStateDetails:
currentSubState: "{{ currentSubState }}"
dbDetails: "{{ dbDetails }}"
validationDetails:
status: "{{ status }}"
validationStartTimeInUtc: "{{ validationStartTimeInUtc }}"
validationEndTimeInUtc: "{{ validationEndTimeInUtc }}"
serverLevelValidationDetails:
- type: "{{ type }}"
state: "{{ state }}"
messages: "{{ messages }}"
dbLevelValidationDetails:
- databaseName: "{{ databaseName }}"
startedOn: "{{ startedOn }}"
endedOn: "{{ endedOn }}"
summary: "{{ summary }}"
migrationInstanceResourceId: "{{ migrationInstanceResourceId }}"
migrationMode: "{{ migrationMode }}"
migrationOption: "{{ migrationOption }}"
sourceType: "{{ sourceType }}"
sslMode: "{{ sslMode }}"
sourceDbServerMetadata:
location: "{{ location }}"
version: "{{ version }}"
storageMb: {{ storageMb }}
sku:
name: "{{ name }}"
tier: "{{ tier }}"
targetDbServerMetadata:
location: "{{ location }}"
version: "{{ version }}"
storageMb: {{ storageMb }}
sku:
name: "{{ name }}"
tier: "{{ tier }}"
sourceDbServerResourceId: "{{ sourceDbServerResourceId }}"
sourceDbServerFullyQualifiedDomainName: "{{ sourceDbServerFullyQualifiedDomainName }}"
targetDbServerResourceId: "{{ targetDbServerResourceId }}"
targetDbServerFullyQualifiedDomainName: "{{ targetDbServerFullyQualifiedDomainName }}"
secretParameters:
adminCredentials:
sourceServerPassword: "{{ sourceServerPassword }}"
targetServerPassword: "{{ targetServerPassword }}"
sourceServerUsername: "{{ sourceServerUsername }}"
targetServerUsername: "{{ targetServerUsername }}"
dbsToMigrate:
- "{{ dbsToMigrate }}"
setupLogicalReplicationOnSourceDbIfNeeded: "{{ setupLogicalReplicationOnSourceDbIfNeeded }}"
overwriteDbsInTarget: "{{ overwriteDbsInTarget }}"
migrationWindowStartTimeInUtc: "{{ migrationWindowStartTimeInUtc }}"
migrationWindowEndTimeInUtc: "{{ migrationWindowEndTimeInUtc }}"
migrateRoles: "{{ migrateRoles }}"
startDataMigration: "{{ startDataMigration }}"
triggerCutover: "{{ triggerCutover }}"
dbsToTriggerCutoverOn:
- "{{ dbsToTriggerCutoverOn }}"
cancel: "{{ cancel }}"
dbsToCancelMigrationOn:
- "{{ dbsToCancelMigrationOn }}"
UPDATE examples
- update
Updates an existing migration. The request body can contain one to many of the mutable properties present in the migration definition. Certain property updates initiate migration state transitions.
UPDATE azure.postgresql_flexible_servers.migrations
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND migration_name = '{{ migration_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
DELETE examples
- cancel
Cancels an active migration.
DELETE FROM azure.postgresql_flexible_servers.migrations
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND migration_name = '{{ migration_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;