Migrating databases...

Started by William D. Tallmanover 23 years ago2 messagesgeneral
Jump to latest
#1William D. Tallman
wtallman@olypen.com

I'm posting to c.d.p.general, rather than to novices or questions, because I'm
using google and it's the only one for which I'm registered.

I'm having difficulty because the situation is not straightforward, and I can't
seem to sort out what has to be done. So I'd appreciate it if someone would
provide a step by step procedure for me.

I'm running Mandrake 8.2, which has postgresql-7.2.1. It is installed and is
started at boot. I have a small database that I developed when I ran 8.0,
which had postgresql-7.0.3. The 8.0 installation is damaged, such that no users
are accepted, and so I can't run the 7.0.3 version there to dump the database.

So I got the source for 7.0.3 and installed it in 8.2 at the /usr/local level.
All the files are where they are supposed to be, and I'm ready to get the thing
running so I can dump the database (copied over to $HOME in 8.2 from the 8.0
installation).

I read that I can have both versions running in parallel, and that there is a
simple command line that will make the database conversion. Unfortunately,
I don't know how to start the 7.0.3 without invoking the 7.2.1. I'm willing
to start over if necessary ('gmake uninstall && gmake clean && ./configure &&
gmake && gmake install', or so I would imagine).

So you see, I'm not exactly upgrading the database with a new installation here,
but rather (re)installing the old version, hopefully providing it with the data
base to dump, and then restoring it to the already installed new version. And I
am unable to see clearly how to proceed.

I'd be appreciative and thankful for some help here!

Bill Tallman

#2Lee Harr
missive@frontiernet.net
In reply to: William D. Tallman (#1)
Re: Migrating databases...

So I got the source for 7.0.3 and installed it in 8.2 at the /usr/local level.
All the files are where they are supposed to be, and I'm ready to get the thing
running so I can dump the database (copied over to $HOME in 8.2 from the 8.0
installation).

I read that I can have both versions running in parallel, and that there is a
simple command line that will make the database conversion. Unfortunately,
I don't know how to start the 7.0.3 without invoking the 7.2.1. I'm willing
to start over if necessary ('gmake uninstall && gmake clean && ./configure &&
gmake && gmake install', or so I would imagine).

Note: I have never tried this, but if I needed to I think I would
do something along these lines:

check out man postmaster and man pg_dump, then
I think I would try something like this:

/usr/local/pgsql7.0.3/bin/postmaster -i -p 5433 -D /usr/local/pgsql7.0.3/data &

/usr/local/pgsql7.0.3/bin/pg_dump -h localhost -p 5433 dbToDumpName > dumpFile

Notice that you should probably specify these path names absolutely
so that you can be sure you are getting the right ones.

I was doing it this way because I could not see from pg_dump's man page
how to get it to connect via socket to a different postmaster
(the -D switch seems to do something completely different there)