Upgrading VMware Postgres
This topic describes how to upgrade VMware Postgres from a major or a minor version.
If you are upgrading from a previous major release (like 10.x, or 11.x) follow the steps in Upgrading from an Older Major Version.
If you are upgrading from an older minor release, follow the steps in Upgrading from an Older Minor Version.
VMware Postgres 12.8 supports upgrading from a prior VMware Postgres major version (10.x, or 11.x) to 12.8. The steps rely on the open source Postgres
Existing Patroni customers that wish to move to 12.4 (and later) must follow the instructions in Migrating from Patroni High Availability to pg_auto_failover.
- Download the VMware Postgres Server RPM distribution from VMware Tanzu Network.
- Any extensions installed on the older Postgres server must be manually added to the new release. Alternatively, remove them from the older Postgres cluster before starting the upgrade.
- Confirm you have enough disk space to run
pg_upgrade. The default setting which is to copy all data files from the old to the new server. Alternatively, review the
--linkoption, that provides reduced upgrade time and disk space benefits but impacts the revert process, see Reverting to old cluster. For a list of all the pg_upgrade options see Options in the pg_upgrade Open Source Postgres documentation.
Start from step 3 in the Usage topic of the pg_upgrade Open Source Postgres documentation.
Replace the commands in step 3, Install the new PostgreSQL binaries, with the following command that installs the new VMware Postgres binaries:
$ cd ~/Downloads $ sudo yum install vmware-postgres12-12.8.0.el7.x86_64.rpm
Follow the remaining steps as outlined in pg_upgrade.
VMware Postgres 12.8 introduces some RPM packaging changes that impacts upgrades from previous 12.x versions.
The installation files location has changed from
/opt/vmware/postgres/12, and the names of the installed packages have changed from
vmware-postgres<version>. Follow these steps to upgrade from a previous 12.x release:
Install the new RPM:
$ cd ~/Downloads/vmware-postgres-12 $ sudo yum install ./vmware-postgres12-12.8-0.el7.x86_64.rpm
Update any absolute paths to the Postgres executables that reference the old installation path of
/usr. These files might be Postgres server configuration files, or any custom scripts you may have written. For example, if you have an
archive_cleanup_commandset up in
postgresql.confwith an absolute path:
archive_cleanup_command = '/usr/bin/pg_archivecleanup ... %r'
then this must be modified to either remove the absolute path or update it to the new location:
archive_cleanup_command = 'pg_archivecleanup ... %r'
archive_cleanup_command = '/opt/vmware/postgres/12/bin/pg_archivecleanup ... %r'
When ready to upgrade, update the Postgres user’s
PATHto point to the new installation. For Postgres 12, in the
~/postgres/.bash_profileadd the following line:
You can check that it has taken effect:
$ su --login postgres $ which pg_ctl /opt/vmware/postgres/12/bin/pg_ctl
Switch to the new installation by stopping and starting the server. Do not use the
restartshortcut, because it will reuse the old installation:
$ su --login postgres $ pg_ctl stop -l data/logfile $ pg_ctl start -l data/logfile
Verify that the correct versions are in use, both on the client machine and the server:
$ su --login postgres $ psql psql (12.8 (VMware Postgres 12.8.0)) Type "help" for help. postgres=# show server_version; server_version --------------------------------- 12.8 (VMware Postgres 12.8.0) (1 row)
Confirm the new server is working correctly, and remove the old server package:
$ sudo yum remove vmware-postgres