# Wie kann ich Dateien vom alten Upload-Schema (default/XXX) zum neuen (default/original/{1,2}X) migrieren?

**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:** [6. März 2019 um 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:** 13

<div class="post-metadata">

### Author: ![kansaichris](https://avatars.discourse-cdn.com/v4/letter/k/ccd318/32.png) [@kansaichris](https://meta.discourse.org/u/kansaichris)
#### Post date: [11. März 2019 um 11:15 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/13 "2019-03-11T11:15:33Z")

</div>

> [@zogstrip](#):
>
> It’s my bad, I copy-pasted directly from the code and forgot to remove the `db` variable interpolation.

Oh, no worries! In hindsight, I probably should have noticed that myself.

You know, it’s funny…I just ran the updated query and Discourse seems to think that I _don’t_ have any images using the old upload scheme:

```ruby
[1] pry(main)> Upload.where("url NOT LIKE '//%' AND url NOT LIKE '/uploads/default/original/_X/%'").exists?
=> false

```

Of course, that’s despite the fact that older posts still have a lot of lines like the following in their Markdown source:

```plaintext
<img src="/uploads/default/247/232ac9c9d98b6458.jpg" width="536" height="500">

```

¯\_(ツ)\_/¯

> [@zogstrip](#):
>
> As for your issue, I’ll have to dig into the code to see _exactly_ what’s going on.

Awesome, thanks! ✨

---

_[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)._
