diff --git a/doc/src/sgml/ref/pg_upgrade.sgml b/doc/src/sgml/ref/pg_upgrade.sgml index 78f67cb9a4..c2225c24f0 100644 --- a/doc/src/sgml/ref/pg_upgrade.sgml +++ b/doc/src/sgml/ref/pg_upgrade.sgml @@ -1,5 +1,5 @@ @@ -20,17 +20,16 @@ Postgres documentation - 1999-07-20 + 1999-07-31 -pg_upgrade pg_upgrade [ -f filename ] old_data_dir - 1998-10-04 + 1999-07-31 Description @@ -40,54 +39,66 @@ pg_upgrade [ -f <replaceable class="parameter">filename</replaceable> ] <replace <application>pg_upgrade</application> is a utility for upgrading from a previous PostgreSQL release without reloading all the data. - Not all <productname>Postgres</productname> releases can be handled - this way; check the release notes for details on your installation. + Not all <productname>Postgres</productname> release transitions can be + handled this way; check the release notes for details on your installation. </para> <procedure> - <title>Upgrading <productname>Postgres</productname> + Upgrading <productname>Postgres</productname> with pg_upgrade - Back up your data directory. + Back up your existing data directory, preferably by making a + complete dump with pg_dumpall. - Use: + Do % pg_dumpall -s >db.out - to dump out your old database definitions without any - data. Stop the postmaster and all backends. + to dump out your old database's table definitions without any data. - Rename (using mv) your old pgsql data/ directory to + Stop the old postmaster and all backends. + + + + + + Rename (using mv) your old pgsql data/ directory to data.old/. - Do a - make install to install the new binaries. + Do + +% make install + + to install the new binaries. - Run initdb to create a new template1 database containing the system - tables for the new release. + Run initdb to create a new template1 database + containing the system tables for the new release. - Start the new postmaster. + Start the new postmaster. (Note: it is critical that no users connect + to the database until the upgrade is complete. You may wish to start + the postmaster without -i and/or alter pg_hba.conf + temporarily.) @@ -98,22 +109,36 @@ pg_upgrade [ -f filename ] % pg_upgrade -f db.out data.old - The system will do some checking to make sure everything - is properly configured, and will 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. + The program will do some checking to make sure everything is properly + configured, and will run your db.out script to recreate all the databases + and tables you had, but with no data. It will then physically move the + data files containing non-system tables and indexes from + data.old/ into the proper + data/ subdirectories, replacing the empty data files + created during the db.out script. - Carefully examine the contents of the upgraded database. + Carefully examine the contents of the upgraded + database. If you detect problems, you'll need to recover by restoring + from your full pg_dump backup. + The upgraded database will be in an un-vacuumed state. You will probably + want to run a VACUUM ANALYZE before beginning + production work. + + + + + + Restart the postmaster and/or restore your old + pg_hba.conf if needed to allow user logins. You can delete the data.old/ directory when you are finished.