pg_upgrade
upgrades PostgreSQL to a new major version in place
TLDR
Upgrade cluster
$ pg_upgrade -b [old_bindir] -B [new_bindir] -d [old_datadir] -D [new_datadir]
Check compatibility$ pg_upgrade -c -b [old_bin] -B [new_bin] -d [old_data] -D [new_data]
Upgrade with link mode$ pg_upgrade -k -b [old_bin] -B [new_bin] -d [old_data] -D [new_data]
SYNOPSIS
pg_upgrade [options]
DESCRIPTION
pg_upgrade upgrades PostgreSQL to a new major version in place. Faster than dump/restore for large databases. Preserves data files when possible.
PARAMETERS
-b, --old-bindir dir
Old PostgreSQL binaries.-B, --new-bindir dir
New PostgreSQL binaries.-d, --old-datadir dir
Old data directory.-D, --new-datadir dir
New data directory.-c, --check
Check only, don't upgrade.-k, --link
Use hard links (faster).
SEE ALSO
pg_dump(1), pg_restore(1)
