Dump a remote postgres database and restore it into a local postgres database. This method dumps first into a local file, then restores into the database. The reason for doing it this way over piping the data straight into the database locally is that if there is an error in the import you don’t have to start over again. Which is likely to happen if you haven’t created the database first.
/usr/bin/pg_restore -U postgres_user-W -F c -v -c -O -d db_name “/tmp/db_name.backup”
In: Server Config, Web Development · Tagged with: database, pg_dump, pg_restore, postgresql, psql, remote server