你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Migrations - Create

创建新的迁移。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}?api-version=2024-08-01

URI 参数

名称 必需 类型 说明
migrationName
path True

string

pattern: ^[a-z][a-z0-9]*$

迁移名称。

resourceGroupName
path True

string

pattern: ^[-a-z0-9A-Z._()]+[^.]$

目标数据库服务器的资源组名称。

subscriptionId
path True

string

pattern: ([a-z0-9]){8,8}[-]([a-z0-9]){4,4}[-]([a-z0-9]){4,4}[-]([a-z0-9]){4,4}[-]([a-z0-9]){12,12}

目标数据库服务器的订阅标识符。

targetDbServerName
path True

string

pattern: ([-a-z0-9]){3,63}

目标数据库服务器的名称。

api-version
query True

string

minLength: 1

用于此操作的 API 版本。

请求正文

名称 必需 类型 说明
location True

string

资源所在的地理位置

properties.cancel

CancelEnum

指示是否必须为整个迁移触发 cancel。

properties.dbsToCancelMigrationOn

string[]

如果要为特定数据库触发 cancel,请将 'triggerCutover' 设置为 'True' 并设置此数组中特定数据库的名称。

properties.dbsToMigrate

string[]

要迁移的数据库的名称。

properties.dbsToTriggerCutoverOn

string[]

如果要触发特定数据库的直接转换,请将 'triggerCutover' 设置为 'True' 并设置此数组中特定数据库的名称。

properties.migrateRoles

MigrateRolesEnum

指示是否必须迁移角色和权限。

properties.migrationInstanceResourceId

string (arm-id)

私有终端节点迁移实例的标识符。

properties.migrationMode

MigrationMode

用于执行迁移的模式:联机或脱机。

properties.migrationOption

MigrationOption

迁移的支持选项。

properties.migrationWindowEndTimeInUtc

string (date-time)

迁移时段的结束时间 (UTC)。

properties.migrationWindowStartTimeInUtc

string (date-time)

迁移时段的开始时间 (UTC)。

properties.overwriteDbsInTarget

OverwriteDbsInTargetEnum

指示目标服务器上的数据库在已存在时是否可以被覆盖。 如果设置为 'False',则当迁移工作流检测到目标服务器上已存在数据库时,它将等待确认。

properties.secretParameters

MigrationSecretParameters

迁移机密参数。

properties.setupLogicalReplicationOnSourceDbIfNeeded

LogicalReplicationOnSourceDbEnum

指示是否根据需要设置 LogicalReplicationOnSourceDb。

properties.sourceDbServerFullyQualifiedDomainName

string

源服务器的完全限定域名 (FQDN) 或 IP 地址。 此属性是可选的。 如果提供,迁移服务将始终使用它来连接到源服务器。

properties.sourceDbServerResourceId

string

当 'sourceType' 为 'PostgreSQLSingleServer' 时,源数据库服务器资源的标识符。 对于其他源类型,必须将其设置为 ipaddress:port@username 或 hostname:port@username。

properties.sourceType

SourceType

用于迁移的源服务器类型: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 或 Supabase_PostgreSQL

properties.sslMode

SslMode

迁移使用的 SSL 模式。 “PostgreSQLSingleServer”的默认 SSL 模式为“VerifyFull”。 其他源类型的默认 SSL 模式为 'Prefer'。

properties.startDataMigration

StartDataMigrationEnum

指示是否必须立即开始数据迁移。

properties.targetDbServerFullyQualifiedDomainName

string

目标服务器的完全限定域名 (FQDN) 或 IP 地址。 此属性是可选的。 提供后,迁移服务将始终使用它来连接到目标服务器。

properties.triggerCutover

TriggerCutoverEnum

指示是否必须为整个迁移触发直接转换。

tags

object

资源标记。

响应

名称 类型 说明
200 OK

MigrationResource

成功设置或更新服务器的 Migration。

201 Created

MigrationResource

已创建

Other Status Codes

ErrorResponse

描述作失败的原因的错误响应。

安全性

azure_auth

Microsoft Entra OAuth2 流

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Create a migration for validating only.
Create a migration specifying user names.
Create a migration with other source type for validating and migrating.
Create a migration with private endpoint.
Create a migration with roles.
Create a migration.

Create a migration for validating only.

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01

