Checked: Images lost when migrating to self-hosting,
posts:rebake does not do anything good.
We followed the official instructions and created a Lightsail instance, from there we did a database download from the Discourse UI and applied it to get 80% there. The idea was to transition to the self-hosted instance whilst keeping the previous variant alive.
Once we have a live copy of the old forum. We begin transitioning the images. To do so, we first cancel our subscription to get and migrate our images.
As new images would be uploaded to the self-hosted instance, we would only need to upload from the hosted instance prior to the transition date. This means that we never used the database dump that came with our images and cancellation; as we’d already done the migration, it was now expired.
I observe three behaviors related two this point in time.
- Referenced resources in the backup (SQL dump, specifically) points to Discourse infrastructure
- Referenced resources* since created on the backup, for example new posts’ images, are properly referenced and found on our infrastructure
Consequently, If I reupload a resource which evaluates to the same hash, it will link to Discourse infra. For example: trying to fix favicon by uploading the same does not work. I can however upload any other random image, and it will work.
As I understand, the
upload://<X> goes through b62 decode (and sha1?) bits to map it for the folder public/uploads. We have every one of those images:
The dump we were provided by the Discourse team contains a zip with
default/original/1Xand it currently can be seen in
/var/www/discourse/public/uploads/default/original/1X. The latter folder now contains 329 items, the given dump contained 249 items—that sounds good to me.
That means that the data should be discoverable, even if I cannot directly find the upload in the folder. I am looking to understand this relation, so that I can somehow fix the mapping. Initially it only seemed like a simple string substitution, and that did work for some images. Some are now however been replaced by a transparent.png, where before it was just an inaccessible image…