Re: initdb on build machine and moving to production machine

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: oberpwd(at)anubis(dot)network(dot)com (Wade D(dot) Oberpriller)
Cc: pgsql-general(at)postgresql(dot)org (general-help postgresql)
Subject: Re: initdb on build machine and moving to production machine
Date: 2001-01-12 00:13:45
Message-ID: 13268.979258425@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

oberpwd(at)anubis(dot)network(dot)com (Wade D. Oberpriller) writes:
> I want to be able to do an initdb on a build machine and then copy this new
> database to a production machine and run with it. One thing I have noticed is
> that initdb needs an absolute path, so if I copy the database it needs to
> reside in an identical location as where it was initialized.

Have you tried it? AFAIK the -D path is not actually stored anywhere,
so it seems to me this would work, assuming that (a) both machines are
of identical architectures (in fact I strongly suggest you be running
identical postgres executables), and (b) you shut down the postmaster
on the source machine while you make a copy of the $PGDATA tree.
The *whole* $PGDATA tree, mind you, don't try to be choosy. But you
should be able to restore that directory tree to a different path
if you want.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Patricia_Leong 2001-01-12 00:19:05 SQL command for value comparison
Previous Message Tom Lane 2001-01-12 00:10:01 Re: Re: Loading optimization