az postgres flexible-server migration
Manage migration workflows for PostgreSQL Flexible Servers.
Commands
Name | Description | Type | Status |
---|---|---|---|
az postgres flexible-server migration check-name-availability |
Checks if the provided migration-name can be used. |
Core | GA |
az postgres flexible-server migration create |
Create a new migration workflow for a flexible server. |
Core | GA |
az postgres flexible-server migration list |
List the migrations of a flexible server. |
Core | GA |
az postgres flexible-server migration show |
Get the details of a specific migration. |
Core | GA |
az postgres flexible-server migration update |
Update a specific migration. |
Core | GA |
az postgres flexible-server migration check-name-availability
Checks if the provided migration-name can be used.
az postgres flexible-server migration check-name-availability --migration-name
[--ids]
[--name]
[--resource-group]
[--subscription]
Examples
Check if the migration-name provided is available for your migration workflow.
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
Required Parameters
Name of the migration.
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Migration target server name.
Resource Group Name of the migration target server.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az postgres flexible-server migration create
Create a new migration workflow for a flexible server.
az postgres flexible-server migration create --name
--properties
--resource-group
[--location]
[--migration-mode {offline, online}]
[--migration-name]
[--migration-option {Migrate, Validate, ValidateAndMigrate}]
[--tags]
Examples
Start a migration workflow on the target server identified by the parameters. The configurations of the migration should be specified in the migrationConfig.json file. Use --migration-mode offline for Offline migration. Sample migrationConfig.json will look like this: { "properties": { "SourceDBServerResourceId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/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", "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
Start a migration workflow on the target server identified by the parameters. The configurations of the migration should be specified in the migrationConfig.json file. Use --migration-mode online for Online(with CDC) migration, with this sample migrationConfig.json. Use migration-option Validate for validate only request { "properties": { "SourceDBServerResourceId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/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" } } The sourceType and sslmode parameters are automatically set to 'PostgreSQL Single server' and 'VerifyFull' respectively, if the source resource id follows the /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/{rg-name}/providers/Microsoft.DBforPostgreSQL/servers/{single-server-name} server pattern. Any values passed in the CLI/SDK for these parameters will be ignored.
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
Start a migration workflow on the target server identified by the parameters. The configurations of the migration should be specified in the migrationConfig.json file. Use --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
Default migration-option is ValidateAndMigrate. SoureType and SslMode must be passed for migrations other than PostgreSQLSingleServer. Migration parameters in json file should look like below: { "properties": { "SourceDBServerResourceId": "20.66.25.58:5432@postgres", "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"
Required Parameters
Migration target server name.
Request properties. Use double or no quotes to pass in json filepath as argument.
Resource Group Name of the migration target server.
Optional Parameters
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
Either offline or online(with CDC) migration.
Name of the migration.
Supported Migration Option. Default is ValidateAndMigrate.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az postgres flexible-server migration list
List the migrations of a flexible server.
az postgres flexible-server migration list --name
--resource-group
[--filter {Active, All}]
Examples
List the currently active migrations of a target flexible server.
az postgres flexible-server migration list --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --filter Active
List all (Active/Completed) migrations of a target flexible server.
az postgres flexible-server migration list --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --filter All
Required Parameters
Name of the server. The name can contain only lowercase letters, numbers, and the hyphen (-) character. Minimum 3 characters and maximum 63 characters.
Resource Group Name of the migration target server.
Optional Parameters
Indicate whether all the migrations or just the Active migrations are returned. Valid values are: Active and All.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az postgres flexible-server migration show
Get the details of a specific migration.
az postgres flexible-server migration show --migration-name
[--ids]
[--name]
[--resource-group]
[--subscription]
Examples
Get the details of a specific migration of a target flexible server.
az postgres flexible-server migration show --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration
Required Parameters
Name of the migration.
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Migration target server name.
Resource Group Name of the migration target server.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az postgres flexible-server migration update
Update a specific migration.
az postgres flexible-server migration update --migration-name
[--cancel]
[--cutover]
[--ids]
[--name]
[--resource-group]
[--setup-replication]
[--subscription]
Examples
Allow the migration workflow to setup logical replication on the source. Note that this command will restart the source server.
az postgres flexible-server migration update --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --setup-replication
Cut-over the data migration for all the databases involved in the migration. After this is complete, subsequent updates to all databases in the migration will not be migrated to the target. Cutover migration can only be triggered for migration_mode=Online.
az postgres flexible-server migration update --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --cutover
Cancels the data migration for all the databases involved in the migration. Only 'InProgress' migration can be cancelled
az postgres flexible-server migration update --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group testGroup --name testserver --migration-name testmigration --cancel
Required Parameters
Name of the migration.
Optional Parameters
Cancel the data migration for all the databases.
Cut-over the data migration for all the databases in the migration. After this is complete, subsequent updates to all databases will not be migrated to the target.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Migration target server name.
Resource Group Name of the migration target server.
Allow the migration workflow to setup logical replication on the source. Note that this command will restart the source server.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for