I\'ve got my own machine with postgres dmp file, which I want to restore on the remote virtual machine (e.g. ip is 192.168.0.190 and postgres port is 5432) in my network. Is
I run this and works to me:
scp backup.dump user@remotemachine:~ ssh user@remotemachine "pg_restore -h localhost -p 5432 -U databaseuser -W -F c -d databasename -v backup.dump"
You can write a script to automate this.