# Upload remapping is a bit too enthousiastic

**URL:** <https://meta.discourse.org/t/upload-remapping-is-a-bit-too-enthousiastic/118889>\
**Category:** Bug\
**Created:** [28.Май.2019 15:44:56 UTC](https://meta.discourse.org/t/upload-remapping-is-a-bit-too-enthousiastic/118889 "2019-05-28T15:44:56Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [28.Май.2019 15:44:56 UTC](https://meta.discourse.org/t/upload-remapping-is-a-bit-too-enthousiastic/118889/1 "2019-05-28T15:44:56Z")

</div>

When a backup is restored to a database with a different name, there is a neat little piece of code in `restorer.rb` that attempts to fix this.

> <https://github.com/discourse/discourse/blob/main/lib/backup_restore/restorer.rb#L448>

However, this renames ALL upload filenames, not just the ones that were extracted from the archive. If the database name occurs in an S3 path (which obviously does not change), it changes it as well, causing all images to fail loading.

---

_[View the full topic](https://meta.discourse.org/t/upload-remapping-is-a-bit-too-enthousiastic/118889)._
