I need to backup a postgres DB which is located on a remote server. This server also hosts a lot of other stuff, and that’s why I don’t have a general access to the server itself. Therefore I believe that I can not use
ssh to access the remote server and run
pg_dump from there. (Please correct me if I am wrong -regarding
pg_dump ) The only thing I can do is write and read the DB via a DB connection (which is allowed through the firewall.)
What is the best approach of backing up such DB?
pg_dump, but I don’t think it’ll work under such conditions.
If you can’t ssh in, then you can’t ssh in. We can’t know if you really can or not, we have no direct access to the mind of God, nor to your company’s networking equipment.
pg_dump and pg_basebackup both have an
-h option, which allows them to connect to a remote host through a db connection. So if you can establish database connections, you can at least attempt to use them. The database connection might be configured with insufficient permissions for these to succeed, but after trying it at least you can read the error message and then you will know.
I tried pg_dump, but I don’t think it’ll work under such conditions.
So, what happened?