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

AI-generated summary

A user, zachwlewis, is trying to restore a backup of an older version to a fresh install of Discourse after a failed update resulted in data loss. Falco suggests uploading a backup to /admin/backups, enabling the allow restore setting, and clicking restore. However, zachwlewis encounters an issue logging in due to the site being in read-only mode. Falco provides a solution by accessing the admin login page directly using /users/admin-login. When this fails, Falco guides zachwlewis to disable read-only mode via the command line.

After successfully logging in, zachwlewis thanks Falco for the assistance. It’s also noted by tgxworld that the data may not be lost and can be found in postgres_data_old in /var/discourse/shared/standalone.

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?

  1. Go to /admin/backups and upload a backup there.

  2. Enable the setting allow restore

  3. Click on restore in /admin/backups

@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?

Do /users/admin-login work?

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"}

Ok.

SSH to the server, and then:

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

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

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

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

:tada: Great!

Thanks for the patience and perseverance!