36.6. Migration of BiHA Clusters #
You can migrate your current BiHA cluster running Postgres Pro Enterprise 17.X (but not higher than 17.7) to the latest version of Postgres Pro Enterprise 18.
For clarity, this procedure refers to the current BiHA cluster you are migrating as the “old cluster” and the upgraded BiHA cluster as the “new cluster”.
During migration, PPEM creates the new cluster leader and then moves followers from the old cluster to the new one. The new cluster receives all updates from the old cluster via logical replication, while the old cluster leader remains accepting client connections during almost the whole migration process. A minimal downtime is required to reconfigure your client connections to target the new cluster.
The migration procedure consists of the following steps:
Examine the Prerequisites section and make all required preparations.
Start the migration process. At this stage, client applications can continue operation with the old cluster leader.
Finish the migration process. At this stage, both the old and new clusters are temporarily unavailable for client connections until you reconfigure your client applications to target the new cluster.
36.6.1. Prerequisites #
Schedule a maintenance window to perform the migration procedure. Although the old cluster leader remains operational and continues accepting client connections during almost the whole migration process, at the end of migration you must disable workloads on the old leader and reconfigure your application and client connections to target the new cluster. This action requires minimal downtime of cluster operation.
Ensure that all conditions listed in Prerequisites and Considerations are met.
Prepare a separate additional server that will be used to deploy the leader of the new cluster running Postgres Pro Enterprise 18.X. The operating system and Postgres Pro Enterprise binaries installed on the additional server must be the same as those installed on the nodes of the old cluster.
On all old cluster nodes and the additional server, install Postgres Pro Enterprise 18.X.
For the old leader, fulfill the following:
Set the wal_level value to
logical.Set the biha.nquorum value higher than the number of cluster nodes to ensure there is no switchover during migration.
Consider all logical replication restrictions during the whole migration process.
Restrict DCL and DDL operations during the whole migration process.
Ensure that primary keys are present in all tables being updated.
36.6.2. Starting Migration #
In the navigation panel, go to Infrastructure → Clusters.
Click
→ Upgrade to Postgres Pro 18 next to the cluster.
Specify parameters for the new cluster leader:
Server: The additional server prepared in advance to host the new cluster leader.
Logical replica data directory: The PGDATA directory of a logical replica running Postgres Pro Enterprise 17.X. This logical replica is further upgraded to Postgres Pro Enterprise 18.X and converted into the new cluster leader. The directory must not exist.
Upgraded leader data directory: The PGDATA directory of the new cluster leader running Postgres Pro Enterprise 18.X. The directory must not exist.
Upgraded leader port: The new cluster leader port for incoming connections.
Upgraded leader BiHA port: The port of the new cluster leader used to exchange service information between nodes.
Specify parameters for followers to move:
Use the same data directory path for all followers: Turn off this toggle if you do not want to use identical paths to data directories for all followers.
Upgraded follower data directory: The directory where the follower running Postgres Pro Enterprise 18.X is moved. The directory must not exist. If paths to data directories are not identical for all nodes, specify the path for each follower.
Click Next.
When all checks are passed, click Start upgrade.
The migration process starts. At this stage, client applications can continue operation with the old cluster leader.
(Optional) To monitor the progress of the cluster upgrade starting operation, in the navigation panel, go to Tasks console → Operations.
When the cluster upgrade operation status changes to Complete, finish the migration procedure.
36.6.3. Finishing Migration #
During migration, the new cluster named upgraded running the upgraded Postgres Pro Enterprise version appears in the Clusters list. All nodes from the old cluster, except the old cluster leader, are moved to the new cluster. The old cluster now contains only the old leader which continues operation and accepts client connections until you complete the migration process manually. old_cluster_name
To finish the migration process:
In the navigation panel, go to Infrastructure → Clusters.
Ensure that the old cluster state is Waiting for upgrade completion.
Disconnect your client applications from the old cluster.
At this stage, both the old cluster and the new cluster are not available for client connections.
Next to the old cluster, click
→ Complete upgrade.
(Optional) To monitor the progress of the cluster upgrade finishing operation, in the navigation panel, go to Tasks console → Operations.
When the status of the cluster upgrade finishing operation changes to Complete, reconfigure your client applications to target the new cluster.
The old cluster, which now contains only the old leader node, remains in the cluster list. You can delete it if required.