Skip to content

Commit 4624b4b

Browse files
authored
Merge pull request #278234 from markingmyname/iaas
[PostgreSQL] [Migration Service] IaaS Offline/Online Articles and additional AWS changes
2 parents c3bf1ae + 9ac16d3 commit 4624b4b

File tree

105 files changed

+1178
-957
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1178
-957
lines changed

articles/postgresql/.openpublishing.redirection.postgresql.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,16 @@
16241624
"source_path_from_root": "/articles/postgresql/migrate/migration-service/tutorial-migration-service-aws.md",
16251625
"redirect_url": "/azure/postgresql/migrate/migration-service/tutorial-migration-service-aws-offline",
16261626
"redirect_document_id": true
1627+
},
1628+
{
1629+
"source_path_from_root": "/articles/postgresql/migrate/migration-service/tutorial-migration-service-iaas.md",
1630+
"redirect_url": "/azure/postgresql/migrate/migration-service/tutorial-migration-service-iaas-offline",
1631+
"redirect_document_id": true
1632+
},
1633+
{
1634+
"source_path_from_root": "/articles/postgresql/migrate/migration-service/concepts-migration-service-postgresql.md",
1635+
"redirect_url": "/azure/postgresql/migrate/migration-service/overview-migration-service-postgresql",
1636+
"redirect_document_id": true
16271637
}
16281638
]
16291639
}

articles/postgresql/TOC.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -543,13 +543,15 @@
543543
- name: Migration Service
544544
items:
545545
- name: Overview
546-
href: migrate/migration-service/concepts-migration-service-postgresql.md
546+
href: migrate/migration-service/overview-migration-service-postgresql.md
547547
- name: Tutorials
548548
items:
549549
- name: Migrate from Single Server
550550
href: migrate/migration-service/tutorial-migration-service-single-to-flexible.md
551-
- name: Migrate from on-premises or Azure VM
552-
href: migrate/migration-service/tutorial-migration-service-iaas.md
551+
- name: Migrate from an Azure VM or an on-premises PostgreSQL server offline
552+
href: migrate/migration-service/tutorial-migration-service-iaas-offline.md
553+
- name: Migrate from an Azure VM or an on-premises PostgreSQL server online
554+
href: migrate/migration-service/tutorial-migration-service-iaas-online.md
553555
- name: Migrate from AWS RDS offline
554556
href: migrate/migration-service/tutorial-migration-service-aws-offline.md
555557
- name: Migrate from AWS RDS online
@@ -568,11 +570,13 @@
568570
href: migrate/migration-service/concepts-known-issues-migration-service.md
569571
- name: How-to guides
570572
items:
571-
- name: Network setup
573+
- name: How to set up Azure CLI
574+
href: migrate/migration-service/how-to-setup-azure-cli-commands-postgresql.md
575+
- name: How to set up the network
572576
href: migrate/migration-service/how-to-network-setup-migration-service.md
573577
- name: Troubleshoot
574578
items:
575-
- name: Premigration error codes
579+
- name: Known errors
576580
href: migrate/migration-service/troubleshoot-error-codes-premigration.md
577581
- name: Migrate data with pg_dump
578582
href: migrate/how-to-migrate-using-dump-and-restore.md

articles/postgresql/migrate/migration-service/concepts-known-issues-migration-service.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ Here are common limitations that apply to migration scenarios:
5353

5454
- Migration to burstable SKUs isn't supported; databases must first be migrated to a non-burstable SKU and then scaled down if needed.
5555

56+
- The Migration Runtime Server is specifically designed to operate with the default DNS servers/private DNS zones i.e., **privatelink.postgres.database.azure.com**. Custom DNS names/DNS servers are not supported by the migration service when utilizing the migration runtime server feature. When configuring private endpoints for both the source and target databases, it is imperative to use the default private DNS zone provided by Azure for the private link service. The use of custom DNS configurations is not yet supported and may lead to connectivity issues during the migration process.
57+
5658
## Limitations migrating from Azure Database for PostgreSQL single server
5759

5860
- It's required that both the Azure Database for PostgreSQL single server and the Azure Database for PostgreSQL flexible server are in the same Azure region. Exceptions to this limitation are made for Azure Database for PostgreSQL flexible server situated in India, China, and UAE, where cross-region migrations are permitted.

articles/postgresql/migrate/migration-service/concepts-migration-service-runtime-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The migration runtime server is essential for transferring data between differen
3030

3131
To use the Migration Runtime Server feature within the migration service in Azure Database for PostgreSQL, follow these steps in the Azure portal:
3232

