Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B68A8632B61 for ; Tue, 10 Aug 2010 14:06:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 23067-08 for ; Tue, 10 Aug 2010 17:06:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id AE322632A8E for ; Tue, 10 Aug 2010 14:06:48 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 10 Aug 2010 12:06:41 -0500 Message-Id: <4C6140CD0200002500034425@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 10 Aug 2010 12:06:37 -0500 From: "Kevin Grittner" To: "Craig James" , Subject: Re: How to move a database from HP server to Linux Server that had already one database. References: <201008100014.o7A0Enb03841@momjian.us> <4C617F79.4010002@emolecules.com> In-Reply-To: <4C617F79.4010002@emolecules.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.51 tagged_above=-10 required=5 tests=BAYES_50=0.8, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/65 X-Sequence-Number: 35314 Craig James 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