Re: how to replicate a database from one machine to the other?

Поиск
Список
Период
Сортировка
От Shane Ambler
Тема Re: how to replicate a database from one machine to the other?
Дата
Msg-id 486308B9.8040503@Sheeky.Biz
обсуждение исходный текст
Ответ на how to replicate a database from one machine to the other?  ("P Kapat" <kap4lin@gmail.com>)
Ответы Re: how to replicate a database from one machine to the other?  ("P Kapat" <kap4lin@gmail.com>)
Список pgsql-novice
P Kapat wrote:
> A total novice here!
>
> Machine A: Kubuntu 8.04 has the required database under user userA
> Machine B: RHEL 5 is the destination machine with userB
>
> I want to transfer the entire database under userA from machine A to
> user B under machine B. Is that possible?
>
Yes.

If the MachineB postgres version is older then you may have problems.

MachineA
pg_dump machineadb > madb.sql

copy madb.sql across to machineB

MachineB
psql < madb.sql

This would make a copy of the database named machineadb, if you want
every db on the server then you can use pg_dumpall

You may need options like -U -h and -W (username/host/prompt for
password) man psql or man pg_dump for more detail

Feel free to compress the file to reduce transfer times etc.

You can also reduce it to one step -

pg_dump machineadb | psql -h remotename


--

Shane Ambler
pgSQL (at) Sheeky (dot) Biz

Get Sheeky @ http://Sheeky.Biz

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

Предыдущее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: yum repos problem
Следующее
От: Shane Ambler
Дата:
Сообщение: Re: editing pg_hba.conf