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

**URL:** https://meta.discourse.org/t/image-uploads-path-in-posts-will-not-change-after-rebake-and-remap/146806
**Category:** Support
**Created:** [4 april 2020 om 12:06 UTC](https://meta.discourse.org/t/image-uploads-path-in-posts-will-not-change-after-rebake-and-remap/146806 "2020-04-04T12:06:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Nelsonius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nelsonius/32/175657_2.png) [@Nelsonius](https://meta.discourse.org/u/Nelsonius)
#### Post date: [4 april 2020 om 12:06 UTC](https://meta.discourse.org/t/image-uploads-path-in-posts-will-not-change-after-rebake-and-remap/146806/1 "2020-04-04T12:06:02Z")

</div>

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 [olddomain.com/uploads/](http://olddomain.com/uploads/) [space.ams3.digitaloceanspaces.com/](http://space.ams3.digitaloceanspaces.com/)

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?

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [4 april 2020 om 15:07 UTC](https://meta.discourse.org/t/image-uploads-path-in-posts-will-not-change-after-rebake-and-remap/146806/2 "2020-04-04T15:07:30Z")

</div>

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 [Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229)

---

<div class="post-metadata">

### Author: ![Nelsonius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nelsonius/32/175657_2.png) [@Nelsonius](https://meta.discourse.org/u/Nelsonius)
#### Post date: [4 april 2020 om 16:25 UTC](https://meta.discourse.org/t/image-uploads-path-in-posts-will-not-change-after-rebake-and-remap/146806/3 "2020-04-04T16:25:44Z")

</div>

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.

- edit - seems migrate\_to\_s3 is just what i need, but!.. it does not work great with Digital Ocean’s S3? Whoops. [Migrate\_to\_s3 for Digital Ocean Spaces woes](https://meta.discourse.org/t/migrate-to-s3-for-digital-ocean-spaces-woes/109662)

---

<div class="post-metadata">

### Author: ![Nelsonius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nelsonius/32/175657_2.png) [@Nelsonius](https://meta.discourse.org/u/Nelsonius)
#### Post date: [6 april 2020 om 13:30 UTC](https://meta.discourse.org/t/image-uploads-path-in-posts-will-not-change-after-rebake-and-remap/146806/4 "2020-04-06T13:30:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [27 april 2024 om 20:12 UTC](https://meta.discourse.org/t/image-uploads-path-in-posts-will-not-change-after-rebake-and-remap/146806/5 "2024-04-27T20:12:36Z")

</div>


