# 如何将文件从旧的上传方案（default/XXX）迁移到新的方案（default/original/{1,2}X）？

**URL:** <https://meta.discourse.org/t/how-can-i-migrate-files-from-the-old-upload-scheme-default-xxx-to-the-new-one-default-original-1-2-x/110813>\
**Category:** Support\
**Created:** [2019年三月6日 05:43 UTC](https://meta.discourse.org/t/how-can-i-migrate-files-from-the-old-upload-scheme-default-xxx-to-the-new-one-default-original-1-2-x/110813 "2019-03-06T05:43:02Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2019年三月18日 10:02 UTC](https://meta.discourse.org/t/how-can-i-migrate-files-from-the-old-upload-scheme-default-xxx-to-the-new-one-default-original-1-2-x/110813/16 "2019-03-18T10:02:27Z")

</div>

> [@pfaffman](#):
>
> But that’s true for new sites as well, because of stock images like:

Yes, this was recently added by @tgxworld. I’ve fixed the query in my post and in the [`uploads:migrate_to_s3`](https://github.com/discourse/discourse/commit/9dbca41152e6f32aa45539ec50f499885b78edd8) rake task.

```ruby
Upload.by_users.where("url NOT LIKE '//%' AND url NOT LIKE '/uploads/default/original/_X/%'").exists?

```

> [@kansaichris](#):
>
> Any updates on this, @zogstrip? Specifically…

Didn’t get a chance to look at it just yet…

---

_[View the full topic](https://meta.discourse.org/t/how-can-i-migrate-files-from-the-old-upload-scheme-default-xxx-to-the-new-one-default-original-1-2-x/110813)._