33-
- Sign in to the Azure portal and access the migration service in the Azure Database for PostgreSQL.
33+
- Sign in to the Azure portal and access the migration service (from the target server) in the Azure Database for PostgreSQL instance.
3434
- Begin a new migration workflow within the service.
3535
- When you reach the "Select runtime server" tab, use the Migration Runtime Server by selecting "Yes."
3636
Choose your Azure subscription and resource group and the location of the VNet-integrated Azure Database for PostgreSQL—Flexible server.

articles/postgresql/migrate/migration-service/how-to-network-setup-migration-service.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ The table below summarizes the scenarios for connecting a source database to an
2727
| PostgreSQL installed Azure VM in same/different virtual network | VNet-integrated Azure Database for PostgreSQL - Flexible Server in same/different virtual network | Yes |
2828
| Azure Database for PostgreSQL - Single Server with public access | VNet-integrated Azure Database for PostgreSQL - Flexible Server | Yes |
2929
| Azure Database for PostgreSQL - Single Server with private endpoint | VNet-integrated Azure Database for PostgreSQL - Flexible Server | Yes |
30-
| Azure Database for PostgreSQL - Single Server with private endpoint | Azure Database for PostgreSQL - Flexible Server with private endpoint | Planned for future release |
31-
| On-premises/Azure VM/AWS with private access | Azure Database for PostgreSQL - Flexible Server with private endpoint | Planned for future release |
32-
| On-premises/Azure VM/AWS with private access | Azure Database for PostgreSQL - Flexible Server with public access | Planned for future release |
30+
| Azure Database for PostgreSQL - Single Server with private endpoint | Azure Database for PostgreSQL - Flexible Server with private endpoint | Yes |
31+
| On-premises/Azure VM/AWS with private access | Azure Database for PostgreSQL - Flexible Server with private endpoint | Yes |
32+
| On-premises/Azure VM/AWS with private access | Azure Database for PostgreSQL - Flexible Server with public access | No |
3333

3434
## Scenario 1: On-premises source to Azure Database for PostgreSQL with public access
3535

@@ -212,17 +212,6 @@ Below are the networking steps for migrating a PostgreSQL database from an on-pr
212212
- Attach a private DNS zone to the Flexible Server's private endpoint if not already configured.
213213
- Add virtual network links for the Flexible Server and Migration Runtime Server to the private DNS zone.
214214

215-
## Scenario 10: Custom private DNS Zone attached to the private endpoint
216-
217-
This scenario addresses the networking challenge when migrating databases to Azure PostgreSQL, which requires using Azure's default private DNS zone. Custom DNS configurations are incompatible with the Migration Runtime Server, necessitating the temporary use of Azure's default private DNS zone.
218-
219-
- Check if the source and target databases use custom DNS zones with private endpoints.
220-
- For both the source and target databases, set up new private endpoints that are linked to Azure's default private DNS zone.
221-
- Connect the new private endpoints to the **privatelink.postgres.database.azure.com** DNS zone for proper name resolution.
222-
- Ensure the Migration Runtime Server can resolve and communicate with both databases using the new private endpoints.
223-
- Carry out the database migration through the secondary endpoints that use the default private DNS zone.
224-
- Remove the secondary private endpoints after successful migration and restore any custom DNS configurations if needed.
225-
226215
## Resources for network setup
227216

