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

Поиск
Список
Период
Сортировка
От ENGEMANN, DAYSE
Тема Re: How to move a database from HP server to Linux Server that had already one database.
Дата
Msg-id 5FCE2C21B63D86478DBA823B3A27B40149CF104DC5@GVW1341EXA.americas.hpqcorp.net
обсуждение исходный текст
Ответ на Re: How to move a database from HP server to Linux Server that had already one database.  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: How to move a database from HP server to Linux Server that had already one database.  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: How to move a database from HP server to Linux Server that had already one database.  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-admin
Hi Kevin,
Sorry to disturb you.. But I am really new in it...
Let me see if I understood...

 pg_dump -h sourcemachine -U sourceuser source_dbname | psql target_dbname

Is that?

The data will be import in the existing db?

-----Original Message-----
From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
Sent: segunda-feira, 19 de julho de 2010 13:07
To: ENGEMANN, DAYSE; pgsql-admin@postgresql.org
Subject: RE: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

"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
formatfor your dump, though -- I've had better luck with custom if I want a "structured" dump from which I can
selectivelyrestore.  If you want the whole thing, and don't need an intermediate copy (two big "ifs", I know), you
coulddo something like this on the target machine: 

pg_dump -h sourcemachine -U sourceuser dbname | psql dbname

-Kevin

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Weird sorting order
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: How to move a database from HP server to Linux Server that had already one database.