pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: DAYSE ENGEMANN <dayse.engemann@hp.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: How to move a database from HP server to Linux Server that had already one database.
Date: Mon, 19 Jul 2010 11:07:10 -0500
Message-ID: <4C4431DE02000025000338CC@gw.wicourts.gov> (raw)
In-Reply-To: <5FCE2C21B63D86478DBA823B3A27B40149CF104D6D@GVW1341EXA.americas.hpqcorp.net>
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>

"ENGEMANN, DAYSE" <dayse.engemann@hp.com> 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



view thread (16+ messages)  latest in thread

Message-ID: <4C4431DE02000025000338CC@gw.wicourts.gov>
Permalink:  ../4C4431DE02000025000338CC@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4C4431DE02000025000338CC@gw.wicourts.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, dayse.engemann@hp.com
  Subject: Re: How to move a database from HP server to Linux Server that had already one database.
  In-Reply-To: <4C4431DE02000025000338CC@gw.wicourts.gov>
  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> <4C4431DE02000025000338CC@gw.wicourts.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox