LimitlessGreen encountered issues with S3 assets after moving a Discourse forum. The problems included:
Broken preview images, working enlarged images
Working preview images, but no mouse-over for enlarging images
Broken Gravatars
The issue arose because S3 asset URLs were rewritten to internal ones after restoring the backup. LimitlessGreen manually downloaded the assets from S3 and moved them to the correct location.
It was suggested by michaeld that the issue might be due to misconfiguration, but LimitlessGreen clarified that the S3 configuration was overwritten during the restore process.
pfaffman mentioned that there is a hidden setting to include S3 assets in backups, but it requires access to the app.yml file, which LimitlessGreen did not have.
LimitlessGreen provided a step-by-step guide to reproduce the issue and is willing to perform SQL modifications to resolve the problem if guided.
The recommended solution is to re-run the restore process with the S3 credentials and then set the hidden setting to include S3 assets in backups. However, this is not possible in LimitlessGreen’s case due to the lack of S3 credentials.
I had to move an abandoned Discourse forum. Luckily, we had multiple admins, so it was possible to do and download a backup. We used a S3 bucked for our assets, which was kind of a problem. I’ll make a feature request at this point:
Make it possible to include S3 assets into backups
I found out (not sure if it was before or after rebaking the posts), that S3 asset URLs got rewritten to internal ones. So I extracted all original and optimized S3 URLs out of the database file and downloaded them (kind of) manually. After moving them to the right place, all missing images got displayed. … It would be great to have an automatic feature for that.
If it’s not too late (that is, there’s traffic on the forum that’s happened and you don’t want to lose) and you have the S3 credentials, then I’d probably put the s3 credentials in the app.yml and re-run the restore. From there, you could probably set the hidden setting, do a backup, and restore it on a server without S3.
But I think that’s not the case. And it’s not clear just what the issues might be since even you don’t remember exactly what you did when.
If stuff is missing (and you have s3 credentials), I might try using some S3 tool to pull down all of the uploads and then hack at the database to get it to point to them. But I am not good enough at that to explain here how to do it.