Skip to main content

Upgrade postgresql-8.4 to postgresql-9.1 on debian

·118 words·1 min· ·
Ubuntu Debian Dba Postgres Postgresql
Ariejan de Vroom
Author
Ariejan de Vroom
Jack of all Trades, Professional Software Craftsman

Today I upgraded a production PostgreSQL 8.4 database to version 9.1. This was on a Debian server. ~ The first step is to make a full dump of your data. I personally like to store that dump somewhere safe before upgrading. As root:

su - postgres
pg_dumpall > dump.sql
exit
cp ~postgres/dump.sql /root/

Now you can safely remove the postgresql-8.4 and install postgresql-9.1:

aptitude purge postgresql-8.4
aptitude install postgresql-9.1

Next check the postgresql configuration in /etc/postgresql/9.1/main. If you make any changes, make sure to restart postgres with /etc/init.d/postgresql restart.

Postgresql 9.1 is now up and running, let’s import our data back into it.

su - postgres
psql < dump.sql

That’s all. You’re now fully upgraded to PostgreSQL 9.1.

Related

Installing Node.js and NPM on Ubuntu/Debian
·153 words·1 min
Linux Ubuntu Debian Nodejs Devops Node Npm
How to: Compile packages on Debian/Ubuntu by hand
·240 words·2 mins
Blog Ubuntu Debian Source Code Src Package Packages Deb
How to install MySQL on Ubuntu/Debian
·272 words·2 mins
Ubuntu MySQL Debian