Discourse Back Up S3 Postgres version mismatch


(Benjamin Smith) #1

I’m trying to back up to S3. No backs ups have executed since setting up discourse about a week ago. Below is the report I get while trying to run the backup. Is there an easy way to upgrade postgres to match the Amazon update? Are there other options? Will it mess up the data I already have in my discourse? I’m a novice at this so any help will be appreciated!

AWS hosting
I’m using putty to ssh
Docker install

[2015-06-12 23:07:47] Dumping the public schema of the database…
[2015-06-12 23:07:47] pg_dump: server version: 9.4.1; pg_dump version: 9.3.7
[2015-06-12 23:07:47] pg_dump: aborting because of server version mismatch
[2015-06-12 23:07:47] EXCEPTION: pg_dump failed


(Jeff Atwood) #3

Is this a restore or a backup? I am not sure how the Postgres dump program can be a different version than Postgres itself.


(Benjamin Smith) #4

Backup I don’t have any backups to restore from.

https://forums.aws.amazon.com/message.jspa?messageID=571101

I think EC2 and RDS are running on different versions? I’ve been all over AWS forums, all over the web, and am still scratching my head. I can’t create a backup so I can’t create another version of RDS running 9.3 instead of 9.4.

Can you think of a work around?


(Benjamin Smith) #5

Update: I unchecked backup to S3 and now am getting a brand new error. Then it just gives me an infinite loop like its trying to remove .tar leftovers.

[2015-06-13 03:43:28] ‘Ben’ has started the backup!
[2015-06-13 03:43:28] Marking backup as running…
[2015-06-13 03:43:28] Making sure ‘/var/www/discourse/tmp/backups/default/2015-06-13-034328’ exists…
[2015-06-13 03:43:28] Backup process was cancelled!
[2015-06-13 03:43:28] Notifying ‘Ben’ of the end of the backup…
[2015-06-13 03:43:28] Cleaning stuff up…
[2015-06-13 03:43:28] Removing ‘.tar’ leftovers…


(Régis Hanol) #6

Might be a permission issue.


(Benjamin Smith) #7

What would I do to figure that out?


(Benjamin Smith) #8

The backup button doesn’t work and when I go to upgrade via the admin console nothing happens now. The site is running perfectly otherwise.


(Kane York) #9

I think a workaround would be to download a pg_dump with the correct version (extract it from a .deb file or something) and use it to replace the pg_dump binary in the Discourse image, then run the backup.


(Benjamin Smith) #10

Is there a way to back up manually just in case I mess this up?


(Kane York) #11

Because you’re just screwing with the pg_dump binary, the fix will be to rebuild your container.


(Benjamin Smith) #12

I looked around over the past day or so and the only thing I can find on pg_dump updates is to reinstall a newer version of postgres.

Is this what you are suggesting?

If it is how do I go about doing so? I can’t seem to find any how to.


(Kane York) #13

Well, it’s unusual because the postgres version in your container is not the one that the application is running with, so this hasn’t happened to anyone before.


(Benjamin Smith) #14

I know that its odd, but what do I do?

I’m not the only person to ever experience a version mismatch with postgres on different servers. Is there a way to migrate from an a postgres 9.4 RDS to a postgres 9.3 RDS. The EC2 server is just running a different version than RDS. If I had known the versions ahead of time I would have chosen differently. I just don’t want to lose the data I have and want to be able to save a backup to my machine or S3 just in case.


(Grzegorz Tańczyk) #15

How can I do that without screwing the with pg_dump manually?


(Rafael dos Santos Silva) #16

If this is happening you aren’t using the docker, and a outside database.

I do this too, and since I’m using a external Postgresql server with 9.4, backups weren’t working.

Solution was to install Postgresql ppa on discourse machine and install pgdump for 9.4 version.


(Grzegorz Tańczyk) #17

I just did that and it works without problems, however I have some concerns:

  • migrating to new machine
  • upgrades
  • container rebuild

Do I need to install Postgres client binaries again? How can I configure that in container.yml?

Thanks


(Rafael dos Santos Silva) #18

Docker does all this automagically, if you stick to the Discourse Way™ you
don’t need to fiddle with any thing.

If you want to use a outside database however, you’ll need to have an
adequate database tools.

Since Postgresql 9.5 is coming soon, my guess is that Discourse team will
update the embbed database soon, there are free performance to be gathered
with small work.


(Grzegorz Tańczyk) #19

Should I expect problems with such setup on upgrade once DO makes switch to Postgres 9.5?


(Jordan Slaman) #20

I am also experiencing the same issue.
Fresh docker install of discourse using Amazon RDS with postgres

[2015-12-11 17:25:56] Dumping the public schema of the database...
[2015-12-11 17:25:57] pg_dump: server version: 9.4.4; pg_dump version: 9.3.10
[2015-12-11 17:25:57] pg_dump: aborting because of server version mismatch
[2015-12-11 17:25:57] EXCEPTION: pg_dump failed

Will a future build of Discourse use pg_dump 9.4.4 or should I try and rebuild my docker image with that version of pg_dump now?


(FOSS dev/hacker) #21

@JordanSlaman I’m getting the exact same errror on my setup.

Just installed Discourse via the Docker install and set up my Database on Amazon RDS.
The solution is to start a DB instance with version 9.3.10 and migrate your DB there.

I’m still trying to figure out how to do this

@codinghorror "I am not sure how the Postgres dump program can be a different version than Postgres itself."
Discourse Docker container install pgSQL 9.3.10 and Amazon RDS is running 9.4.5, hence the mismatch.


Thanks for Discourse cauze it's just pure awesome
Install Discourse on Amazon WS with Cloudflare