Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm planning to transfer a ~100GB Postgres database to a new server. Is it save to just copy the data directories to the new server and start up the database there, or do I need to do a dump on the first server and then a restore on the second?

The first server's database partition is about 120GB, the second's is 1TB. Both servers are running the same version of postgres on debian and are connected by 1GB ethernet. Are there any differences between the two methods to transfer the database? What would be the fastest (least downtime) way to transfer the data to the new server?

share|improve this question
up vote 3 down vote accepted

As long as they're the same architecture, then you should be fine shutting down then rsyncing the files.

share|improve this answer
The fastest way will be to rsync it first, with the server running, then shutting it down and rsyncing again. – Magnus Hagander Oct 30 '09 at 10:42

You might also consider doing a dump and import of the database. You can target the dump to go to the new partition (perhaps via NFS mount).

Otherwise, @Matt's solution is good.

share|improve this answer

This migration is probably already complete but I thought I might chime in anyway.

It will take longer to prep & setup but you can transfer the data by setting up replication between the 2 servers. You could use bucardo, londiste, or slony. This will minimize downtime vs. rsync. In my experience it can take several minutes for rsync to compare disk blocks between the source & target hosts once the files to be rsync'd are over 10GB in size.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.