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

From: "ENGEMANN, DAYSE" <dayse(dot)engemann(at)hp(dot)com>
To: "ENGEMANN, DAYSE" <dayse(dot)engemann(at)hp(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, "pgsql-admin(at)postgresql(dot)org" <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-07-19 15:48:08
Message-ID: 5FCE2C21B63D86478DBA823B3A27B40149CF104D6D@GVW1341EXA.americas.hpqcorp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Kevin,

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?

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org [mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of ENGEMANN, DAYSE
Sent: sexta-feira, 16 de julho de 2010 15:22
To: Kevin Grittner; pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

I am not sure if I can do it in this way.. As the are in diferent servers and network.

I found a paper that suggest to use pg_dump -Ft -b db_name > file.tar .... Transfer it to new server and you ther the pg_restore -d new_db file.tar But as the servers have different SO.. I am not sure if it can be used...

And another question is that in the target server there is a database there that we can not destroy.

Thanks for your help.

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org [mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Kevin Grittner
Sent: sexta-feira, 16 de julho de 2010 15:12
To: ENGEMANN, DAYSE; pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] How to move a database from HP server to Linux Server that had already one database.

"ENGEMANN, DAYSE" <dayse(dot)engemann(at)hp(dot)com> wrote:
> Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:

>> pg_dump | psql

> And to restore it.. Can I use pg_restore -d new_db_name ??

I usually pipe the output of pg_dump to psql, and thereby avoid making a copy of the dump output entirely. If you want to dump in custom format, yeah, you would use pg_restore instead.

-Kevin

--
Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

--
Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2010-07-19 16:07:10 Re: How to move a database from HP server to Linux Server that had already one database.
Previous Message Burgholzer, Robert (DEQ) 2010-07-19 14:28:47 Re: Weird sorting order