Skip to content

Instantly share code, notes, and snippets.

@jastkand
Last active August 29, 2015 14:21
Show Gist options
  • Save jastkand/b4b4993a8caace15fff4 to your computer and use it in GitHub Desktop.
Save jastkand/b4b4993a8caace15fff4 to your computer and use it in GitHub Desktop.
Upgrade PostgreSQL from 9.3 to 9.4

Upgrade steps were taken from this article.

sudo service postgresql stop 9.3

sudo service postgresql stop 9.4

sudo su - postgres

/usr/lib/postgresql/9.4/bin/pg_upgrade -b /usr/lib/postgresql/9.3/bin/ -B /usr/lib/postgresql/9.4/bin/ -d /var/lib/postgresql/9.3/main -D /var/lib/postgresql/9.4/main -o ' -c config_file=/etc/postgresql/9.3/main/postgresql.conf' -O ' -c config_file=/etc/postgresql/9.4/main/postgresql.conf'

exit

Change port to 5433 (line 62)

sudo vi /etc/postgresql/9.3/main/postgresql.conf

Change port to 5432

sudo vi /etc/postgresql/9.4/main/postgresql.conf

Start postgresql 9.4

sudo service postgresql start 9.4

Now you can remove postgresql 9.3 if you need

sudo apt-get remove postgresql-9.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment