Skip to content

Instantly share code, notes, and snippets.

@jerryjohnjacob
Created October 6, 2016 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jerryjohnjacob/ea8daec9a9e67d077e406962a8de51ac to your computer and use it in GitHub Desktop.
Save jerryjohnjacob/ea8daec9a9e67d077e406962a8de51ac to your computer and use it in GitHub Desktop.
Easy upgrade to postgres 9.6 with data migration
sudo su postgres
pg_dumpall > full_backup
exit
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib libpgsql-ruby libpgtcl-dev postgresql-server-dev-9.6
# remove older postgres installation
sudo su postgres
psql -f full_backup
# will have to manually fix template encoding afterwards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment