Backups don't work using external Postgres with version mismatch?


(Alexander “Weej” Jones) #1

We’re running Postgres 9.6 on our external database server, but when trying to use the Backup feature it fails with:

[2017-08-03 17:49:56] Dumping the public schema of the database…
[2017-08-03 17:49:56] pg_dump: server version: 9.6.2; pg_dump version: 9.5.7
[2017-08-03 17:49:56] pg_dump: aborting because of server version mismatch
[2017-08-03 17:49:56] EXCEPTION: pg_dump failed

As far as I know this is the only supported method of moving to new hardware.

Any advice would be much appreciated!

Thanks


(Rafael dos Santos Silva) #2

Yes, you should use the version of PostgreSQL we use on the base image, 9.5.

If you went with a external database, you are on your own to handle backups manually.


(Alexander “Weej” Jones) #3

Is there any documentation for exactly what else is required? When we fired up a new instance using the same database data we just got a tonne of HTTP 500s - I had to ship the whole /var/discourse from one machine to another to force it to work…


(Matt Palmer) #4

Required for what? Running an external database?


(Alexander “Weej” Jones) #5

To do a backup. We don’t want to lose our conversations! :slight_smile:

We have managed Postgres infrastructure that takes care of durability, but if the site is also dependent on lots of files on DISK then we need to make sure they are durable too.

Thanks


(Matt Palmer) #6

Yes, to do a backup you need to take a copy of the database, and all uploaded files. If you setup your site using our instructions, Discourse will take care of taking consistent backups for you. If you decide to do your own thing and it breaks, you get to keep both pieces. We can’t provide support for every possible combination of crazy that anyone on the Internet can manage to jam together. Sorry.


(Alexander “Weej” Jones) #7

Thanks for the info mpalmer. I’ll be somewhat reluctantly re-evaluating our setup with my team - I think we were under the impression that sticking the database on our managed infrastructure (with failover, replication, and off-site tape backup) was the right thing to do, but if this is only giving us a partial backup then it’s obviously not quite right!

If we hosted a single Postgres container using the official instructions, I’d be a bit concerned about database load. What do you think?

Thanks again


(Matt Palmer) #8

It’s not that alternate setups can’t work, it’s that we (the Discourse core team) can’t answer all your questions or solve all the problems you face. A competent platform team should be able to work around any problems caused by an alternate design.

I don’t understand why you feel you need to put PostgreSQL back in a container, though. The thing that’s screwing up your backups at the moment was mentioned in the very first reply, based on the error you posted initially. Fix that, and while you might face other issues, at least that problem will be solved.