Re: Clone database using rsync?

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Clone database using rsync?
Дата
Msg-id 527980CB.3050302@hogranch.com
обсуждение исходный текст
Ответ на Clone database using rsync?  (sparikh <sparikh@ecotality.com>)
Список pgsql-general
On 11/5/2013 3:11 PM, sparikh wrote:
I need to clone production database to development  server ? What is the best
and simplest way to achieve that? Both my production and development
postgres versions are same. Will copy over data folder using rsync work?

if the database isn't gigenormous, on the new ssytem, I use the following, while logged on as postgres...

  1. manually create any roles and tablespaces the database requires
  2. manually create the new database owned by the proper role
  3. pg_dump -h oldhost -d dbname -Fc | pg_restore -d newdb
copying the data folder only works if you either stop the postgres server, or invoke pg_start_backup(), or use pg_basebackup [1]


[1] http://www.postgresql.org/docs/current/static/app-pgbasebackup.html



-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast

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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Clone database using rsync?
Следующее
От: matt@byrney.com
Дата:
Сообщение: Re: Clone database using rsync?