pg_upgrade
Application
pg_upgrade
Allows upgrade from a previous release without reloading data
1998-10-04
pg_upgrade
pg_upgrade [-f input_file] old_data_dir
1998-10-04
Description
pg_upgrade
is a utility for upgrading from a previous
PostgreSQL release without reloading all the data. First,
to be safe, back up your data directory. Then, use:
% pg_dumpall -s -z >db.out
to dump out your old database definitions without any
data. Stop the postmaster and all backends.
Then rename (using mv) your old pgsql /data directory to
/data.old and do a make install to install the new binaries.
Run initdb to create a new template1 database containing the system
tables for the new release. Start the new postmaster, cd to the
pgsql main directory, and type:
% pg_upgrade -f db.out data.old
The system will do some checking to make sure everything
is properly configured, and run your db.out script to create
all the databases and tables you had, but with no
data. It will then move the data files from /data.old
into the proper /data directory. You can then check out
the data. You can delete the /data.old directory when you
are finished.