Instructions for a major PostgreSQL upgrade on OpenBSD. If you didn't install PostgreSQL by following README.OpenBSD, you must adapt these instructions to your setup. Most commands must be launched as the user _postgresql: # su - _postgresql 1) Backup all your data: $ pg_dumpall -U postgres > /var/postgresql/full.sqldump 2) Shutdown the server: $ pg_ctl -D /var/postgresql/data/ stop -m fast 3) As root, upgrade your PostgreSQL package with pkg_add. # pkg_add -u postgresql-server 4) Backup your old data directory: $ mv /var/postgresql/data /var/postgresql/data.old 5) Create a new data directory: $ mkdir /var/postgresql/data $ initdb -D /var/postgresql/data -U postgres -A md5 -W 6) Restore your old pg_hba.conf $ cp data.old/pg_hba.conf data/ Some postgresql.conf settings changed or disappeared in this version. Examine your old file for local changes and apply them to the new version. 7) Start PostgreSQL: $ pg_ctl -D /var/postgresql/data -l /var/postgresql/logfile start 8) Restore your data: $ psql -U postgres < /var/postgresql/full.sqldump Test your installation and if everything is ok, you can delete /var/postgresql/data.old. Now, enjoy your new PostgreSQL.