5

I am trying to move a database from my old server to a new server. Any help would be appreciated.

2
  • 1
    The right answer to this question depends a lot of the size of your database. but dumprestore is most like the correct answer. Commented Aug 17, 2010 at 3:21
  • What is the size of your database? How big downtime window you can have? Commented May 5, 2012 at 8:24

2 Answers 2

14

Just pipe a dump from the old server into the new one:

pg_dump -h 172.26.76.100 -p 5432 -U username your_db | psql -h localhost -p 5432 -U username your_db 

Replace the ip addresses and there you go. If you're using different versions of PostgreSQL, make sure you use pg_dump and psql from the latest version.

Sign up to request clarification or add additional context in comments.

1 Comment

pg_dumpall will get everything. He should make sure he uses roles that are superusers to get everything.
2

Dump it on the first server and restore it on the second, using either the command line tools or something loke pgAdmin.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.