Created
October 6, 2016 16:33
-
-
Save jerryjohnjacob/ea8daec9a9e67d077e406962a8de51ac to your computer and use it in GitHub Desktop.
Easy upgrade to postgres 9.6 with data migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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