Gets information about a migration.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/migrations/{migrationName}?api-version=2025-08-01
URI Parameters
| Name |
In |
Required |
Type |
Description |
|
migrationName
|
path |
True
|
string
pattern: ^[a-z][a-z0-9]*$
|
Name of migration.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
The name of the resource group. The name is case insensitive.
|
|
serverName
|
path |
True
|
string
minLength: 3 maxLength: 63 pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*
|
The name of the server.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
The ID of the target subscription. The value must be an UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
The API version to use for this operation.
|
Responses
| Name |
Type |
Description |
|
200 OK
|
Migration
|
OK.
|
|
Other Status Codes
|
ErrorResponse
|
Error response describing why the operation failed.
|
Security
azure_auth
Microsoft Entra OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name |
Description |
|
user_impersonation
|
impersonate your user account
|
Examples
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/migrations/examplemigration?api-version=2025-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* MigrationsGetMigrationWithSuccessfulValidationAndMigration.json
*/
/**
* Sample code: Get information about a migration with successful validation and successful migration.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void getInformationAboutAMigrationWithSuccessfulValidationAndSuccessfulMigration(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("exampleresourcegroup", "exampleserver", "examplemigration",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get_migration_with_successful_validation_and_migration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
migration_name="examplemigration",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationAndMigration.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e96c24570a484cff13d153fb472f812878866a39/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationAndMigration.json
func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithSuccessfulValidationAndSuccessfulMigration() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Migration = armpostgresqlflexibleservers.Migration{
// Name: to.Ptr("examplemigration"),
// Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"),
// Location: to.Ptr("eastus"),
// Properties: &armpostgresqlflexibleservers.MigrationProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateCompleted),
// DbDetails: map[string]*armpostgresqlflexibleservers.DatabaseMigrationState{
// "exampledatabase": &armpostgresqlflexibleservers.DatabaseMigrationState{
// AppliedChanges: to.Ptr[int32](0),
// CdcDeleteCounter: to.Ptr[int32](0),
// CdcInsertCounter: to.Ptr[int32](0),
// CdcUpdateCounter: to.Ptr[int32](0),
// DatabaseName: to.Ptr("exampledatabase"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// FullLoadCompletedTables: to.Ptr[int32](10),
// FullLoadErroredTables: to.Ptr[int32](0),
// FullLoadLoadingTables: to.Ptr[int32](0),
// FullLoadQueuedTables: to.Ptr[int32](0),
// IncomingChanges: to.Ptr[int32](0),
// Latency: to.Ptr[int32](0),
// MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDatabaseStateSucceeded),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// },
// },
// ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{
// DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{
// {
// DatabaseName: to.Ptr("exampledatabase"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// }},
// ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("AuthenticationAndConnectivityValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("SourceVersionValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ServerParametersValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// },
// },
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded),
// },
// DbsToMigrate: []*string{
// to.Ptr("exampledatabase")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse),
// MigrationID: to.Ptr("f2354e72-2828-4a19-ad20-b4cd9e2673c1"),
// MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline),
// MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate),
// MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue),
// SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"),
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"),
// TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverTrue),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets information about a migration.
*
* @summary Gets information about a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationAndMigration.json
*/
async function getInformationAboutAMigrationWithSuccessfulValidationAndSuccessfulMigration() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const migrationName = "examplemigration";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.migrations.get(resourceGroupName, serverName, migrationName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "f2354e72-2828-4a19-ad20-b4cd9e2673c1",
"currentStatus": {
"state": "Succeeded",
"currentSubStateDetails": {
"currentSubState": "Completed",
"dbDetails": {
"exampledatabase": {
"databaseName": "exampledatabase",
"migrationState": "Succeeded",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"fullLoadErroredTables": 0,
"fullLoadQueuedTables": 0,
"fullLoadLoadingTables": 0,
"fullLoadCompletedTables": 10,
"cdcUpdateCounter": 0,
"cdcDeleteCounter": 0,
"cdcInsertCounter": 0,
"appliedChanges": 0,
"incomingChanges": 0,
"latency": 0
}
},
"validationDetails": {
"status": "Succeeded",
"validationStartTimeInUtc": "2025-06-01T18:30:22.123456Z",
"validationEndTimeInUtc": "2025-06-01T20:30:22.123456Z",
"serverLevelValidationDetails": [
{
"type": "AuthenticationAndConnectivityValidation",
"state": "Succeeded"
},
{
"type": "SourceVersionValidation",
"state": "Succeeded"
},
{
"type": "ServerParametersValidation",
"state": "Succeeded"
}
],
"dbLevelValidationDetails": [
{
"databaseName": "exampledatabase",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
}
]
}
}
},
"migrationMode": "Offline",
"migrationWindowEndTimeInUtc": "2025-06-01T20:30:22.123456Z",
"sourceDbServerResourceId": "20.228.214.65:5432@postgres",
"targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
"dbsToMigrate": [
"exampledatabase"
],
"setupLogicalReplicationOnSourceDbIfNeeded": "True",
"overwriteDbsInTarget": "True",
"migrationWindowStartTimeInUtc": "2025-06-01T18:30:22.123456Z",
"triggerCutover": "True",
"migrateRoles": "False",
"migrationOption": "ValidateAndMigrate"
},
"location": "eastus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/migrations/examplemigration?api-version=2025-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* MigrationsGetMigrationWithSuccessfulValidationButMigrationFailure.json
*/
/**
* Sample code: Get information about a migration with successful validation but failed migration.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void getInformationAboutAMigrationWithSuccessfulValidationButFailedMigration(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("exampleresourcegroup", "exampleserver", "examplemigration",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get_migration_with_successful_validation_but_migration_failure.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
migration_name="examplemigration",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationButMigrationFailure.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e96c24570a484cff13d153fb472f812878866a39/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationButMigrationFailure.json
func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithSuccessfulValidationButFailedMigration() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Migration = armpostgresqlflexibleservers.Migration{
// Name: to.Ptr("examplemigration"),
// Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"),
// Location: to.Ptr("eastus"),
// Properties: &armpostgresqlflexibleservers.MigrationProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateCompleted),
// DbDetails: map[string]*armpostgresqlflexibleservers.DatabaseMigrationState{
// "exampledatabase": &armpostgresqlflexibleservers.DatabaseMigrationState{
// AppliedChanges: to.Ptr[int32](0),
// CdcDeleteCounter: to.Ptr[int32](0),
// CdcInsertCounter: to.Ptr[int32](0),
// CdcUpdateCounter: to.Ptr[int32](0),
// DatabaseName: to.Ptr("exampledatabase"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// FullLoadCompletedTables: to.Ptr[int32](0),
// FullLoadErroredTables: to.Ptr[int32](0),
// FullLoadLoadingTables: to.Ptr[int32](0),
// FullLoadQueuedTables: to.Ptr[int32](0),
// IncomingChanges: to.Ptr[int32](0),
// Latency: to.Ptr[int32](0),
// Message: to.Ptr("Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration."),
// MigrationState: to.Ptr(armpostgresqlflexibleservers.MigrationDatabaseStateFailed),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// },
// },
// ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{
// DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{
// {
// DatabaseName: to.Ptr("address_standardizer"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// }},
// ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("AuthenticationAndConnectivityValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// },
// },
// Error: to.Ptr("exampledatabase: Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration."),
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateFailed),
// },
// DbsToMigrate: []*string{
// to.Ptr("exampledatabase")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse),
// MigrationID: to.Ptr("da52db29-cfeb-4670-a1ad-683edb14c621"),
// MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline),
// MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidateAndMigrate),
// MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue),
// SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{
// Location: to.Ptr("eastus"),
// SKU: &armpostgresqlflexibleservers.ServerSKU{
// },
// StorageMb: to.Ptr[int32](102400),
// },
// SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/servers/examplesource"),
// TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{
// Location: to.Ptr("eastus"),
// SKU: &armpostgresqlflexibleservers.ServerSKU{
// Name: to.Ptr("Standard_D2ds_v4"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Standard_D2ds_v4")),
// },
// StorageMb: to.Ptr[int32](131072),
// },
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets information about a migration.
*
* @summary Gets information about a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationButMigrationFailure.json
*/
async function getInformationAboutAMigrationWithSuccessfulValidationButFailedMigration() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const migrationName = "examplemigration";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.migrations.get(resourceGroupName, serverName, migrationName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "da52db29-cfeb-4670-a1ad-683edb14c621",
"currentStatus": {
"state": "Failed",
"error": "exampledatabase: Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration.",
"currentSubStateDetails": {
"currentSubState": "Completed",
"dbDetails": {
"exampledatabase": {
"databaseName": "exampledatabase",
"migrationState": "Failed",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"fullLoadErroredTables": 0,
"fullLoadQueuedTables": 0,
"fullLoadLoadingTables": 0,
"fullLoadCompletedTables": 0,
"cdcUpdateCounter": 0,
"cdcDeleteCounter": 0,
"cdcInsertCounter": 0,
"appliedChanges": 0,
"incomingChanges": 0,
"latency": 0,
"message": "Collation/Encoding not Supported Error: User defined Collations are present in the source database. Please drop them before retrying the migration."
}
},
"validationDetails": {
"status": "Succeeded",
"validationStartTimeInUtc": "2025-06-01T18:30:22.123456Z",
"validationEndTimeInUtc": "2025-06-01T20:30:22.123456Z",
"serverLevelValidationDetails": [
{
"type": "AuthenticationAndConnectivityValidation",
"state": "Succeeded"
}
],
"dbLevelValidationDetails": [
{
"databaseName": "address_standardizer",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "ExtensionsValidation",
"state": "Succeeded"
}
]
}
]
}
}
},
"migrationMode": "Offline",
"migrationWindowEndTimeInUtc": "2025-06-01T20:30:22.123456Z",
"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": [
"exampledatabase"
],
"setupLogicalReplicationOnSourceDbIfNeeded": "True",
"overwriteDbsInTarget": "True",
"migrationWindowStartTimeInUtc": "2025-06-01T18:30:22.123456Z",
"sourceDbServerMetadata": {
"location": "eastus",
"storageMb": 102400,
"sku": {}
},
"targetDbServerMetadata": {
"location": "eastus",
"storageMb": 131072,
"sku": {
"name": "Standard_D2ds_v4",
"tier": "Standard_D2ds_v4"
}
},
"migrateRoles": "False",
"migrationOption": "ValidateAndMigrate"
},
"location": "eastus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/migrations/examplemigration?api-version=2025-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* MigrationsGetMigrationWithSuccessfulValidationOnly.json
*/
/**
* Sample code: Get information about a migration with successful validation only.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void getInformationAboutAMigrationWithSuccessfulValidationOnly(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("exampleresourcegroup", "exampleserver", "examplemigration",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get_migration_with_successful_validation_only.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
migration_name="examplemigration",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationOnly.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e96c24570a484cff13d153fb472f812878866a39/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationOnly.json
func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithSuccessfulValidationOnly() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Migration = armpostgresqlflexibleservers.Migration{
// Name: to.Ptr("examplemigration"),
// Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"),
// Location: to.Ptr("eastus"),
// Properties: &armpostgresqlflexibleservers.MigrationProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateCompleted),
// DbDetails: map[string]*armpostgresqlflexibleservers.DatabaseMigrationState{
// },
// ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{
// DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{
// {
// DatabaseName: to.Ptr("UnknownCollationTest"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// }},
// ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("AuthenticationAndConnectivityValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("SourceVersionValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ServerParametersValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// },
// },
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateSucceeded),
// },
// DbsToMigrate: []*string{
// to.Ptr("UnknownCollationTest")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse),
// MigrationID: to.Ptr("77840327-7be8-44b8-adc0-af0ccccfeb36"),
// MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline),
// MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate),
// MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue),
// SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"),
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"),
// TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverTrue),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets information about a migration.
*
* @summary Gets information about a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithSuccessfulValidationOnly.json
*/
async function getInformationAboutAMigrationWithSuccessfulValidationOnly() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const migrationName = "examplemigration";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.migrations.get(resourceGroupName, serverName, migrationName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "77840327-7be8-44b8-adc0-af0ccccfeb36",
"currentStatus": {
"state": "Succeeded",
"currentSubStateDetails": {
"currentSubState": "Completed",
"dbDetails": {},
"validationDetails": {
"status": "Succeeded",
"validationStartTimeInUtc": "2025-06-01T18:30:22.123456Z",
"validationEndTimeInUtc": "2025-06-01T20:30:22.123456Z",
"serverLevelValidationDetails": [
{
"type": "AuthenticationAndConnectivityValidation",
"state": "Succeeded"
},
{
"type": "SourceVersionValidation",
"state": "Succeeded"
},
{
"type": "ServerParametersValidation",
"state": "Succeeded"
}
],
"dbLevelValidationDetails": [
{
"databaseName": "UnknownCollationTest",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
}
]
}
}
},
"migrationMode": "Offline",
"migrationWindowEndTimeInUtc": "2025-06-01T20:30:22.123456Z",
"sourceDbServerResourceId": "20.228.214.65:5432@postgres",
"targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget",
"dbsToMigrate": [
"UnknownCollationTest"
],
"setupLogicalReplicationOnSourceDbIfNeeded": "True",
"overwriteDbsInTarget": "True",
"migrationWindowStartTimeInUtc": "2025-06-01T18:30:22.123456Z",
"triggerCutover": "True",
"migrateRoles": "False",
"migrationOption": "Validate"
},
"location": "eastus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/migrations/examplemigration?api-version=2025-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/
* MigrationsGetMigrationWithValidationFailures.json
*/
/**
* Sample code: Get information about a migration with validation failures.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void getInformationAboutAMigrationWithValidationFailures(
com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("exampleresourcegroup", "exampleserver", "examplemigration",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get_migration_with_validation_failures.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
migration_name="examplemigration",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithValidationFailures.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e96c24570a484cff13d153fb472f812878866a39/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithValidationFailures.json
func ExampleMigrationsClient_Get_getInformationAboutAMigrationWithValidationFailures() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Migration = armpostgresqlflexibleservers.Migration{
// Name: to.Ptr("examplemigration"),
// Type: to.Ptr("Microsoft.DBforPostgreSQL/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration"),
// Location: to.Ptr("eastus"),
// Properties: &armpostgresqlflexibleservers.MigrationProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstateCompleted),
// DbDetails: map[string]*armpostgresqlflexibleservers.DatabaseMigrationState{
// },
// ValidationDetails: &armpostgresqlflexibleservers.ValidationDetails{
// DbLevelValidationDetails: []*armpostgresqlflexibleservers.DbLevelValidationStatus{
// {
// DatabaseName: to.Ptr("exampledatabase1"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// Messages: []*armpostgresqlflexibleservers.ValidationMessage{
// {
// Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// }},
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("exampledatabase2"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("exampledatabase3"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("CollationsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("exampledatabase4"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("exampledatabase5"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("exampledatabase6"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// },
// {
// DatabaseName: to.Ptr("exampledatabase7"),
// EndedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// StartedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// Summary: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("SchemaValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ExtensionsValidation"),
// Messages: []*armpostgresqlflexibleservers.ValidationMessage{
// {
// Message: to.Ptr("Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// }},
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// }},
// }},
// ServerLevelValidationDetails: []*armpostgresqlflexibleservers.ValidationSummaryItem{
// {
// Type: to.Ptr("AuthenticationAndConnectivityValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("SourceVersionValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// },
// {
// Type: to.Ptr("ServerParametersValidation"),
// State: to.Ptr(armpostgresqlflexibleservers.ValidationStateSucceeded),
// }},
// Status: to.Ptr(armpostgresqlflexibleservers.ValidationStateFailed),
// ValidationEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// ValidationStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// },
// },
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateValidationFailed),
// },
// DbsToMigrate: []*string{
// to.Ptr("exampledatabase1"),
// to.Ptr("exampledatabase2"),
// to.Ptr("exampledatabase3"),
// to.Ptr("exampledatabase4"),
// to.Ptr("exampledatabase5"),
// to.Ptr("exampledatabase6"),
// to.Ptr("exampledatabase7")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse),
// MigrationID: to.Ptr("a3e2d3cc-b139-4201-9431-e4f3003140fd"),
// MigrationMode: to.Ptr(armpostgresqlflexibleservers.MigrationModeOffline),
// MigrationOption: to.Ptr(armpostgresqlflexibleservers.MigrationOptionValidate),
// MigrationWindowEndTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T20:30:22.123Z"); return t}()),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerTrue),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerTrue),
// SourceDbServerResourceID: to.Ptr("20.228.214.65:5432@postgres"),
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget"),
// TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverTrue),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets information about a migration.
*
* @summary Gets information about a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGetMigrationWithValidationFailures.json
*/
async function getInformationAboutAMigrationWithValidationFailures() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const migrationName = "examplemigration";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.migrations.get(resourceGroupName, serverName, migrationName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "a3e2d3cc-b139-4201-9431-e4f3003140fd",
"currentStatus": {
"state": "ValidationFailed",
"currentSubStateDetails": {
"currentSubState": "Completed",
"dbDetails": {},
"validationDetails": {
"status": "Failed",
"validationStartTimeInUtc": "2025-06-01T18:30:22.123456Z",
"validationEndTimeInUtc": "2025-06-01T20:30:22.123456Z",
"serverLevelValidationDetails": [
{
"type": "AuthenticationAndConnectivityValidation",
"state": "Succeeded"
},
{
"type": "SourceVersionValidation",
"state": "Succeeded"
},
{
"type": "ServerParametersValidation",
"state": "Succeeded"
}
],
"dbLevelValidationDetails": [
{
"databaseName": "exampledatabase1",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Failed",
"messages": [
{
"state": "Failed",
"message": "Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"
}
]
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase2",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase3",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
},
{
"type": "CollationsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase4",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase5",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase6",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Succeeded"
}
]
},
{
"databaseName": "exampledatabase7",
"startedOn": "2025-06-01T18:30:22.123456Z",
"endedOn": "2025-06-01T20:30:22.123456Z",
"summary": [
{
"type": "SchemaValidation",
"state": "Succeeded"
},
{
"type": "ExtensionsValidation",
"state": "Failed",
"messages": [
{
"state": "Failed",
"message": "Unsupported Extension. Single to Flex migration tool does not support migration of databases having postgres_fdw extension. Consider performing the migration through other migration tools such as pg_dump/pg_restore (https://aka.ms/migrate-using-pgdump-restore)"
}
]
}
]
}
]
}
}
},
"migrationMode": "Offline",
"migrationWindowEndTimeInUtc": "2025-06-01T20:30:22.123456Z",
"sourceDbServerResourceId": "20.228.214.65:5432@postgres",
"targetDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget",
"dbsToMigrate": [
"exampledatabase1",
"exampledatabase2",
"exampledatabase3",
"exampledatabase4",
"exampledatabase5",
"exampledatabase6",
"exampledatabase7"
],
"setupLogicalReplicationOnSourceDbIfNeeded": "True",
"overwriteDbsInTarget": "True",
"migrationWindowStartTimeInUtc": "2025-06-01T18:30:22.123456Z",
"triggerCutover": "True",
"migrateRoles": "False",
"migrationOption": "Validate"
},
"location": "eastus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBforPostgreSQL/flexibleServers/migrations"
}
Sample request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/migrations/examplemigration?api-version=2025-08-01
/**
* Samples for Migrations Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGet.json
*/
/**
* Sample code: Get information about a migration.
*
* @param manager Entry point to PostgreSqlManager.
*/
public static void
getInformationAboutAMigration(com.azure.resourcemanager.postgresqlflexibleserver.PostgreSqlManager manager) {
manager.migrations().getWithResponse("exampleresourcegroup", "exampleserver", "examplemigration",
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-postgresqlflexibleservers
# USAGE
python migrations_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = PostgreSQLManagementClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.migrations.get(
resource_group_name="exampleresourcegroup",
server_name="exampleserver",
migration_name="examplemigration",
)
print(response)
# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGet.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armpostgresqlflexibleservers_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresqlflexibleservers/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e96c24570a484cff13d153fb472f812878866a39/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGet.json
func ExampleMigrationsClient_Get_getInformationAboutAMigration() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpostgresqlflexibleservers.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMigrationsClient().Get(ctx, "exampleresourcegroup", "exampleserver", "examplemigration", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Migration = armpostgresqlflexibleservers.Migration{
// Name: to.Ptr("examplemigration"),
// Type: to.Ptr("Microsoft.DBForPostgreSql/flexibleServers/migrations"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration"),
// Location: to.Ptr("eastus"),
// Properties: &armpostgresqlflexibleservers.MigrationProperties{
// CurrentStatus: &armpostgresqlflexibleservers.MigrationStatus{
// CurrentSubStateDetails: &armpostgresqlflexibleservers.MigrationSubstateDetails{
// CurrentSubState: to.Ptr(armpostgresqlflexibleservers.MigrationSubstatePerformingPreRequisiteSteps),
// },
// Error: to.Ptr(""),
// State: to.Ptr(armpostgresqlflexibleservers.MigrationStateInProgress),
// },
// DbsToMigrate: []*string{
// to.Ptr("exampledatabase1"),
// to.Ptr("exampledatabase2"),
// to.Ptr("exampledatabase3"),
// to.Ptr("exampledatabase4")},
// MigrateRoles: to.Ptr(armpostgresqlflexibleservers.MigrateRolesAndPermissionsFalse),
// MigrationID: to.Ptr("d3ceacbb-a5fd-43dc-a9db-6022b5154856"),
// MigrationWindowStartTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-06-01T18:30:22.123Z"); return t}()),
// OverwriteDbsInTarget: to.Ptr(armpostgresqlflexibleservers.OverwriteDatabasesOnTargetServerFalse),
// SetupLogicalReplicationOnSourceDbIfNeeded: to.Ptr(armpostgresqlflexibleservers.LogicalReplicationOnSourceServerFalse),
// SourceDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{
// Location: to.Ptr("eastus"),
// SKU: &armpostgresqlflexibleservers.ServerSKU{
// Name: to.Ptr("B_Gen5_2"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTier("Basic")),
// },
// StorageMb: to.Ptr[int32](1024),
// Version: to.Ptr("10"),
// },
// SourceDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/servers/examplesource"),
// StartDataMigration: to.Ptr(armpostgresqlflexibleservers.StartDataMigrationFalse),
// TargetDbServerMetadata: &armpostgresqlflexibleservers.DbServerMetadata{
// Location: to.Ptr("eastus"),
// SKU: &armpostgresqlflexibleservers.ServerSKU{
// Name: to.Ptr("Standard_D4ds_v5"),
// Tier: to.Ptr(armpostgresqlflexibleservers.SKUTierGeneralPurpose),
// },
// StorageMb: to.Ptr[int32](2048),
// Version: to.Ptr("17"),
// },
// TargetDbServerResourceID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget"),
// TriggerCutover: to.Ptr(armpostgresqlflexibleservers.TriggerCutoverFalse),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PostgreSQLManagementFlexibleServerClient } = require("@azure/arm-postgresql-flexible");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets information about a migration.
*
* @summary Gets information about a migration.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2025-08-01/examples/MigrationsGet.json
*/
async function getInformationAboutAMigration() {
const subscriptionId =
process.env["POSTGRESQL_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = process.env["POSTGRESQL_RESOURCE_GROUP"] || "exampleresourcegroup";
const serverName = "exampleserver";
const migrationName = "examplemigration";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
const result = await client.migrations.get(resourceGroupName, serverName, migrationName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"properties": {
"migrationId": "d3ceacbb-a5fd-43dc-a9db-6022b5154856",
"currentStatus": {
"state": "InProgress",
"error": "",
"currentSubStateDetails": {
"currentSubState": "PerformingPreRequisiteSteps"
}
},
"sourceDbServerMetadata": {
"location": "eastus",
"version": "10",
"storageMb": 1024,
"sku": {
"name": "B_Gen5_2",
"tier": "Basic"
}
},
"targetDbServerMetadata": {
"location": "eastus",
"version": "17",
"storageMb": 2048,
"sku": {
"tier": "GeneralPurpose",
"name": "Standard_D4ds_v5"
}
},
"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": "2025-06-01T18:30:22.123456Z",
"startDataMigration": "False",
"triggerCutover": "False",
"migrateRoles": "False"
},
"location": "eastus",
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBForPostgreSql/flexibleServers/exampletarget/migrations/examplemigration",
"name": "examplemigration",
"type": "Microsoft.DBForPostgreSql/flexibleServers/migrations"
}
Definitions
| Name |
Description |
|
AdminCredentials
|
Credentials of administrator users for source and target servers.
|
|
Cancel
|
Indicates if cancel must be triggered for the entire migration.
|
|
createdByType
|
The type of identity that created the resource.
|
|
DatabaseMigrationState
|
Migration state of a database.
|
|
DbLevelValidationStatus
|
Validation status summary for a database.
|
|
DbServerMetadata
|
Database server metadata.
|
|
ErrorAdditionalInfo
|
The resource management error additional info.
|
|
ErrorDetail
|
The error detail.
|
|
ErrorResponse
|
Error response
|
|
LogicalReplicationOnSourceServer
|
Indicates whether to setup logical replication on source server, if needed.
|
|
MigrateRolesAndPermissions
|
Indicates if roles and permissions must be migrated.
|
|
Migration
|
Properties of a migration.
|
|
MigrationDatabaseState
|
Migration state of a database.
|
|
MigrationMode
|
Mode used to perform the migration: Online or Offline.
|
|
MigrationOption
|
Supported option for a migration
|
|
MigrationSecretParameters
|
Migration secret parameters.
|
|
MigrationState
|
State of migration.
|
|
MigrationStatus
|
State of migration.
|
|
MigrationSubstate
|
Substate of migration.
|
|
MigrationSubstateDetails
|
Details of migration substate.
|
|
OverwriteDatabasesOnTargetServer
|
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.
|
|
ServerSku
|
Compute information of a server.
|
|
SkuTier
|
This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.
|
|
SourceType
|
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
|
|
SslMode
|
SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'.
|
|
StartDataMigration
|
Indicates if data migration must start right away.
|
|
systemData
|
Metadata pertaining to creation and last modification of the resource.
|
|
TriggerCutover
|
Indicates if cutover must be triggered for the entire migration.
|
|
ValidationDetails
|
Details for the validation for migration.
|
|
ValidationMessage
|
Validation message object.
|
|
ValidationState
|
Validation status for migration.
|
|
ValidationSummaryItem
|
Validation summary object.
|
AdminCredentials
Object
Credentials of administrator users for source and target servers.
| Name |
Type |
Description |
|
sourceServerPassword
|
string
|
Password for the user of the source server.
|
|
targetServerPassword
|
string
|
Password for the user of the target server.
|
Cancel
Enumeration
Indicates if cancel must be triggered for the entire migration.
| Value |
Description |
|
True
|
Cancel must be triggered for the entire migration.
|
|
False
|
Cancel must not be triggered for the entire migration.
|
createdByType
Enumeration
The type of identity that created the resource.
| Value |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
DatabaseMigrationState
Object
Migration state of a database.
| Name |
Type |
Description |
|
appliedChanges
|
integer
(int32)
|
Change Data Capture applied changes counter.
|
|
cdcDeleteCounter
|
integer
(int32)
|
Change Data Capture delete counter.
|
|
cdcInsertCounter
|
integer
(int32)
|
Change Data Capture insert counter.
|
|
cdcUpdateCounter
|
integer
(int32)
|
Change Data Capture update counter.
|
|
databaseName
|
string
|
Name of database.
|
|
endedOn
|
string
(date-time)
|
End time of a migration state.
|
|
fullLoadCompletedTables
|
integer
(int32)
|
Number of tables loaded during the migration of a database.
|
|
fullLoadErroredTables
|
integer
(int32)
|
Number of tables encountering errors during the migration of a database.
|
|
fullLoadLoadingTables
|
integer
(int32)
|
Number of tables loading during the migration of a database.
|
|
fullLoadQueuedTables
|
integer
(int32)
|
Number of tables queued for the migration of a database.
|
|
incomingChanges
|
integer
(int32)
|
Change Data Capture incoming changes counter.
|
|
latency
|
integer
(int32)
|
Lag in seconds between source and target during online phase.
|
|
message
|
string
|
Error message, if any, for the migration state.
|
|
migrationOperation
|
string
|
Migration operation of a database.
|
|
migrationState
|
MigrationDatabaseState
|
Migration state of a database.
|
|
startedOn
|
string
(date-time)
|
Start time of a migration state.
|
DbLevelValidationStatus
Object
Validation status summary for a database.
| Name |
Type |
Description |
|
databaseName
|
string
|
Name of database.
|
|
endedOn
|
string
(date-time)
|
End time of a database level validation.
|
|
startedOn
|
string
(date-time)
|
Start time of a database level validation.
|
|
summary
|
ValidationSummaryItem[]
|
Summary of database level validations.
|
Object
Database server metadata.
| Name |
Type |
Description |
|
location
|
string
|
Location of database server.
|
|
sku
|
ServerSku
|
Compute tier and size of the database server. This object is empty for an Azure Database for PostgreSQL single server.
|
|
storageMb
|
integer
(int32)
|
Storage size (in MB) for database server.
|
|
version
|
string
|
Major version of PostgreSQL database engine.
|
ErrorAdditionalInfo
Object
The resource management error additional info.
| Name |
Type |
Description |
|
info
|
object
|
The additional info.
|
|
type
|
string
|
The additional info type.
|
ErrorDetail
Object
The error detail.
| Name |
Type |
Description |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
|
code
|
string
|
The error code.
|
|
details
|
ErrorDetail[]
|
The error details.
|
|
message
|
string
|
The error message.
|
|
target
|
string
|
The error target.
|
ErrorResponse
Object
Error response
| Name |
Type |
Description |
|
error
|
ErrorDetail
|
The error object.
|
LogicalReplicationOnSourceServer
Enumeration
Indicates whether to setup logical replication on source server, if needed.
| Value |
Description |
|
True
|
Logical replication will be set up on the source server.
|
|
False
|
Logical replication will not be set up on the source server.
|
MigrateRolesAndPermissions
Enumeration
Indicates if roles and permissions must be migrated.
| Value |
Description |
|
True
|
Roles and permissions will be migrated.
|
|
False
|
Roles and permissions will not be migrated.
|
Migration
Object
Properties of a migration.
| Name |
Type |
Description |
|
id
|
string
(arm-id)
|
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
location
|
string
|
The geo-location where the resource lives
|
|
name
|
string
|
The name of the resource
|
|
properties.cancel
|
Cancel
|
Indicates if cancel must be triggered for the entire migration.
|
|
properties.currentStatus
|
MigrationStatus
|
Current status of a migration.
|
|
properties.dbsToCancelMigrationOn
|
string[]
|
When you want to trigger cancel for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array.
|
|
properties.dbsToMigrate
|
string[]
|
Names of databases to migrate.
|
|
properties.dbsToTriggerCutoverOn
|
string[]
|
When you want to trigger cutover for specific databases set 'triggerCutover' to 'True' and the names of the specific databases in this array.
|
|
properties.migrateRoles
|
MigrateRolesAndPermissions
|
Indicates if roles and permissions must be migrated.
|
|
properties.migrationId
|
string
|
Identifier of a migration.
|
|
properties.migrationInstanceResourceId
|
string
(arm-id)
|
Identifier of the private endpoint migration instance.
|
|
properties.migrationMode
|
MigrationMode
|
Mode used to perform the migration: Online or Offline.
|
|
properties.migrationOption
|
MigrationOption
|
Supported option for a migration.
|
|
properties.migrationWindowEndTimeInUtc
|
string
(date-time)
|
End time (UTC) for migration window.
|
|
properties.migrationWindowStartTimeInUtc
|
string
(date-time)
|
Start time (UTC) for migration window.
|
|
properties.overwriteDbsInTarget
|
OverwriteDatabasesOnTargetServer
|
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.
|
|
properties.secretParameters
|
MigrationSecretParameters
|
Migration secret parameters.
|
|
properties.setupLogicalReplicationOnSourceDbIfNeeded
|
LogicalReplicationOnSourceServer
|
Indicates whether to setup logical replication on source server, if needed.
|
|
properties.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.
|
|
properties.sourceDbServerMetadata
|
DbServerMetadata
|
Metadata of source database server.
|
|
properties.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.
|
|
properties.sourceType
|
SourceType
|
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
|
|
properties.sslMode
|
SslMode
|
SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'.
|
|
properties.startDataMigration
|
StartDataMigration
|
Indicates if data migration must start right away.
|
|
properties.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.
|
|
properties.targetDbServerMetadata
|
DbServerMetadata
|
Metadata of target database server.
|
|
properties.targetDbServerResourceId
|
string
|
Identifier of the target database server resource.
|
|
properties.triggerCutover
|
TriggerCutover
|
Indicates if cutover must be triggered for the entire migration.
|
|
systemData
|
systemData
|
Azure Resource Manager metadata containing createdBy and modifiedBy information.
|
|
tags
|
object
|
Resource tags.
|
|
type
|
string
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
MigrationDatabaseState
Enumeration
Migration state of a database.
| Value |
Description |
|
InProgress
|
Migration is in progress for the database.
|
|
WaitingForCutoverTrigger
|
Migration is waiting for cutover trigger for the database.
|
|
Failed
|
Migration has failed for the database.
|
|
Canceled
|
Migration has been canceled for the database.
|
|
Succeeded
|
Migration has succeeded for the database.
|
|
Canceling
|
Migration is canceling for the database.
|
MigrationMode
Enumeration
Mode used to perform the migration: Online or Offline.
| Value |
Description |
|
Offline
|
Offline migration mode.
|
|
Online
|
Online migration mode.
|
MigrationOption
Enumeration
Supported option for a migration
| Value |
Description |
|
Validate
|
Validate the migration without performing it.
|
|
Migrate
|
Perform the migration.
|
|
ValidateAndMigrate
|
Validate and perform the migration.
|
MigrationSecretParameters
Object
Migration secret parameters.
| Name |
Type |
Description |
|
adminCredentials
|
AdminCredentials
|
Credentials of administrator users for source and target servers.
|
|
sourceServerUsername
|
string
|
Gets or sets the name of the user for the source server. This user doesn't need to be an administrator.
|
|
targetServerUsername
|
string
|
Gets or sets the name of the user for the target server. This user doesn't need to be an administrator.
|
MigrationState
Enumeration
State of migration.
| Value |
Description |
|
InProgress
|
Migration is in progress.
|
|
WaitingForUserAction
|
Migration is waiting for user action.
|
|
Canceled
|
Migration has been canceled.
|
|
Failed
|
Migration has failed.
|
|
Succeeded
|
Migration has succeeded.
|
|
ValidationFailed
|
Validation for migration has failed.
|
|
CleaningUp
|
Migration is cleaning up resources.
|
MigrationStatus
Object
State of migration.
| Name |
Type |
Description |
|
currentSubStateDetails
|
MigrationSubstateDetails
|
Current migration sub state details.
|
|
error
|
string
|
Error message, if any, for the migration state.
|
|
state
|
MigrationState
|
State of migration.
|
MigrationSubstate
Enumeration
Substate of migration.
| Value |
Description |
|
PerformingPreRequisiteSteps
|
Performing pre-requisite steps for migration.
|
|
WaitingForLogicalReplicationSetupRequestOnSourceDB
|
Waiting for logical replication setup request on source database.
|
|
WaitingForDBsToMigrateSpecification
|
Waiting for databases to migrate specification.
|
|
WaitingForTargetDBOverwriteConfirmation
|
Waiting for target database overwrite confirmation.
|
|
WaitingForDataMigrationScheduling
|
Waiting for data migration scheduling.
|
|
WaitingForDataMigrationWindow
|
Waiting for data migration window.
|
|
MigratingData
|
Migrating data.
|
|
WaitingForCutoverTrigger
|
Waiting for cutover trigger.
|
|
CompletingMigration
|
Completing migration.
|
|
Completed
|
Migration completed.
|
|
CancelingRequestedDBMigrations
|
Canceling requested database migrations.
|
|
ValidationInProgress
|
Validation in progress.
|
MigrationSubstateDetails
Object
Details of migration substate.
OverwriteDatabasesOnTargetServer
Enumeration
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.
| Value |
Description |
|
True
|
Databases on the target server can be overwritten when already present.
|
|
False
|
Databases on the target server cannot be overwritten when already present.
|
ServerSku
Object
Compute information of a server.
| Name |
Type |
Description |
|
name
|
string
|
Compute tier and size of the database server. This object is empty for an Azure Database for PostgreSQL single server.
|
|
tier
|
SkuTier
|
Tier of the compute assigned to a server.
|
SkuTier
Enumeration
This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.
| Value |
Description |
|
Free
|
|
|
Basic
|
|
|
Standard
|
|
|
Premium
|
|
SourceType
Enumeration
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
| Value |
Description |
|
OnPremises
|
On-premises PostgreSQL server.
|
|
AWS
|
Amazon Web Services PostgreSQL server.
|
|
GCP
|
Google Cloud Platform PostgreSQL server.
|
|
AzureVM
|
Azure Virtual Machine PostgreSQL server.
|
|
PostgreSQLSingleServer
|
Azure Database for PostgreSQL single server.
|
|
AWS_RDS
|
Amazon RDS for PostgreSQL.
|
|
AWS_AURORA
|
Amazon Aurora for PostgreSQL.
|
|
AWS_EC2
|
Amazon EC2 for PostgreSQL.
|
|
GCP_CloudSQL
|
Google Cloud SQL for PostgreSQL.
|
|
GCP_AlloyDB
|
Google Cloud AlloyDB for PostgreSQL.
|
|
GCP_Compute
|
Google Compute Engine for PostgreSQL.
|
|
EDB
|
EnterpriseDB PostgreSQL server.
|
|
EDB_Oracle_Server
|
EnterpriseDB Oracle Server.
|
|
EDB_PostgreSQL
|
EnterpriseDB PostgreSQL server.
|
|
PostgreSQLFlexibleServer
|
Azure Database for PostgreSQL flexible server.
|
|
PostgreSQLCosmosDB
|
.NET Cosmos DB for PostgreSQL
|
|
Huawei_RDS
|
Huawei RDS for PostgreSQL
|
|
Huawei_Compute
|
Huawei Compute for PostgreSQL
|
|
Heroku_PostgreSQL
|
Heroku PostgreSQL
|
|
Crunchy_PostgreSQL
|
Crunchy PostgreSQL
|
|
ApsaraDB_RDS
|
ApsaraDB RDS for PostgreSQL
|
|
Digital_Ocean_Droplets
|
Digital Ocean Droplets for PostgreSQL
|
|
Digital_Ocean_PostgreSQL
|
Digital Ocean PostgreSQL
|
|
Supabase_PostgreSQL
|
Supabase PostgreSQL
|
SslMode
Enumeration
SSL mode used by a migration. Default SSL mode for 'PostgreSQLSingleServer' is 'VerifyFull'. Default SSL mode for other source types is 'Prefer'.
| Value |
Description |
|
Prefer
|
Prefer SSL connection. If the server does not support SSL, the connection will be established without SSL.
|
|
Require
|
Require SSL connection. If the server does not support SSL, the connection will fail.
|
|
VerifyCA
|
Require SSL connection and verify the server certificate against the CA certificate.
|
|
VerifyFull
|
Require SSL connection, verify the server certificate against the CA certificate, and verify that the server hostname matches the certificate.
|
StartDataMigration
Enumeration
Indicates if data migration must start right away.
| Value |
Description |
|
True
|
Data migration must start right away.
|
|
False
|
Data migration must not start right away.
|
systemData
Object
Metadata pertaining to creation and last modification of the resource.
| Name |
Type |
Description |
|
createdAt
|
string
(date-time)
|
The timestamp of resource creation (UTC).
|
|
createdBy
|
string
|
The identity that created the resource.
|
|
createdByType
|
createdByType
|
The type of identity that created the resource.
|
|
lastModifiedAt
|
string
(date-time)
|
The timestamp of resource last modification (UTC)
|
|
lastModifiedBy
|
string
|
The identity that last modified the resource.
|
|
lastModifiedByType
|
createdByType
|
The type of identity that last modified the resource.
|
TriggerCutover
Enumeration
Indicates if cutover must be triggered for the entire migration.
| Value |
Description |
|
True
|
Cutover must be triggered for the entire migration.
|
|
False
|
Cutover must not be triggered for the entire migration.
|
ValidationDetails
Object
Details for the validation for migration.
| Name |
Type |
Description |
|
dbLevelValidationDetails
|
DbLevelValidationStatus[]
|
Details of server level validations.
|
|
serverLevelValidationDetails
|
ValidationSummaryItem[]
|
Details of server level validations.
|
|
status
|
ValidationState
|
Validation status for migration.
|
|
validationEndTimeInUtc
|
string
(date-time)
|
End time (UTC) for validation.
|
|
validationStartTimeInUtc
|
string
(date-time)
|
Start time (UTC) for validation.
|
ValidationMessage
Object
Validation message object.
| Name |
Type |
Description |
|
message
|
string
|
Validation message string.
|
|
state
|
ValidationState
|
Severity of validation message.
|
ValidationState
Enumeration
Validation status for migration.
| Value |
Description |
|
Failed
|
Validation has failed.
|
|
Succeeded
|
Validation has succeeded.
|
|
Warning
|
Validation has succeeded with warnings.
|
ValidationSummaryItem
Object
Validation summary object.