Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 86C956323FE for ; Mon, 19 Jul 2010 13:07:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 00930-06 for ; Mon, 19 Jul 2010 16:07:20 +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 203D5631AB8 for ; Mon, 19 Jul 2010 13:07:19 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 19 Jul 2010 11:07:19 -0500 Message-Id: <4C4431DE02000025000338CC@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 19 Jul 2010 11:07:10 -0500 From: "Kevin Grittner" To: "DAYSE ENGEMANN" , "pgsql-admin@postgresql.org" Subject: Re: How to move a database from HP server to Linux Server that had already one database. References: <5FCE2C21B63D86478DBA823B3A27B40149CF10495A@GVW1341EXA.americas.hpqcorp.net> <4C4054CC020000250003374F@gw.wicourts.gov> <5FCE2C21B63D86478DBA823B3A27B40149CF10498D@GVW1341EXA.americas.hpqcorp.net> <4C405A9B020000250003375C@gw.wicourts.gov> <5FCE2C21B63D86478DBA823B3A27B40149CF1049B4@GVW1341EXA.americas.hpqcorp.net> <5FCE2C21B63D86478DBA823B3A27B40149CF104D6D@GVW1341EXA.americas.hpqcorp.net> In-Reply-To: <5FCE2C21B63D86478DBA823B3A27B40149CF104D6D@GVW1341EXA.americas.hpqcorp.net> 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=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/138 X-Sequence-Number: 35157 "ENGEMANN, DAYSE" wrote: > If I use the : > Origim: pg_dump -Ft -b db_name > file.tar > Target: pg_restore -d new_db file.tar > > The target server has a db, using PGDATA=/postgres, the same in > the other server... There is any risk to lost any data? Restoring to a new database should not put the data in pre-existing databases at risk. I wouldn't recommend the tar format for your dump, though -- I've had better luck with custom if I want a "structured" dump from which I can selectively restore. If you want the whole thing, and don't need an intermediate copy (two big "ifs", I know), you could do something like this on the target machine: pg_dump -h sourcemachine -U sourceuser dbname | psql dbname -Kevin