![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I need to have an exact copy of a postgres install on a testing computer. I don't want to do slony. Is it feasible/reasonable to think that I could just rsync to the devel boxen from the pg server? Or is slony "The Way to Do It"(tm)? |
#3
| |||
| |||
|
|
rsync, or .tar.gz, or scp or use pg_dump. any of the copies run assuming you've shut down the DB first, and that you're using the same binaries on both boxen. |
#4
| |||
| |||
|
|
I need to have an exact copy of a postgres install on a testing computer. I don't want to do slony. Is it feasible/reasonable to think that I could just rsync to the devel boxen from the pg server? Or is slony "The Way to Do It"(tm)? |
#5
| |||
| |||
|
|
time, you can just dump and restore it: pg_dumpall -h source_server |psql -h dest_server add switches as necessary. |
|
On Thu, 2004-10-21 at 02:39, Karim Nassar wrote: I need to have an exact copy of a postgres install on a testing computer. I don't want to do slony. Is it feasible/reasonable to think that I could just rsync to the devel boxen from the pg server? Or is slony "The Way to Do It"(tm)? If you just need a working copy, not necessarily right up to date at any time, you can just dump and restore it: pg_dumpall -h source_server |psql -h dest_server add switches as necessary. |
#6
| |||
| |||
|
|
If you just need a working copy, not necessarily right up to date at any time, you can just dump and restore it: pg_dumpall -h source_server |psql -h dest_server add switches as necessary. That would be great for the first time. But what I want to do is copy ~postgresql/data, stomping/deleting as necessary. Roughly, my thinking is a daily cron job on the server: rm -rf /safe/dir/data /etc/init.d/postgresql stop tar czf - -C ~postgres data | tar xzf - -C /safe/dir/ /etc/init.d/postgresql start And a client script: /etc/init.d/postgresql stop rm -rf ~postgres/data ssh user@server tar czf - -C /safe/dir data|tar xvzf - -C ~postgres /etc/init.d/postgresql start Or something similar with rsync instead of tar. |
![]() |
| Thread Tools | |
| Display Modes | |
| |