When I attempt to run system backups I get: “The backup failed. Please check the logs.”
The log reports:
pg_dump: [archiver (db)] connection to database "discoursedb" failed: could not connect to server: Connection refused
I believe there may be two problems at play:
- The remote server is running on a non-standard port.
- The remote PostgreSQL is running a newer PSQL version.
When I enter the app (
/var/discourse/launcher enter app) and execute a manual backup, I noted that initially without the port definition, I got the exact same error:
$ pg_dump -h 123.456.789.101 -U username -W -F t discourse_db > discourse_db_backup.tar Password: pg_dump: [archiver (db)] connection to database "discourse_db" failed: could not connect to server: Connection refused Is the server running on host "123.456.789.101" and accepting TCP/IP connections on port 5432?
So that was easily resolved (EXCEPT I don’t know how to force Discourse to use the proper port in backups), however the next issue was a little more concerning which is we’re using a newer version of PSQL on the database server:
$ pg_dump -h 123.456.789.101 -p 45678 -U username -W -F t discourse_db > discourse_db_backup.tar Password: pg_dump: server version: 11.5 (Ubuntu 11.5-3.pgdg18.04+1); pg_dump version: 10.10 (Debian 10.10-1.pgdg100+1) pg_dump: aborting because of server version mismatch
What can be done in such a situation? Is there a way to get actual system backup functional in such a case or does Discourse + the PostgreSQL database have to be backed up separately?
If the latter is the only option, what’s the PROPER way to backup at least the data? And is there a preferred cohesive mechanism available to do both at the same time without having to write a new script to do this?