# Moving uploads to a different S3 location

**URL:** <https://meta.discourse.org/t/moving-uploads-to-a-different-s3-location/165926>\
**Category:** Product Support\
**Created:** [October 1, 2020, 1:48pm UTC](https://meta.discourse.org/t/moving-uploads-to-a-different-s3-location/165926 "2020-10-01T13:48:13Z")\
**Posts on this page:** 4\
**Page:** 1

## AI-generated summary

[Mirko](/t/-/165926/1) sought assistance regarding moving Discourse uploads from one S3 bucket to another. Although new files were correctly saved to the new location, the system continued to reference images in the old bucket. [Mirko](/t/-/165926/2) subsequently resolved the issue by executing the `discourse remap` command within the application container to update the internal references from the old S3 URL to the new one. This solution was praised by [pfaffman](/t/-/165926/3), who noted that it elegantly handled the necessary table replacements without manual intervention.

<div class="post-metadata">

**Author:** ![Mirko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mirko/32/147237_2.png) [@Mirko](https://meta.discourse.org/u/Mirko)\
**Post date:** [October 1, 2020, 1:48pm UTC](https://meta.discourse.org/t/moving-uploads-to-a-different-s3-location/165926/1 "2020-10-01T13:48:13Z")

</div>

I am trying to move discourse uploads to a new S3 location. I copied files say; from bucket1 to bucket2.  
Newly added uploads get saved at the new bucket2 location, but previously uploaded images the system still shows from the bucket1, the old location. What should I do to show it from the bucket 2?

---

<div class="post-metadata">

**Author:** ![Mirko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mirko/32/147237_2.png) [@Mirko](https://meta.discourse.org/u/Mirko)\
**Post date:** [October 1, 2020, 3:57pm UTC](https://meta.discourse.org/t/moving-uploads-to-a-different-s3-location/165926/2 "2020-10-01T15:57:40Z")

</div>

Solved it this way.

```
 cd /var/discourse

 ./launcher enter app

discourse remap //BUCKET1.s3.dualstack.us-west-2.amazonaws.com //BUCKET2.s3.dualstack.eu-central-1.amazonaws.com

```

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [October 1, 2020, 4:12pm UTC](https://meta.discourse.org/t/moving-uploads-to-a-different-s3-location/165926/3 "2020-10-01T16:12:43Z")

</div>

🎉 Brilliant! I’d been considering how to do replacements in the various tables, but this solves is perfectly. Thanks for sharing.

---

<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:** [October 31, 2020, 4:26pm UTC](https://meta.discourse.org/t/moving-uploads-to-a-different-s3-location/165926/4 "2020-10-31T16:26:07Z")

</div>

Closed on October 31, 2020, 4:26pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