{
  "properties": {
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "secretParameters": {
      "adminCredentials": {
        "sourceServerPassword": "examplesourcepassword",
        "targetServerPassword": "exampletargetpassword"
      }
    },
    "migrationMode": "Offline",
    "overwriteDbsInTarget": "True",
    "migrationOption": "Validate"
  },
  "location": "westus"
}

示例响应

{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "ValidationInProgress"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False",
    "migrationOption": "Validate"
  },
  "tags": {
    "key1624": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "ValidationInProgress"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}

Create a migration specifying user names.

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01

{
  "properties": {
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "secretParameters": {
      "adminCredentials": {
        "sourceServerPassword": "examplesourcepassword",
        "targetServerPassword": "exampletargetpassword"
      },
      "sourceServerUsername": "newadmin@examplesource",
      "targetServerUsername": "targetadmin"
    },
    "migrationMode": "Offline"
  },
  "location": "westus"
}

示例响应

{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "migrationMode": "Offline",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "PerformingPreRequisiteSteps"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "False",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False"
  },
  "tags": {
    "key1624": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "migrationMode": "Offline",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "PerformingPreRequisiteSteps"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "False",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}

Create a migration with other source type for validating and migrating.

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01

{
  "properties": {
    "sourceDbServerResourceId": "examplesource:5432@exampleuser",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "secretParameters": {
      "adminCredentials": {
        "sourceServerPassword": "examplesourcepassword",
        "targetServerPassword": "exampletargetpassword"
      }
    },
    "migrationMode": "Offline",
    "overwriteDbsInTarget": "True",
    "migrationOption": "ValidateAndMigrate",
    "sslMode": "Prefer",
    "sourceType": "OnPremises"
  },
  "location": "westus"
}

示例响应

{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "ValidationInProgress"
      }
    },
    "sourceDbServerResourceId": "examplesource:5432@exampleuser",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False",
    "migrationOption": "ValidateAndMigrate",
    "sslMode": "Prefer",
    "sourceType": "OnPremises"
  },
  "tags": {
    "key1624": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "ValidationInProgress"
      }
    },
    "sourceDbServerResourceId": "examplesource:5432@exampleuser",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False",
    "migrationOption": "ValidateAndMigrate",
    "sslMode": "Prefer",
    "sourceType": "OnPremises"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}

Create a migration with private endpoint.

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01

{
  "properties": {
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "migrationInstanceResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/examplesourcemigration",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "secretParameters": {
      "adminCredentials": {
        "sourceServerPassword": "examplesourcepassword",
        "targetServerPassword": "exampletargetpassword"
      }
    },
    "migrationMode": "Offline",
    "overwriteDbsInTarget": "True"
  },
  "location": "westus"
}

示例响应

{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "PerformingPreRequisiteSteps"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False",
    "migrationInstanceResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/examplesourcemigration"
  },
  "tags": {
    "key1624": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "PerformingPreRequisiteSteps"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False",
    "migrationInstanceResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/examplesourcemigration"
  },
  "tags": {
    "key1624": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}

Create a migration with roles.

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01

{
  "properties": {
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "secretParameters": {
      "adminCredentials": {
        "sourceServerPassword": "examplesourcepassword",
        "targetServerPassword": "exampletargetpassword"
      }
    },
    "migrationMode": "Offline",
    "migrateRoles": "True",
    "overwriteDbsInTarget": "True"
  },
  "location": "westus"
}

示例响应

{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "PerformingPreRequisiteSteps"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "True"
  },
  "tags": {
    "key1624": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "PerformingPreRequisiteSteps"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "True"
  },
  "tags": {
    "key1624": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}

Create a migration.

示例请求

PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration?api-version=2024-08-01

{
  "properties": {
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "secretParameters": {
      "adminCredentials": {
        "sourceServerPassword": "examplesourcepassword",
        "targetServerPassword": "exampletargetpassword"
      }
    },
    "migrationMode": "Offline",
    "overwriteDbsInTarget": "True"
  },
  "location": "westus"
}

示例响应

