LinuxCommandLibrary

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]
copy
Check compatibility
$ pg_upgrade -c -b [old_bin] -B [new_bin] -d [old_data] -D [new_data]
copy
Upgrade with link mode
$ pg_upgrade -k -b [old_bin] -B [new_bin] -d [old_data] -D [new_data]
copy

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

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community