# Migrate\_from\_s3 problems

**URL:** <https://meta.discourse.org/t/migrate-from-s3-problems/119064>\
**Category:** Bug\
**Created:** [30 במאי,‏ 2019,‏ 7:28am UTC](https://meta.discourse.org/t/migrate-from-s3-problems/119064 "2019-05-30T07:28:49Z")\
**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:** [30 במאי,‏ 2019,‏ 7:28am UTC](https://meta.discourse.org/t/migrate-from-s3-problems/119064/1 "2019-05-30T07:28:49Z")

</div>

When migrating from S3 to local storage, we see a number of issues.

The main issue is that the `migrate_from_s3` rake task is not taking the Uploads table as a starting point, but the posts. This causes it to skip a lot of uploads which are being left on S3.

- uploads used as logo’s because they are not referenced in a post
- uploads for avatars because they are not referenced in a post
- uploads that are (for some reason) referenced by their CDN URL in `raw` because they do not match [the regex](https://github.com/discourse/discourse/blob/master/lib/tasks/uploads.rake#L130) that is being used to identify the uploads
- uploads that are on non-AWS S3 storage because they do not match the regex because it requires `amazonaws` in the URL
- uploads that for some reason do not match the [second, different regex](https://github.com/discourse/discourse/blob/master/lib/tasks/uploads.rake#L135) (we’re seeing this with non-image uploads like mp3 files, not sure why this is happening)

---

_[View the full topic](https://meta.discourse.org/t/migrate-from-s3-problems/119064)._
