<div dir="ltr"><div>I thought it might be a good idea to submit this procedure... it is required with </div><div>every major PostgreSQL upgrade.  Probably should also be in the release notes, but</div><div>the cookbook would be good also.</div><div><br></div>Here is the link:  <a href="https://goo.gl/T9H7mM">https://goo.gl/T9H7mM</a><br><div><br></div><div>Here are the contents:</div><div><pre class="" style="font-family:&#39;Courier New&#39;,Courier,monospace,arial,sans-serif;font-size:14px;margin-top:0px;margin-bottom:0px;white-space:pre-wrap;word-wrap:break-word;color:rgb(0,0,0)">&lt;!-- Do not edit above this line --&gt;
&lt;!-- 
Please provide some information so we can give you credit:
name: Gerald Cox
fas_id: gbcox
email: <a href="mailto:gbcox@bzb.us">gbcox@bzb.us</a>
--&gt;

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:

&gt; dnf install postgresql-upgrade

2. Become user postgres:

&gt; sudo su - postgres

3. Rename the data directory:  

&gt; mv /var/lib/pgsql/data/ /var/lib/pgsql/data_9.3/

4. As root, initialize your 9.4 database:  

&gt; sudo postgresql-setup initdb

5. As user postgres, Copy your pg_hba.conf:  

&gt; 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 &quot;md5&quot; to &quot;trust&quot; in both pg_hba.conf files

&gt; vim /var/lib/pgsql/data_9.3/pg_hba.conf
&gt; vim /var/lib/pgsql/data/pg_hba.conf

7.  Run the upgrade process:  

&gt; pg_upgrade -b /usr/lib64/pgsql/postgresql-9.3/bin/ -B /usr/bin/ -d data_9.3/ -D data

8. Change &quot;trust&quot; to md5&quot; if you changed in step 6

&gt; vim /var/lib/pgsql/data/pg_hba.conf

9. Enable your postgresql.service:  

&gt; 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

&gt; ./analyse_new_cluster.sh

12. Run the delete_old_cluster.sh script as suggested

&gt; ./delete_old_cluster.sh

References:

* [Upstream Documentation](<a href="http://www.postgresql.org/docs/9.0/static/migration.html">http://www.postgresql.org/docs/9.0/static/migration.html</a>) &quot;Migration Between Releases&quot;
* [The Shiny Object](<a href="https://tso.bzb.us/2015/05/postgresql-upgrade-fedora-22.html">https://tso.bzb.us/2015/05/postgresql-upgrade-fedora-22.html</a>) &quot;PostgreSQL Upgrade Fedora 22&quot;</pre></div><div><br></div></div>