How to restore a backup of an older version to a fresh install?


(Zachary Lewis) #1

Continuing the discussion from Docker rebuild failed updating Postgresql: Signature verification failed:

After following the steps on the Discourse update page, I was asked to update via the command line. When updating via the command line, I was asked to update my app.yml, and the update essentially attempted to downgrade my postgresql install, resulting in all my data being lost. Luckily, I have several backups in an S3 bucket.

After a bit of work, my Discourse install was running, but it was a totally fresh copy. I pointed the backups directory to the S3 bucket, but was unable to see any of my old backups. To test that everything was configured correctly, I ran a manual backup, which appeared both in my Discourse Backups page and in the S3 bucket (alongside the previous backups).

I made very sure to keep lots of backups in case I somehow lost all my data. How can I restore from these backups?


(Rafael dos Santos Silva) #2
  1. Go to /admin/backups and upload a backup there.

  2. Enable the setting allow restore

  3. Click on restore in /admin/backups


(Zachary Lewis) #3

@Falco Thanks for the quick response.

So, I’m attempting to log in to the site, and it says I’m not allowed to log in because it’s in read-only mode. I specifically set the site to read-only mode until I was able to restore the data. How do I log in?


(Rafael dos Santos Silva) #4

Do /users/admin-login work?


(Zachary Lewis) #5

After entering my email, it went to a white page with the following text:

{"errors":["The site is in read only mode. Interactions are disabled."],"error_type":"read_only"}

(Rafael dos Santos Silva) #6

Ok.

SSH to the server, and then:

cd /var/discourse
./launcher enter app
rails c
Discourse.disable_readonly_mode

(Zachary Lewis) #7

Sounds good. I’ll be sure to post an update once I get a chance to log in this evening.


(Alan Tan) #8

Your data is never lost. On the host machine, look for postgres_data_old in /var/discourse/shared/standalone


(Zachary Lewis) #9

@Falco It worked! I’m back up and operational! Thank you!


(Rafael dos Santos Silva) #10

:tada: Great!

Thanks for the patience and perseverance!


(Régis Hanol) #11