I thought it might be a good idea to submit this procedure... it is required with
every major PostgreSQL upgrade. Probably should also be in the release notes, but
the cookbook would be good also.
Here is the link: https://goo.gl/T9H7mM
Here are the contents:
<!-- Do not edit above this line -->
<!--
Please provide some information so we can give you credit:
name: Gerald Cox
fas_id: gbcox
email: gbcox@bzb.us
-->
PostgreSQL Upgrade - Fedora 22
==============================
Fedora 22 will upgrade your PostgreSQL database from 9.3.6 to 9.4.1
Since this is a major upgrade it will require that you upgrade your database.
Required Ingredients
--------------------------
* postgresql-upgrade
Directions
---------------
### Upgrade PostgreSQL database from 9.3.6 to 9.4.1
1. Install the upgrade utilities:
> dnf install postgresql-upgrade
2. Become user postgres:
> sudo su - postgres
3. Rename the data directory:
> mv /var/lib/pgsql/data/ /var/lib/pgsql/data_9.3/
4. As root, initialize your 9.4 database:
> sudo postgresql-setup initdb
5. As user postgres, Copy your pg_hba.conf:
> cp /var/lib/pgsql/data_9.3/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf
6. To avoid any potential password issues, temporarily change "md5" to "trust" in both pg_hba.conf files
> vim /var/lib/pgsql/data_9.3/pg_hba.conf
> vim /var/lib/pgsql/data/pg_hba.conf
7. Run the upgrade process:
> pg_upgrade -b /usr/lib64/pgsql/postgresql-9.3/bin/ -B /usr/bin/ -d data_9.3/ -D data
8. Change "trust" to md5" if you changed in step 6
> vim /var/lib/pgsql/data/pg_hba.conf
9. Enable your postgresql.service:
> sudo systemctl enable postgresql.service
10. Start your postgresql.service:
sudo systemctl start postgresql.service
11. Run the analyse_new_cluster.sh script as suggested
> ./analyse_new_cluster.sh
12. Run the delete_old_cluster.sh script as suggested
> ./delete_old_cluster.sh
References:
* [Upstream Documentation](http://www.postgresql.org/docs/9.0/static/migration.html) "Migration Between Releases"
* [The Shiny Object](https://tso.bzb.us/2015/05/postgresql-upgrade-fedora-22.html) "PostgreSQL Upgrade Fedora 22"