PostgreSQL migration and restore

110 views Asked by At

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?

1

There are 1 answers

1
Jay Kominek On BEST ANSWER

pg_dump is the normal answer for a single database, pg_upgrade does an entire cluster on the same machine, but only works with >=8.3. Failing all of that, pg_dumpall will pg_dump all the databases on a server into a single output stream.