Upgrade between PostgreSQL versions
Created by Gustaf Neumann, last modified by Gustaf Neumann 20 Sep 2016, at 02:06 PM
The probably easiest way to upgrade between PostgreSQL versions is as follows (described here from 9.4 to 9.5, based on the directory structure as provided by Mac Ports)
DATE=`date +"%Y-%m-%d"` # Dump all databases from pg 9.4 PGBIN=/opt/local/lib/postgresql94/bin sudo -u postgres $PGBIN/pg_dumpall | gzip -9 > ~/pg-dump-all-$DATE.gz
Then stop pg 9.4, start pg 9.5, then reload the dump:
# Restore all databases and roles from dump into pg 9.5 PGBIN=/opt/local/lib/postgresql95/bin gunzip < ~/pg-dump-all-$DATE.gz | $PGBIN/psql -U postgres
voilà, start OpenACS, and everything works fine.
In case there is a problem with restoring the dump in PostgreSQL 9.5 due to the "=>" operator of hstore, one has to update the version of hstore at least to 1.1 before dump/restore (the current version of hstore is 1.4; for details see hstore-upgrade).
In case, you want to upgrade your legacy OpenACS installation from PostgreSQL 8.* to 9, read upgrade-oacs-5-8.