{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "PerformingPreRequisiteSteps"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False"
  },
  "tags": {
    "key1624": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
{
  "properties": {
    "migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
    "currentStatus": {
      "state": "InProgress",
      "error": "",
      "currentSubStateDetails": {
        "currentSubState": "PerformingPreRequisiteSteps"
      }
    },
    "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource",
    "targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
    "dbsToMigrate": [
      "exampledatabase1",
      "exampledatabase2",
      "exampledatabase3",
      "exampledatabase4"
    ],
    "setupLogicalReplicationOnSourceDbIfNeeded": "False",
    "overwriteDbsInTarget": "True",
    "migrationWindowStartTimeInUtc": "2024-08-01T18:30:22.123456Z",
    "startDataMigration": "False",
    "triggerCutover": "False",
    "migrateRoles": "False"
  },
  "tags": {
    "key1624": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "location": "westus",
  "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
  "name": "examplemigration",
  "type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}

定义

名称 说明
AdminCredentials

源服务器和目标服务器的管理员用户的凭据。

CancelEnum

指示是否必须为整个迁移触发 cancel。

createdByType

创建资源的标识的类型。

DbLevelValidationStatus

数据库的验证状态摘要。

DbMigrationStatus

数据库的迁移状态。

DbServerMetadata

数据库服务器元数据。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

LogicalReplicationOnSourceDbEnum

指示是否根据需要设置 LogicalReplicationOnSourceDb。

MigrateRolesEnum

指示是否必须迁移角色和权限。

MigrationDbState

数据库的迁移状态。

MigrationMode

用于执行迁移的模式:联机或脱机。

MigrationOption

迁移支持的选项

MigrationResource

迁移。

MigrationSecretParameters

迁移机密参数。

MigrationState

迁移状态。

MigrationStatus

迁移状态。

MigrationSubState

迁移的子状态。

MigrationSubStateDetails

迁移子状态的详细信息。

OverwriteDbsInTargetEnum

指示目标服务器上的数据库在已存在时是否可以被覆盖。 如果设置为 'False',则当迁移工作流检测到目标服务器上已存在数据库时,它将等待确认。

ServerSku

灵活服务器的计算信息。

SkuTier

如果服务具有多个层,但在 PUT 上不需要,则需要资源提供程序实现此字段。

SourceType

用于迁移的源服务器类型: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 或 Supabase_PostgreSQL

SslMode

迁移使用的 SSL 模式。 “PostgreSQLSingleServer”的默认 SSL 模式为“VerifyFull”。 其他源类型的默认 SSL 模式为 'Prefer'。

StartDataMigrationEnum

指示是否必须立即开始数据迁移。

systemData

与创建和上次修改资源相关的元数据。

TriggerCutoverEnum

指示是否必须为整个迁移触发直接转换。

ValidationDetails

迁移验证的详细信息。

ValidationMessage

验证消息对象。

ValidationState

迁移的验证状态。

ValidationSummaryItem

验证摘要对象。

AdminCredentials

源服务器和目标服务器的管理员用户的凭据。

名称 类型 说明
sourceServerPassword

string

源服务器用户的密码。

targetServerPassword

string

目标服务器用户的密码。

CancelEnum

指示是否必须为整个迁移触发 cancel。

说明
False
True

createdByType

创建资源的标识的类型。

说明
Application
Key
ManagedIdentity
User

DbLevelValidationStatus

数据库的验证状态摘要。

名称 类型 说明
databaseName

string

数据库的名称。

endedOn

string (date-time)

数据库级别验证的结束时间。

startedOn

string (date-time)

数据库级别验证的开始时间。

summary

ValidationSummaryItem[]

数据库级别验证摘要。

DbMigrationStatus

数据库的迁移状态。

名称 类型 说明
appliedChanges

integer (int32)

Change Data Capture applied changes 计数器。

cdcDeleteCounter

integer (int32)

更改 Data Capture 删除计数器。

cdcInsertCounter

integer (int32)

更改 Data Capture 插入计数器。

cdcUpdateCounter

integer (int32)

更改 Data Capture 更新计数器。

databaseName

string

数据库的名称。

endedOn

string (date-time)

迁移状态的结束时间。

fullLoadCompletedTables

integer (int32)

数据库迁移期间加载的表数。

fullLoadErroredTables

integer (int32)

在数据库迁移过程中遇到错误的表数。

fullLoadLoadingTables

integer (int32)

数据库迁移期间加载的表数。

fullLoadQueuedTables

integer (int32)

排队等待数据库迁移的表数。

incomingChanges

integer (int32)

Change Data Capture 传入更改计数器。

latency

integer (int32)

联机阶段源和目标之间的滞后(以秒为单位)。

message

string

迁移状态的错误消息(如果有)。

migrationOperation

string

数据库的迁移作。

migrationState

MigrationDbState

数据库的迁移状态。

startedOn

string (date-time)

迁移状态的开始时间。

DbServerMetadata

数据库服务器元数据。

名称 类型 说明
location

string

数据库服务器的位置。

sku

ServerSku

数据库服务器的计算层和大小。 对于 Azure Database for PostgreSQL 单一服务器,此对象为空。

storageMb

integer (int32)

数据库服务器的存储大小(以 MB 为单位)。

version

string

PostgreSQL 数据库引擎的主要版本。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

LogicalReplicationOnSourceDbEnum

指示是否根据需要设置 LogicalReplicationOnSourceDb。

说明
False
True

MigrateRolesEnum

指示是否必须迁移角色和权限。

说明
False
True

MigrationDbState

数据库的迁移状态。

说明
Canceled
Canceling
Failed
InProgress
Succeeded
WaitingForCutoverTrigger

MigrationMode

用于执行迁移的模式:联机或脱机。

说明
Offline
Online

MigrationOption

迁移支持的选项

说明
Migrate
Validate
ValidateAndMigrate

MigrationResource

迁移。

名称 类型 说明
id

string (arm-id)

资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

location

string

资源所在的地理位置

name

string

资源的名称

properties.cancel

CancelEnum

指示是否必须为整个迁移触发 cancel。

properties.currentStatus

MigrationStatus

迁移的当前状态。

properties.dbsToCancelMigrationOn

string[]

如果要为特定数据库触发 cancel,请将 'triggerCutover' 设置为 'True' 并设置此数组中特定数据库的名称。

properties.dbsToMigrate

string[]

要迁移的数据库的名称。

properties.dbsToTriggerCutoverOn

string[]

如果要触发特定数据库的直接转换,请将 'triggerCutover' 设置为 'True' 并设置此数组中特定数据库的名称。

properties.migrateRoles

MigrateRolesEnum

指示是否必须迁移角色和权限。

properties.migrationId

string

迁移的标识符。

properties.migrationInstanceResourceId

string (arm-id)

私有终端节点迁移实例的标识符。

properties.migrationMode

MigrationMode

用于执行迁移的模式:联机或脱机。

properties.migrationOption

MigrationOption

迁移的支持选项。

properties.migrationWindowEndTimeInUtc

string (date-time)

迁移时段的结束时间 (UTC)。

properties.migrationWindowStartTimeInUtc

string (date-time)

迁移时段的开始时间 (UTC)。

properties.overwriteDbsInTarget

OverwriteDbsInTargetEnum

指示目标服务器上的数据库在已存在时是否可以被覆盖。 如果设置为 'False',则当迁移工作流检测到目标服务器上已存在数据库时,它将等待确认。

properties.secretParameters

MigrationSecretParameters

迁移机密参数。

properties.setupLogicalReplicationOnSourceDbIfNeeded

LogicalReplicationOnSourceDbEnum

指示是否根据需要设置 LogicalReplicationOnSourceDb。

properties.sourceDbServerFullyQualifiedDomainName

string

源服务器的完全限定域名 (FQDN) 或 IP 地址。 此属性是可选的。 如果提供,迁移服务将始终使用它来连接到源服务器。

properties.sourceDbServerMetadata

DbServerMetadata

源数据库服务器的元数据。

properties.sourceDbServerResourceId

string

当 'sourceType' 为 'PostgreSQLSingleServer' 时,源数据库服务器资源的标识符。 对于其他源类型,必须将其设置为 ipaddress:port@username 或 hostname:port@username。

properties.sourceType

SourceType

用于迁移的源服务器类型: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 或 Supabase_PostgreSQL

properties.sslMode

SslMode

迁移使用的 SSL 模式。 “PostgreSQLSingleServer”的默认 SSL 模式为“VerifyFull”。 其他源类型的默认 SSL 模式为 'Prefer'。

properties.startDataMigration

StartDataMigrationEnum

指示是否必须立即开始数据迁移。

properties.targetDbServerFullyQualifiedDomainName

string

目标服务器的完全限定域名 (FQDN) 或 IP 地址。 此属性是可选的。 提供后,迁移服务将始终使用它来连接到目标服务器。

properties.targetDbServerMetadata

DbServerMetadata

目标数据库服务器的元数据。

properties.targetDbServerResourceId

string

目标数据库服务器资源的标识符。

properties.triggerCutover

TriggerCutoverEnum

指示是否必须为整个迁移触发直接转换。

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

tags

object

资源标记。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

MigrationSecretParameters

迁移机密参数。

名称 类型 说明
adminCredentials

AdminCredentials

源服务器和目标服务器的管理员用户的凭据。

sourceServerUsername

string

获取或设置源服务器的用户名称。 此用户不需要是管理员。

targetServerUsername

string

获取或设置目标服务器的用户名称。 此用户不需要是管理员。

MigrationState

迁移状态。

说明
Canceled
CleaningUp
Failed
InProgress
Succeeded
ValidationFailed
WaitingForUserAction

MigrationStatus

迁移状态。

名称 类型 说明
currentSubStateDetails

MigrationSubStateDetails

当前迁移子状态详细信息。

error

string

迁移状态的错误消息(如果有)。

state

MigrationState

迁移状态。

MigrationSubState

迁移的子状态。

说明
CancelingRequestedDBMigrations
Completed
CompletingMigration
MigratingData
PerformingPreRequisiteSteps
ValidationInProgress
WaitingForCutoverTrigger
WaitingForDBsToMigrateSpecification
WaitingForDataMigrationScheduling
WaitingForDataMigrationWindow
WaitingForLogicalReplicationSetupRequestOnSourceDB
WaitingForTargetDBOverwriteConfirmation

MigrationSubStateDetails

迁移子状态的详细信息。

名称 类型 说明
currentSubState

MigrationSubState

迁移的子状态。

dbDetails

<string,  DbMigrationStatus>

validationDetails

ValidationDetails

迁移验证的详细信息。

OverwriteDbsInTargetEnum

指示目标服务器上的数据库在已存在时是否可以被覆盖。 如果设置为 'False',则当迁移工作流检测到目标服务器上已存在数据库时,它将等待确认。

说明
False
True

ServerSku

灵活服务器的计算信息。

名称 类型 说明
name

string

数据库服务器的计算层和大小。 对于 Azure Database for PostgreSQL 单一服务器,此对象为空。

tier

SkuTier

分配给灵活服务器的计算层。

SkuTier

如果服务具有多个层,但在 PUT 上不需要,则需要资源提供程序实现此字段。

说明
Basic
Free
Premium
Standard

SourceType

用于迁移的源服务器类型: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 或 Supabase_PostgreSQL

说明
AWS
AWS_AURORA
AWS_EC2
AWS_RDS
AzureVM
EDB
GCP
GCP_AlloyDB
GCP_CloudSQL
GCP_Compute
OnPremises
PostgreSQLSingleServer

SslMode

迁移使用的 SSL 模式。 “PostgreSQLSingleServer”的默认 SSL 模式为“VerifyFull”。 其他源类型的默认 SSL 模式为 'Prefer'。

说明
Prefer
Require
VerifyCA
VerifyFull

StartDataMigrationEnum

指示是否必须立即开始数据迁移。

说明
False
True

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

TriggerCutoverEnum

指示是否必须为整个迁移触发直接转换。

说明
False
True

ValidationDetails

迁移验证的详细信息。

名称 类型 说明
dbLevelValidationDetails

DbLevelValidationStatus[]

服务器级别验证的详细信息。

serverLevelValidationDetails

ValidationSummaryItem[]

服务器级别验证的详细信息。

status

ValidationState

迁移的验证状态。

validationEndTimeInUtc

string (date-time)

验证的结束时间 (UTC)。

validationStartTimeInUtc

string (date-time)

验证的开始时间 (UTC)。

ValidationMessage

验证消息对象。

名称 类型 说明
message

string

验证消息字符串。

state

ValidationState

验证消息的严重性。

ValidationState

迁移的验证状态。

说明
Failed
Succeeded
Warning

ValidationSummaryItem

验证摘要对象。

名称 类型 说明
messages

ValidationMessage[]

验证消息。

state

ValidationState

迁移的验证状态。

type

string

验证类型。