Upgrade PostgreSQL 9.1 to 9.3 on Ubuntu 12.04
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 -y | |
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'" | |
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'" | |
sudo su - postgres -c "service postgresql stop" | |
sudo su - postgres -c '/usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.3/main/ -O "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"' | |
sudo apt-get remove postgresql-9.1 -y | |
sudo sed -i "s:5433:5432:g" /etc/postgresql/9.3/main/postgresql.conf | |
sudo service postgresql restart |
This comment has been minimized.
This comment has been minimized.
I found that this command has error.
because it tries to run:
You can see this error in log:
Therefore I updated it to be like this:
|
This comment has been minimized.
This comment has been minimized.
Cool! Thanks! |
This comment has been minimized.
This comment has been minimized.
I lost my data -_- |
This comment has been minimized.
This comment has been minimized.
good ! thnks @ibussieres and @pinglamb |
This comment has been minimized.
This comment has been minimized.
Yes, thank you @ibussieres and @pinglamb... ran into the same issue and the updated command resolved it! |
This comment has been minimized.
This comment has been minimized.
Only the install user can be defined in the new cluster |
This comment has been minimized.
This comment has been minimized.
Thanks to @ibussieres for the script and @pinglamb for the fix. |
This comment has been minimized.
This comment has been minimized.
Awesome! Helped me to upgrade from 9.2 to 9.3 |
This comment has been minimized.
This comment has been minimized.
supercool ! |
This comment has been minimized.
This comment has been minimized.
Amazing! Helped me to upgrade from 9.2 to 9.3 |
This comment has been minimized.
This comment has been minimized.
Worked for me :) |
This comment has been minimized.
This comment has been minimized.
I tried it to upgrade 9.3 to 9.6, and it worked! Thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Awesome ...It worked Great !