Postgresql – Transferring PostgreSQL Database Between Servers

databasedatabase-backuppostgresql

Is it possible to directly transfer a PostgreSQL database between two PostgreSQL servers?

I've currently been setting up a "development" version of my production database by using pg_dump to serialize the entire database to a file, download the file, and then using pg_restore to load the database onto the development server. However, as the database has been growing, this process is now taking hours. Is there anyway to simply "connect" the two servers and transfer the database directly, instead of this lengthy dump/download/restore process?

Best Answer

Note that I've only worked with MySQL, but PostegreSQL shouldn't be to different.

If pg_dump is anything my mysqldump, then can't you just pipe the output into pg_restore? That's the most direct and fastest way I can think of. Anything else is just more overhead