$ pg_dump -Fc -d DBNAME -f DBNAME.dump
Replace DBNAME with the name of your database.
pg_restore -O -d DBNAME -h SERVER_IP -W DBNAME.dump -U postgres
Replace DBNAME with the name of your database and SERVER_IP with the IP address of your server.