Forums

Migrate Local psql server database to PythonAnywhere psql server

Hello,

I was able to connect my PythonAnywhere (PA) psql database to my pgadminIII. I then ran pg_dump on my local database. I was unable to get pg_restore to work with my PA psql database. Any thoughts on how to transfer to PA psql server from local server? Thank you.

What's the error that you were seeing?

This is the error I am seeing:

pg_restore: [archiver (db)] connection to database "test" failed: could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "jahmul14-217.postgres.pythonanywhere-services.com"  (10.113.166.107) and accepting
TCP/IP connections on port 10217?

To confirm, are you running this from inside of PythonAnywhere? If not, you should either take the dumped file and upload it to PythonAnywhere and run it from PythonAnywhere, or use ssh tunnelling. This is because allowing databases to be connected to over the internet is a big security risk.