Distupgrading debian etch to lenny, and upgrading postgres 8.1 to 8.3

Pretty straight forward.
Edit your /etc/apt/sources.list. Substitute “etch” with “lenny”.

apt-get update
apt-get dist-upgrade

This will upgrade the system to lenny. Verify with
cat /etc/debian_version

The upgrade will not upgrade postgres. You need to do this manually.
apt-get install postgresql
8.3 will now be installed and configured to run on another port. 8.1 will still remain on your system, and you need to manually migrate your 8.1 bases to 8.3. Thankfully they provide some scripts for this.Here’s how you do it.
First drop the automatically created cluster for 8.3

g_dropcluster --stop 8.3 main

then upgrade the 8.1 cluster to 8.3

pg_upgradecluster -v 8.3 8.1 main

This should change the 8.1 config to run on another port while 8.3 should be running on default.
Prolly smart to stop 8.1, start 8.3 and verify that you’re databases are working as they should ..before you go ahead and remove 8.1.

If you run into some locales+postgres trouble with lenny. You should check your /etc/locale.gen, make sure the correct locales arent commented out,
and run locale-gen/dpkg-reconfigure. Then you should be able to start 8.1 again.

Tags: , , , , ,

Leave a Reply