Images lost when migrating to self-hosting

AI-generated summary

In a discussion titled “Images lost when migrating to self-hosting,” user vicki reported that images, including the logo and favicon, disappeared after migrating from Discourse-hosted to a self-hosted instance at a different URL. Falco suggested checking URL remapping and CDN settings. vicki confirmed the issue stemmed from the path difference between the hosted and self-hosted environments. The problem was resolved when vicki ran rake posts:rebake inside the app container, which corrected the broken image links.

I followed the instructions listed on how to move your Discourse instance to a different server as we move our forum from being Discourse-hosted to self-hosted. However, when I load the self-hosted instance (at a test URL), all of the images are gone.

This includes the logo and favicon images throughout the site.

Is there a way to migrate the images over from our Discourse-hosted version to the self-hosted instance? Or should I go about the migration in a different way?

You need to remap the urls. Are you using the same hostname that you were using before? What about CDN? What’s the URL of the missing image? What’s the URL of the forum?

Right now, our Discourse-hosted forum is at community.endlessm.com and the self-hosted instance is being tested at discourse.dev.endlessm.com

As an example, the broken image link is

“https://cdn-standard2.discourse.org/uploads/default/original/1X/ab52b20f959c49df22586fb77f7c269e64bcf01e.png” and on our current Discourse-hosted forum, the same image is at “https://cdn-standard2.discourse.org/uploads/endless/original/1X/ab52b20f959c49df22586fb77f7c269e64bcf01e.png”

Was able to fix this! Ran
> ./launcher enter app
> rake posts:rebake

and the previously broken post images are now corrected!