228217
- To establish an **ExpressRoute** connection, refer to the [What is Azure ExpressRoute?](../../../expressroute/expressroute-introduction.md).
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: How to set up Azure CLI for migration service in Azure Database for PostgreSQL - Flexible Server
3+
description: Learn how to set up Azure CLI for migration service in Azure Database for PostgreSQL - Flexible Server and begin migrating your data.
4+
author: markingmyname
5+
ms.author: maghan
6+
ms.date: 06/13/2024
7+
ms.service: postgresql
8+
ms.subservice: flexible-server
9+
ms.topic: how-to
10+
ms.custom:
11+
- devx-track-azurecli
12+
---
13+
14+
# How to set up Azure CLI for migration service in Azure Database for PostgreSQL - Flexible Server
15+
16+
To begin migrating using Azure CLI, you need to install the Azure CLI on your local machine.
17+
18+
## Prerequisites
19+
20+
- [Choose the right command line tool](/CLI/azure/choose-the-right-azure-command-line-tool)
21+
- [Install Azure CLI](/cli/azure/install-azure-cli)
22+
- [Review the az postgresql commands](/cli/azure/postgres)
23+
24+
## Migrate commands
25+
26+
Migrating with the Azure CLI uses the following commands:
27+
28+
- [az postgres flexible-server migration create](/cli/azure/postgres/flexible-server/migration#az-postgres-flexible-server-migration-create)
29+
- [az postgres flexible-server migration list](/cli/azure/postgres/flexible-server/migration#az-postgres-flexible-server-migration-list)
30+
- [az postgres flexible-server migration show](/cli/azure/postgres/flexible-server/migration#az-postgres-flexible-server-migration-show)
31+
32+
The following table defines the parameters and the commands that use them:
33+
34+
| Parameter | Relevant commands | Description |
35+
| --- | --- | --- |
36+
| `subscription` | Create, List, Show | Subscription ID of PostgreSQL Flexible server |
37+
| `resource-group` | Create, List, Show | Resource group of PostgreSQL Flexible server |
38+
| `name` | Create, List, Show | Name of the PostgreSQL Flexible server |
39+
| `migration-name` | Create, Show | Unique identifier to migrations attempted to Flexible Server. This field accepts only alphanumeric characters and doesn't accept any special characters except a hyphen (-). The name can't start with -, and no two migrations to a Flexible Server target can have the same name. |
40+
| `filter` | List | To filter migrations, two values are supported – Active and All
41+
| `help` | Create, List, Show | Provides information about each command. |
42+
| `migration-mode` | Create | This is an optional parameter. Default value: Offline. Offline migration involves copying your source databases to your target server at a point in time. |
43+
| `migration-option` | Create | Allows you to perform validations before triggering a migration. Default is ValidateAndMigrate. Allowed values are - Migrate, Validate, ValidateAndMigrate.
44+
| `properties` | Create | Absolute path to a JSON file that has the information about the source server |
45+
46+
The **create** command requires a JSON file, which contains the following information:
47+
48+
| Property Name | Description |
49+
| --- | --- |
50+
| `sourceDbServerResourceId` | Source server details in the format for on-premises, Azure virtual machines (VMs), AWS - `<<hostname or IP address>>:<<port>>@<<username>>` |
51+
| `AdminCredentials` | This parameter lists passwords for admin users for both the source server and the target PostgreSQL flexible server. These passwords help to authenticate against the source and target servers |
52+
| `targetServerUserName` | The default value is the admin user created during the creation of the flexible server, and the password provided is used for authentication against this user. If you aren't using the default user, this parameter is the user or role on the target server for migration. This user should be a member of azure_pg_admin, pg_read_all_settings, pg_read_all_stats, and pg_stat_scan_tables roles and should have the Create role, Create DB attributes |
53+
| `dbsToMigrate` | Specify the list of databases that you want to migrate to Flexible Server. You can include a maximum of eight database names at a time. Providing the list of DBs in array format. |
54+
| `OverwriteDBsInTarget` | When set to true (default), if the target server happens to have an existing database with the same name as the one you're trying to migrate, the migration tool automatically overwrites the database |
55+
| `MigrationMode` | Mode of the migration. The supported value is "Offline" |
56+
| `sourceType` | Required parameter. Values can be - on-premises, AWS, AzureVM, PostgreSQLSingleServer |
57+
| `sslMode` | SSL modes for migration. SSL mode for PostgreSQLSingleServer is VerifyFull and Prefer/Require for other source types |
58+
59+
## Cutover the migration
60+
61+
After the base data migration is complete, the migration task moves to the `WaitingForCutoverTrigger` substate. In this state, users can trigger the cutover from the portal by selecting the migration name in the migration grid or through the CLI using the command below.
62+
63+
For example:
64+
65+
```azurecli-interactive
66+
az postgres flexible-server migration update --subscription 11111111-1111-1111-1111-111111111111 --resource-group my-learning-rg --name myflexibleserver --migration-name CLIMigrationExample --cutover
67+
```
68+
69+
Before initiating cutover, it's important to ensure that:
70+
71+
- Writes to the source are stopped
72+
- `latency` value decreases to 0 or close to 0
73+
- `latency` value indicates when the target last synced with the source. At this point, writes to the source can be stopped and cutover initiated. In case there's heavy traffic at the source, it's recommended to stop writes first so that `Latency` can come close to 0, and then a cutover is initiated.
74+
- The Cutover operation applies all pending changes from the Source to the Target and completes the migration. If you trigger a "Cutover" even with nonzero `Latency`, the replication stops until that point in time. All the data on source until the cutover point is then applied on the target. Say a latency was 15 minutes at the cutover point, so all the changed data in the last 15 minutes applies to the target.
75+
76+
Time depends on the backlog of changes occurring in the last 15 minutes. Hence, it's recommended that the latency go to zero or near zero before triggering the cutover.
77+
78+
The `latency` information can be obtained using the migration show command.
79+
Here's a snapshot of the migration before initiating the cutover:
80+
81+
After the cutover is initiated, pending data captured during CDC is written to the target, and migration is now complete.
82+
83+
If the cutover isn't successful, the migration moves to the `Failed` state.
84+
85+
For more information about this command, use the `help` parameter.
86+
87+
## Cancel the migration
88+
89+
To cancel the migration task, use the following command:
90+
91+
```azurecli
92+
az postgres flexible-server migration update cancel [--subscription]
93+
[--resource-group]
94+
[--name]
95+
[--migration-name]
96+
```
97+
98+
## The --help command
99+
100+
For more information about this command, use the `help` parameter:
101+
102+
```azurecli-interactive
103+
az postgres flexible-server migration update cancel -- help
104+
```
105+
106+
## Related content
107+
108+
- [Migration service in Azure Database for PostgreSQL](overview-migration-service-postgresql.md)
109+
- [Migrate from Single Server to Flexible Server](tutorial-migration-service-single-to-flexible.md)
110+
- [Migrate offline from AWS RDS PostgreSQL](tutorial-migration-service-aws-offline.md)
111+
- [Migrate online from AWS RDS PostgreSQL](tutorial-migration-service-aws-online.md)
112+
- [Migrate offline from on-premises or an Azure VM hosted PostgreSQL](tutorial-migration-service-iaas-offline.md)
113+
- [Migrate online from on-premises or an Azure VM hosted PostgreSQL](tutorial-migration-service-iaas-online.md)

articles/postgresql/migrate/migration-service/includes/aws/prerequisites-migration-service-postgresql-offline-aws.md

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,9 @@ The SKU chosen for the Azure Database for PostgreSQL should correspond with the
3333

3434
### Configure network setup
3535

36-
Proper networking setup is essential to ensure successful migration connectivity between the source and target. Here's a guide to help you establish the network connection for different scenarios:
36+
Network setup is crucial for the migration service to function correctly. Ensure that the source PostgreSQL server can communicate with the target Azure Database for PostgreSQL server. The following network configurations are essential for a successful migration.
3737

38-
- **Networking requirements for migration:**
39-
40-
- **ExpressRoute/IPsec VPN/VPN tunneling**: When connecting your on-premises/AWS source to Azure, you might need to set up an ExpressRoute, IPsec VPN, or VPN tunneling to facilitate secure data transfer.
41-
42-
- **VNET peering**: Establish virtual network peering between the two distinct VNets to enable direct network connectivity, a prerequisite for migration between the Azure VM and the Azure Database for PostgreSQL.
43-
44-
- **Connectivity Scenarios:**
45-
46-
The following table can help set up the network between the source and target.
47-
48-
| Source | Target | Connectivity Tips |
49-
| --- | --- | --- |
50-
| Public | Public | No other action is required if the source is whitelisted in the target's firewall rules. |
51-
| Private | Public | This configuration isn't supported; use pg_dump/pg_restore for data transfer. |
52-
| Public | Private | No other action is required if the source is whitelisted in the target's firewall rules. |
53-
| Private | Private | Establish an ExpressRoute, IPsec VPN, VPN Tunneling, or virtual network Peering between the source and target. |
54-
| Private | Private Endpoint | This configuration isn't supported; contact [Microsoft support](https://support.microsoft.com/en-US). |
55-
56-
- **Additional networking considerations:**
57-
58-
pg_hba.conf Configuration: To facilitate connectivity between the source and target PostgreSQL instances, it's essential to verify and potentially modify the pg_hba.conf file. This file includes client authentication and must be configured to allow the target PostgreSQL to connect to the source. Changes to the pg_hba.conf file typically require a restart of the source PostgreSQL instance to take effect.
59-
60-
> [!NOTE]
61-
> The pg_hba.conf file is located in the data directory of the PostgreSQL installation. This file should be checked and configured if the source database is an on-premises PostgreSQL server or a PostgreSQL server hosted on an Azure VM. For PostgreSQL instances on AWS RDS or similar managed services, the pg_hba.conf file is not directly accessible or applicable. Instead, access is controlled through the service's security and network access configurations.
62-
63-
For more information about network setup, visit [Network guide for migration service](../../how-to-network-setup-migration-service.md).
38+
For information about network setup, visit [Network guide for migration service](../../how-to-network-setup-migration-service.md).
6439

6540
### Enable extensions
6641

0 commit comments

Comments
 (0)