Postgresql – How to use pg_upgrade on arch linux

arch-linuxpostgresql

I was running postgres 8.4 on arch but now have 9 installed I want to use pg_upgrade to upgrade but I don't know what all the options I have to use are, and all the directories that I have to point it to. it asks for a previous pg binary directory… but that's gone. Will it still work? note: I've no important data, just play db's I just want to know how to do it.

Best Answer

I'm sure you've read the documentation but just in case you haven't - "F.32. pg_upgrade".

The step-by-step instructions are especially detailed.

As a minumum you need to provide values for --old-datadir, --new-datadir, --old-bindir and --new-bindir options.

If your old installation is missing you could always (I hope so, I've never used Arch Linux) re-install it without overwriting the old data directory. If your distribution doesn't facilitate that you could re-install (temporarily) the old version from source.

Then you could run pg_upgrade. Remember to configure the two co-existing installations (the new one and the old one) to use different ports. And also set (temporarily) the local access method for both to "trust".