The official documentation for PostgreSQL provides a guide to upgrading using pg_upgrade
. However, it can be a bit like a treasure hunt with hidden traps. This gist will walk you through a clear and robust method for upgrading PostgreSQL on Windows, using the upgrade from version 14 to 16 as an example.
Before you embark on the upgrade journey, make sure you have the new version installed. This is because the pg_upgrade
utility used during the upgrade process belongs to the newer version.
To get started, visit the official download page, download the installer, and run it. A word of caution: do not overwrite the old installation, as you'll need its binaries and data for the upgrade.