| From: | Andreas Kretschmer <akretschmer(at)spamfence(dot)net> | 
|---|---|
| To: | pgsql-novice(at)postgresql(dot)org | 
| Subject: | Re: Copy database to another machine | 
| Date: | 2011-10-26 16:42:03 | 
| Message-ID: | 20111026164203.GA28073@tux | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-novice | 
Nuno Ferreira <nunoadferreira(at)gmail(dot)com> wrote:
> Good afternoon,
> 
> I'm trying to copy one database from one machine to another. How can I do it?
> Can I just simply copy and paste the files? I need to close the database first
> or I can copy the files with it open?  
You can do (and have to do) that while the database is up and running
with pg_dump and (on the destination) pg_restore or psql. Please read
the documentation for more information here:
http://www.postgresql.org/docs/9.1/interactive/backup.html
You CAN'T copy&paste the files!
Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Thom Brown | 2011-10-26 16:46:06 | Re: Copy database to another machine | 
| Previous Message | Dagan | 2011-10-26 14:10:43 | Re: Debian upgrade from 9.0 to 9.1? |