az postgres flexible-server migration
管理 PostgreSQL 灵活服务器的迁移工作流。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az postgres flexible-server migration check-name-availability |
检查是否可以使用提供的迁移名称。 |
Core | GA |
az postgres flexible-server migration create |
为灵活服务器创建新的迁移工作流。 |
Core | GA |
az postgres flexible-server migration list |
列出灵活服务器的迁移。 |
Core | GA |
az postgres flexible-server migration show |
获取特定迁移的详细信息。 |
Core | GA |
az postgres flexible-server migration update |
更新特定迁移。 |
Core | GA |
az postgres flexible-server migration check-name-availability
检查是否可以使用提供的迁移名称。
az postgres flexible-server migration check-name-availability --migration-name
[--ids]
[--name]
[--resource-group]
[--subscription]
示例
检查提供的迁移名称是否可用于迁移工作流。
az postgres flexible-server migration check-name-availability --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
必需参数
迁移的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
迁移目标服务器名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
迁移目标服务器的资源组名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server migration create
为灵活服务器创建新的迁移工作流。
az postgres flexible-server migration create --name
--properties
--resource-group
[--location]
[--migration-mode {offline, online}]
[--migration-name]
[--migration-option {Migrate, Validate, ValidateAndMigrate}]
[--tags]
示例
在由参数标识的目标服务器上启动迁移工作流。 应在属性文件中指定迁移的配置。 不同的属性定义为:sourceDbServerResourceId:源服务器详细信息。 adminCredentials:此参数列出源服务器和目标 PostgreSQL 灵活服务器的管理员用户的密码。 targetServerUserName:默认值是在创建 PostgreSQL 目标灵活服务器期间创建的管理员用户,提供的密码用于对此用户进行身份验证。 dbsToMigrate:指定要迁移到灵活服务器的数据库的列表。 overwriteDBsInTarget:如果目标服务器恰好具有与尝试迁移的数据库同名的现有数据库,则迁移服务会自动覆盖数据库。 PostgreSQLSingleServer 的示例 migrationConfig.json 如下所示。 { “properties”: { “sourceDBServerResourceId”: “/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx/resourceGroups/test-single-rg/providers/Microsoft.DBforPostgreSQL/servers/pg-single-1”, “secretParameters”: { “adminCredentials”: { “sourceServerPassword”: “password”, “targetServerPassword”: “password” }, “sourceServerUserName”: “testuser@pg-single-1”, “targetServerUserName”: “fspguser” }, “dBsToMigrate”: [ “postgres” ], “overwriteDbsInTarget”: “true” } } }
az postgres flexible-server migration create --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --properties "migrationConfig.json"
在由参数标识的目标服务器上启动迁移工作流。 迁移的配置应在 migrationConfig.json 文件中指定。 将 --migration-mode 脱机用于脱机迁移。
az postgres flexible-server migration create --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --properties "migrationConfig.json" --migration-mode offline
在由参数标识的目标服务器上启动迁移工作流。 迁移的配置应在 migrationConfig.json 文件中指定。 使用 --migration-mode online for Online(使用 CDC)迁移。 使用迁移选项“验证”仅验证请求。
az postgres flexible-server migration create --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --properties "migrationConfig.json" --migration-mode online --migration-option Validate
在由参数标识的目标服务器上启动迁移工作流。 迁移的配置应在 migrationConfig.json 文件中指定。 使用 --migration-option Migrate for Migrate only 请求。
az postgres flexible-server migration create --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --properties "migrationConfig.json" --migration-option Migrate
若要开始迁移 PostgreSQLSingleServer 以外的其他项,必须在属性文件中指定 soureType 和 sslMode。 这些属性定义为:sourceType:值可以是 - OnPremises、AWS_AURORA、AWS_RDS、AzureVM、PostgreSQLSingleServer sslMode:用于迁移的 SSL 模式。 对于 PostgreSQLSingleServer,SSL 模式为 VerifyFull,对于其他源类型则为 Prefer/Require。 如下所示的示例 migrationConfig.json。 { “properties”: { “sourceDBServerResourceId”: “<<hostname or IP address>>:<<port>>@<<username>>”, “secretParameters”: { “adminCredentials”: { “sourceServerPassword”: “password”, “targetServerPassword”: “password” }, “sourceServerUserName”: “postgres”, “targetServerUserName”: “fspguser” }, “dBsToMigrate”: [ “ticketdb”,“timedb”,“inventorydb” ], “overwriteDbsInTarget”: “true”, “sourceType”: “OnPremises”, “sslMode”: “Prefer” } }
az postgres flexible-server migration create --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --properties "migrationConfig.json"
通过在属性文件中指定 migrationRuntimeResourceId,在目标服务器上启动启用了专用终结点的迁移工作流。 此属性定义为:migrationRuntimeResourceId:负责在源服务器和目标服务器之间迁移数据的迁移运行时服务器的资源 ID。 如下所示的示例 migrationConfig.json。 { “properties”: { “sourceDBServerResourceId”: “/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxx/resourceGroups/test-single-rg/providers/Microsoft.DBforPostgreSQL/servers/pg-single-1”, “migrationRuntimeResourceId”: “/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourceGroups/testGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testsourcemigration”, “secretParameters”: { “adminCredentials”: { “sourceServerPassword”: “password”,targetServerPassword“: ”password“ }, ”sourceServerUserName“: ”testuser@pg-single-1“, ”targetServerUserName“: ”fspguser“ }, ”dBsToMigrate“: [ ”postgres“ ], ”overwriteDbsInTarget“: ”true“ } } }
az postgres flexible-server migration create --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --properties "migrationConfig.json"
必需参数
迁移目标服务器名称。
请求属性。 使用双引号或无引号将 json filepath 作为参数传入。
迁移目标服务器的资源组名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Location.
az account list-locations
中的值。 可以使用 az configure --defaults location=<location>
配置默认位置。
脱机或联机(使用 CDC)迁移。
属性 | 值 |
---|---|
默认值: | offline |
接受的值: | offline, online |
迁移的名称。
支持的迁移选项。 默认值为 ValidateAndMigrate。
属性 | 值 |
---|---|
默认值: | ValidateAndMigrate |
接受的值: | Migrate, Validate, ValidateAndMigrate |
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server migration list
列出灵活服务器的迁移。
az postgres flexible-server migration list --name
--resource-group
[--filter {Active, All}]
示例
列出目标灵活服务器的当前活动迁移。
az postgres flexible-server migration list --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --filter Active
列出目标灵活服务器的所有(活动/已完成)迁移。
az postgres flexible-server migration list --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --filter All
必需参数
服务器的名称。 名称只能包含小写字母、数字和连字符 (-)。 最少 3 个字符,最多 63 个字符。
迁移目标服务器的资源组名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指示返回所有迁移还是仅返回活动迁移。 有效值为:Active 和 All。
属性 | 值 |
---|---|
默认值: | Active |
接受的值: | Active, All |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server migration show
获取特定迁移的详细信息。
az postgres flexible-server migration show --migration-name
[--ids]
[--name]
[--resource-group]
[--subscription]
示例
获取目标灵活服务器的特定迁移的详细信息。
az postgres flexible-server migration show --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration
必需参数
迁移的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
迁移目标服务器名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
迁移目标服务器的资源组名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az postgres flexible-server migration update
更新特定迁移。
az postgres flexible-server migration update --migration-name
[--cancel]
[--cutover]
[--ids]
[--name]
[--resource-group]
[--setup-replication]
[--subscription]
示例
允许迁移工作流在源上设置逻辑复制。 请注意,此命令将重启源服务器。
az postgres flexible-server migration update --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --setup-replication
剪切迁移中涉及的所有数据库的数据迁移。 完成此作后,不会将迁移中的所有数据库的后续更新迁移到目标。 只能为 migration_mode=Online 触发直接转换迁移。
az postgres flexible-server migration update --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --cutover
取消迁移中涉及的所有数据库的数据迁移。 只能取消“InProgress”迁移
az postgres flexible-server migration update --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --cancel
必需参数
迁移的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
取消所有数据库的数据迁移。
剪切迁移中所有数据库的数据迁移。 完成此作后,不会将所有数据库的后续更新迁移到目标。
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
迁移目标服务器名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
迁移目标服务器的资源组名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
允许迁移工作流在源上设置逻辑复制。 请注意,此命令将重启源服务器。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |