How to move postgresql database from one computer to another?

1

I've been created an Internet service on Debian server. I want to move all data from one server to a new one. So, how can I move the postresql database? What is the best pipeline?

Vyacheslav

Posted 2015-08-16T09:20:03.473

Reputation: 147

pg_dump and pg_restore. – Craig Ringer – 2015-08-16T11:13:33.743

Answers

2

pg_dump -Fc each database, and pg_dumpall --globals-only the users, etc.

Run the dumpall script through psql to restore it. Then pg_restore each individual database dump.

Craig Ringer

Posted 2015-08-16T09:20:03.473

Reputation: 2 630

0

My own answer: In my case in old machine:

pg_dumpall > all.tar

and than in the new machine:

sudo -u postgres psql  < all.tar

helped to me.

Vyacheslav

Posted 2015-08-16T09:20:03.473

Reputation: 147