Image uploads path in posts will not change after rebake and remap

Hi there guys,

I’m moving a Discourse installation to a new server. The domain stays the same, but we have moved all old image uploads to a S3 digital ocean spaces with RCLONE. Did a clean discourse install, uploaded a backup without images. So far so good, all posts are there.

It is working with new uploads, but i am having a hard time rerouting old uploads in posts to this new location.

The old location was domain[dot]com/uploads/
The new location is a space.ams3.digitaloceanspaces[dot]com/

I have tried remapping:
discourse remap

and i have tried:
rake posts:rebake
rake posts:rebake_match[“uploads”]

The paths that old images are linking to is still the old domain path. Seems like the remap and the rebake had no effect. Am i missing something obvious here?

Did you migrate the posts in the database?

The Uploads table has links to the location of each upload that need to be updated.

Please see Setting up file and image uploads to S3


Hi Michael,

Not sure if i understand fully. Did i migrate posts in the database. I’m guessing i did not? Every step i took is described. Do you have any more info on this?

I took a look at the topic you shared. I currently have a S3 on DO with all images already uploaded. Seems firing off “rake uploads:migrate_to_s3” will try to re-upload everything (300gb), so i’m looking to skip that part as we already moved the files 1:1. I just need to relink files. But i can’t find a lot of info on that issue in these forums. I made a post in the topic, see if anybody has idea what i overlooked.

1 Like

Ended up making a simple cloudflare redirect. All works now except avatars.

1 Like