I have a PostgreSQL v7.3 installation that I need to migrate with a minimum of fuss to a newer, resource-rich and much faster machine that already has PostgreSQL 9.1.13 installed. I have the source code to the version of v7.3 that I was using, which, if compiled and installed (easy enough) would make it dead-simple (assuming prying 9.1.13 out of there first isn't a problem), but I'd prefer to use the newer version if possible.
I have the v7.3 pgsql directory on the new machine as a copy from the older machine, not presently associated with the PostgreSQL on this one.
There are a lot of databases in the datasets, some of them archival in the sense that they've not been used in years, but I would very much like to retain them.
None of them use triggers; they're pretty basic. Tables with columns, a few indexes each.
I know you can output one DB to SQL and then feed it to the new installation, but that feels very formidable, detail-intensive and time-consuming to me.
Is there a one-shot way to get this done?
pg_dump/pg_restorea try before you go looking for alternatives. They do essentially "output one DB to SQL and then feed it to the new installation," but generally aren't "very formidable, detail-intensive and time-consuming".pg_upgradecould help if you were on >=8.3. Since you're not,pg_dumpall?pg_dumpas a SQL script pluspsqlis not in any way something to rule out. You can actually pipe the output ofpg_dumptopsqlso no intermediate files are necessary. This can be automated using a shell script. Given the ancient source version I doubt that there is any other way of doing that - you most definitely can not use the existing data directory for anything else than 7.3pg_dumpallwas exactly what I was looking for. All databases migrated successfully, two trivial steps. Awesome. Make it an answer instead of a comment, and I'll vote it up. If not, well, I voted your comment up. :)