How to move a Postgres database from one server to another.

1. SSH to server where the current database resides and sudo as postgres.

2. Type: sudo su - postgres

3. Type: pg_dump dbase-name > dbase-name.sql (this exports the database to a text file)

4. Type: sftp yourid@targetserver

5. Open the pgAdmin utility from within Windows.

6. Create a new database with the name you want to use, on the server you want it on. This will be what you export the text file into.

7. Open a terminal session on the target server and sudo as root.

8. Move to the directory where you copied the exported text file.

9. Type: psql dbasename < dbase-name.sql

10. Type: quit