Re: How to move a database from HP server to Linux Server that had already one database.

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Craig James" <craig_james(at)emolecules(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How to move a database from HP server to Linux Server that had already one database.
Date: 2010-08-10 17:06:37
Message-ID: 4C6140CD0200002500034425@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Craig James <craig_james(at)emolecules(dot)com> wrote:

> If you have a slow network, then run pg_dump on the machine where
> the database lives and use compression (--format=c) and restore
> using pg_restore. It will cut WAY down on the amount of data that
> has to move across the net.

If you don't mind dancing around a bit you can ssh from the target
to the source, run pg_dump piped to gzip there, gunzip the stream on
the target side, and still pipe it into psql without having to go
through the disk write/read cycle that --format=c requires. Because
of the pain of getting all the quoting right when trying that as a
one-line bash command, I generally create a short script on the
source to do the dump and gzip. The only other pain point is the
remote password. .pgpass solves that.

-Kevin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Gaurav Singh 2010-08-10 17:31:33 psql - password authentication failed for user "singh09721"
Previous Message Craig James 2010-08-10 16:34:01 Re: How to move a database from HP server to Linux Server that had already one database.