Manual:Upgrading PostgreSQL

Upgrading your version of Postgres that is running MediaWiki is fairly simple, except when moving to 8.3 from a lesser version. The Postgres versioning system consists of three number: major, minor, and revision. If either the major or the minor number has changed, it is considered a major upgrade, otherwise it is a simple binary upgrade.

Binary upgrade
A binary upgrade is when you are moving from one revision to another, for example from 8.2.7 to 8.2.8. No database dump is required. The steps to install the new version are:


 * 1) Run 'make' if you are installing from source
 * 2) Stop the database
 * 3) Install the new binaries via 'make install' or your package management system
 * 4) Start the database

You may also need to restart Apache to make sure it gets fresh connections to the database. Visit the Special:Version page to make sure you are now running the newer version.

Major upgrades
When going from one major version to another, a dump and restore of the database is required. Here are the basic steps:


 * 1) Set your wiki as read-only mode
 * 2) Dump the database using the pg_dumpall utility.
 * 3) Install the new version ('make install' or your packaging system)
 * 4) Create a new data directory with initdb
 * 5) Customize your postgresql.conf file based on the old one, and update pg_hba.conf if needed
 * 6) Import the new database by running psql -f dumpfile_you_made_above

If you got no errors, you should be able to restart Apache, and put the wiki back into read/write mode.