az postgres flexible-server migration

管理 PostgreSQL 彈性伺服器的移轉工作流程。

命令

名稱 Description 類型 狀態
az postgres flexible-server migration check-name-availability

檢查是否可使用提供的移轉名稱。

核心 GA
az postgres flexible-server migration create

為彈性伺服器建立新的移轉工作流程。

核心 GA
az postgres flexible-server migration list

列出彈性伺服器的移轉。

核心 GA
az postgres flexible-server migration show

取得特定移轉的詳細數據。

核心 GA
az postgres flexible-server migration update

更新特定的移轉。

核心 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

必要參數

--migration-name

移轉的名稱。

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

移轉目標伺服器名稱。

--resource-group -g

移轉目標伺服器的資源組名。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

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]

範例

在參數所識別的目標伺服器上啟動移轉工作流程。 移轉的組態應該在 migrationConfig.json 檔案中指定。 使用離線移轉 --migration-mode 進行離線移轉。 範例 migrationConfig.json 看起來會像這樣:{ “properties”: { “SourceDBServerResourceId”: “/subscriptions/xxxxxxxx-xxxx-resourceGroups/test-single-rg/providers/Microsoft.DBforPostgreSQL/servers/pg-single-1”, “SecretParameters”: { “管理員 Credentials”: { “SourceServerPassword”: “password”, “TargetServerPassword”: “password” }, “SourceServerUserName”: “testuser@pg-single-1”, “TargetServerUserName”: “fspguser” } “dBsToMigrate“: [ ”postgres“ ], ”OverwriteDbsInTarget“: ”true“, ”SourceType“: ”PostgreSQLSingleServer“, ”SslMode“: ”VerifyFull“ } } }

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 for Online(搭配 CDC) 移轉,並搭配此範例 migrationConfig.json。 使用 migration-option Validate for validate only request { “properties”: { “SourceDBServerResourceId”: “/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxx-resourceGroups/test-single-rg/providers/Microsoft.DBforPostgreSQL/servers/pg-single-1”, “SecretParameters”: { “管理員 Credentials”: { “SourceServerPassword”: “password”, “TargetServerPassword”: “password” }, “SourceServerUserName”: “testuser@pg-single-1”, “TargetServerUserName”: “fspguser” } ”dBsToMigrate“: [ ”postgres“ ], ”OverwriteDbsInTarget“: ”true“ } } SourceType 和 sslmode 參數分別設定為 'PostgreSQL 單一伺服器' 和 'VerifyFull' 如果來源資源標識符遵循 /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx/resourceGroups/{rg-name}/providers/Microsoft.DBforPostgreSQL/servers/{single-server-name} 伺服器模式。 系統會忽略這些參數在 CLI/SDK 中傳遞的任何值。

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 request。

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

默認移轉選項為 ValidateAndMigrate。 SoureType 和 SslMode 必須傳遞,才能移轉 PostgreSQLSingleServer 以外的移轉。 json 檔案中的移轉參數看起來應該如下所示: { “properties”: { “SourceDBServerResourceId”: “20.66.25.58:5432@postgres”, “SecretParameters”: { “管理員 Credentials”: { “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"

必要參數

--name -n

移轉目標伺服器名稱。

--properties -b

要求屬性。 使用 double 或 no quotes 傳入 json filepath 作為自變數。

--resource-group -g

移轉目標伺服器的資源組名。

選擇性參數

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--migration-mode

離線或線上(使用 CDC) 移轉。

接受的值: offline, online
預設值: offline
--migration-name

移轉的名稱。

--migration-option

支援的移轉選項。 預設值為 ValidateAndMigrate。

接受的值: Migrate, Validate, ValidateAndMigrate
預設值: ValidateAndMigrate
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

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

必要參數

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--resource-group -g

移轉目標伺服器的資源組名。

選擇性參數

--filter

指出傳回所有移轉或只傳回作用中移轉。 有效值為:Active 和 All。

接受的值: Active, All
預設值: Active
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

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

必要參數

--migration-name

移轉的名稱。

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

移轉目標伺服器名稱。

--resource-group -g

移轉目標伺服器的資源組名。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

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

必要參數

--migration-name

移轉的名稱。

選擇性參數

--cancel

取消所有資料庫的數據遷移。

--cutover

移轉中所有資料庫的數據遷移。 完成之後,所有資料庫的後續更新將不會移轉至目標。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--name -n

移轉目標伺服器名稱。

--resource-group -g

移轉目標伺服器的資源組名。

--setup-replication

允許移轉工作流程在來源上設定邏輯複寫。 請注意,此命令將會重新啟動來源伺服器。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。