We are migrating all our uploads/images between two different s3 compatible services (both are digital ocean spaces if it matters) and I have decided that we are stuck in a quite bad state.
I’ll start with explaining how the migration was done:
- We cloned/synced the initial bucket to the new bucket with rclone
- All references in the
Filespage in discourse administration was updated to the new endpoints
- A re-bake was ran
Sadly, this did not do what we wanted, and now all images are “gone” from the forum. They are still in the s3 bucket (and luckily in the old one still as well) but no post can find their respective image.
The size of the bucket is about 60gb, so it’s (even if not extreme) quite a huge bit of data.
I’ve rebuilt the container, I’ve tried to recover stuff from the tombstone, I’ve done pretty much everything I can think of or find in the support forum or rake tasks.
I’ve as well tried with a database replace (via discourse remap).
Each image looks basically like this in baked content at the moment:
<img src="https://xxxx.xxxxx.xx/images/transparent.png" alt="image" data-orig-src="upload://h8UudilPhVsGnNmvlJ5lQYEr8PT.jpeg" width="375" height="500">
Which makes me think that the b64-sha of the link is either broken or the image sha have changed for some reason.
Have anyone done this before? Are all images lost forever? (yes yes, I have a backup and the old images, so I know that there is a way).