|
| 1 | +--- |
| 2 | +title: Prerequisites Using the Migration Service from EnterpriseDB Extended Server (Online) Preview |
| 3 | +description: Providing the online prerequisites for the migration service in Azure Database for PostgreSQL. |
| 4 | +author: hariramt |
| 5 | +ms.author: hariramt |
| 6 | +ms.reviewer: maghan |
| 7 | +ms.date: 03/11/2026 |
| 8 | +ms.service: azure-database-postgresql |
| 9 | +ms.topic: include |
| 10 | +--- |
| 11 | + |
| 12 | +Before starting the migration with the Azure Database for PostgreSQL migration service, it's important to fulfill the following prerequisites, specifically designed for online migration scenarios. |
| 13 | + |
| 14 | +- [Verify the source version](#verify-the-source-version) |
| 15 | +- [Install test_decoding - Source Setup](#install-test_decoding---source-setup) |
| 16 | +- [Configure target setup](#configure-target-setup) |
| 17 | +- [Enable CDC as a source](#enable-cdc-as-a-source) |
| 18 | +- [Configure network setup](#configure-network-setup) |
| 19 | +- [Enable extensions](#enable-extensions) |
| 20 | +- [Check server parameters](#check-server-parameters) |
| 21 | +- [Check users and roles](#check-users-and-roles) |
| 22 | + |
| 23 | +### Verify the source version |
| 24 | + |
| 25 | +The source PostgreSQL server version must be 9.5 or later. |
| 26 | + |
| 27 | +If the source PostgreSQL version is less than 9.5, upgrade it to 9.5 or higher before you start the migration. |
| 28 | + |
| 29 | +### Install test_decoding - source setup |
| 30 | + |
| 31 | +- **test_decoding** receives WAL through the logical decoding mechanism and decodes it into text representations of the operations performed. |
| 32 | +- In EDB Extended server, the test_decoding plugin is preinstalled and ready for logical replication. This allows you to easily set up logical replication slots and stream WAL changes, facilitating use cases such as change data capture (CDC) or replication to external systems. |
| 33 | +- For more information about the test-decoding plugin, see the [PostgreSQL documentation](https://www.postgresql.org/docs/16/test-decoding.html) |
| 34 | + |
| 35 | +### Configure target setup |
| 36 | + |
| 37 | +- Before migrating, Azure Database for PostgreSQL - Flexible server must be created. |
| 38 | +- SKU provisioned for Azure Database for PostgreSQL - Flexible server should match with the source. |
| 39 | +- To create a new Azure Database for PostgreSQL, visit [Create an Azure Database for PostgreSQL flexible server](../../../../flexible-server/quickstart-create-server.md) |
| 40 | + |
| 41 | +### Enable CDC as a source |
| 42 | + |
| 43 | +- `test_decoding` logical decoding plugin captures the changed records from the source. |
| 44 | +- To ensure the migration user has the necessary replication privileges, execute the following SQL command: |
| 45 | + |
| 46 | +```sql |
| 47 | +ALTER USER <user> WITH REPLICATION; |
| 48 | +``` |
| 49 | +- Go to the EDB Extended server instance at the source, and modify the following flags: |
| 50 | + |
| 51 | + - Set flag `logical_decoding = on` |
| 52 | + - Set flag `max_replication_slots` to a value greater than one; the value should be greater than the number of databases selected for migration. |
| 53 | + - Set flag `max_wal_senders` to a value greater than one. It should be at least the same as `max_replication_slots`, plus the number of senders already used on your instance. |
| 54 | + - The flag `wal_sender_timeout` ends inactive replication connections longer than the specified number of milliseconds. Setting the value to 0 (zero) disables the timeout mechanism and is a valid setting for migration. |
| 55 | + |
| 56 | +- In the target flexible server, to prevent the Online migration from running out of storage to store the logs, ensure that you have sufficient tablespace space using a provisioned managed disk. To achieve this, disable the server parameter `azure.enable_temp_tablespaces_on_local_ssd` for the duration of the migration, and restore it to the original state after the migration. |
| 57 | + |
| 58 | +### Configure network setup |
| 59 | + |
| 60 | +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. |
| 61 | + |
| 62 | +For information about network setup, visit [Network guide for migration service](../../how-to-network-setup-migration-service.md). |
| 63 | + |
| 64 | +### Enable extensions |
| 65 | + |
| 66 | +[!INCLUDE [prerequisites-migration-service-extensions](../prerequisites/prerequisites-migration-service-extensions.md)] |
| 67 | + |
| 68 | +### Check server parameters |
| 69 | + |
| 70 | +These parameters aren't automatically migrated to the target environment and must be manually configured. |
| 71 | + |
| 72 | +- Match server parameter values from the source PostgreSQL database to the Azure Database for PostgreSQL by accessing the "Server parameters" section in the Azure portal and manually updating the values accordingly. |
| 73 | + |
| 74 | +- Save the parameter changes and restart the Azure Database for PostgreSQL to apply the new configuration if necessary. |
| 75 | + |
| 76 | +### Check users and roles |
| 77 | + |
| 78 | +When migrating to Azure Database for PostgreSQL, it's essential to address the migration of users and roles separately, as they require manual intervention: |
| 79 | + |
| 80 | +- **Manual migration of users and roles**: Users and their associated roles must be manually migrated to the Azure Database for PostgreSQL. To facilitate this process, you can use the `pg_dumpall` utility with the `--globals-only` flag to export global objects such as roles and user accounts. Execute the following command, replacing `<<username>>` with the actual username and `<<filename>>` with your desired output file name: |
| 81 | + |
| 82 | + ```sql |
| 83 | + pg_dumpall --globals-only -U <<username>> -f <<filename>>.sql |
| 84 | + ``` |
| 85 | + |
| 86 | +- **Restriction on superuser roles**: Azure Database for PostgreSQL doesn't support superuser roles. Therefore, users with superuser privileges must have those privileges removed before migration. Ensure that you adjust the permissions and roles accordingly. |
| 87 | + |
| 88 | +By following these steps, you can ensure that user accounts and roles are correctly migrated to the Azure Database for PostgreSQL without encountering issues related to superuser restrictions. |
| 89 | + |
| 90 | +### Disable high availability (reliability) and read replicas in the target |
| 91 | + |
| 92 | +- Disabling high availability (reliability) and reading replicas in the target environment is essential. These features should be enabled only after the migration has been completed. |
| 93 | + |
| 94 | +- By following these guidelines, you can help ensure a smooth migration process without the added variables introduced by HA and Read Replicas. Once the migration is complete and the database is stable, you can proceed to enable these features to enhance the availability and scalability of your database environment in Azure. |
0 commit comments