Alex <alex@meerkatsoft.com> writes:
> Hi,
>
> I have a test system that is setup the same as a production system and
> would like to frequently copy the database over.
> pg_dump takes a few hours and even sometimes hangs.
>
> Are there any reasons not to simply just copy the entire data
> directory over to the test system? I could not find any postings on
> the net suggesting otherwise. Is there anything to pay attention too ?
If the two systems are the same architecture and OS, this can work,
but in order to get a consistent copy, you need to either:
a) Stop (completely shut down) the source database while the copy
runs, or
b) Use volume management and take a snapshot of the source database,
them copy the snapshot over. This will lose open transactions but
will be otherwise consistent.
-Doug