So an update for folks who may be struggling with the same issue (basically I’m unable to restore from a backup and the server crashed due to a fault system upgrade).
From what I understand the root cause of the issue is that there are local uploads AND there are S3 uploads, so when the restore tool is trying to restore it’s bugging out because it doesn’t know how to handle local and S3 restores at the same time (maybe it’s time for Discourse to relook at backup/restores).
Thanks to @RGJ for this tip, he suggested force discourse to ignore the S3 upload while restoring:
- Add a line to your app.yml
DISCOURSE_ENABLE_S3_UPLOADS=false
- Rebuild discourse
./launcher rebuild app
- Attempt a restore (either from the GUI Backup page or using the CLI)
- Then after restoring, remove that line from app.yml and rebuild one more time
While this worked, point to note that the forum was badly broken, the categories, settings and posts were restored, however all the images, links, embedded documents etc were broken and errored out.
The hail-mary solution:
I managed to salvage the old server and extracted the /var/discourse
directory (tar/gz) and copied it onto the new server and did a ./launcher rebuild app
. This completely restored the operation of the forum, however the fundamental problem still remains - the backups will NOT work because they have a mix of local and S3 uploads.
So I really need some advice on the best way to fix this issue once and for all. Is it better/easier to move all the upload from local to S3 or from S3 to local and how does one do it? The entire point of a backup is to help out in situations like this one, but it’s failed me so I need yourself to get it straightened out.