In-place Postgres major version upgrades v5.6
You can upgrade a PGD node to a newer major version of Postgres using the command-line utility bdr_pg_upgrade.
bdr_pg_upgrade is a wrapper around the standard pg_upgrade that adds PGD-specific logic to the process to ensure a smooth upgrade.
Terminology
This terminology is used when describing the upgrade process and components involved:
Postgres cluster — The database files, both executables and data, that make up a Postgres database instance on a system when run.
Old Postgres cluster — The existing Postgres cluster to upgrade, the one from which to migrate data.
New Postgres cluster — The new Postgres cluster that data is migrated to. This Postgres cluster must be one major version ahead of the old cluster.
Precautions
Standard Postgres major version upgrade precautions apply, including the fact both Postgres clusters must meet all the requirements for pg_upgrade.
Additionally, don't use bdr_pg_upgrade if other tools are using replication slots and replication origins. Only PGD slots and origins are restored after the upgrade.
You must meet several prerequisites for bdr_pg_upgrade:
- Disconnect applications using the old Postgres cluster. You can, for example, redirect them to another node in the PGD cluster.
- Configure peer authentication for both Postgres clusters. bdr_pg_upgrade requires peer authentication.
- The same PGD version must be installed on both clusters.
- The PGD version must be 4.1.0 or later. Version 3.7.22 and later is also supported.
- The new cluster must be in a shutdown state.
- You must install PGD packages in the new cluster.
- The new cluster must already be initialized and configured as needed to match the old cluster configuration.
- Databases, tables, and other objects must not exist in the new cluster.
We also recommend having the old Postgres cluster up prior to running bdr_pg_upgrade. The CLI starts the old Postgres cluster if it's shut down.
Usage
To upgrade to a newer major version of Postgres, you must first install the new version.
bdr_pg_upgrade command-line
bdr_pg_upgrade passes all parameters to pg_upgrade. Therefore, you can specify any parameters supported by pg_upgrade.
Synopsis
Options
In addition to the options for pg_upgrade, you can pass the following parameters to bdr_pg_upgrade.
Required parameters
Specify these parameters either in the command line or, for all but the --database
parameter, in their equivalent environment variable. They're used by bdr_pg_upgrade.
-b, --old-bindir
— Old Postgres cluster bin directory.-B, --new-bindir