# Clean up library folders without moving?

**URL:** https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069
**Category:** Help
**Created:** [January 17, 2020, 2:33pm UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069 "2020-01-17T14:33:59Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![andermic](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@andermic](https://discourse.beets.io/u/andermic)
#### Post date: [January 17, 2020, 2:33pm UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069/1 "2020-01-17T14:33:59Z")

</div>

I recently went through the effort of importing ~30k tracks into management with beets. Everything went fairly well aside from a few issues with missing files, etc. The one decision I made is that I didn’t want any duplicate albums on this first import. If, down the road, I decide to add a specific version of an album I can re-add that later. As such I was replacing a lot of albums during the import. One example is ‘Pink Floyd - The Wall’ since there are about 200 versions of that album :).

So what happened is that I now have quite a few folders with one file in them. Typically the file is ‘albumart’. Previously while organizing my library with another manager, it would move non-audio files with the music files. This was nice to preserve scans or whatever, but also nice because it’s really easy to find and delete empty directories.

Obviously I could probably write a script to find all folders with only 1 file in them and manually delete, or even search for albumart as the only file, etc. However, is it possible with beets to remove all folders in the library directory that are not managed by beets?

My other thought is that I could use beets to move my library from /Albums to /Albums1 and then delete everything in /Albums and move it back. Any concerns before I go down this path?

---

<div class="post-metadata">

### Author: ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)
#### Post date: [January 17, 2020, 2:47pm UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069/2 "2020-01-17T14:47:18Z")

</div>

There is nothing that specifically does this:

> [@andermic](#):
>
> is it possible with beets to remove all folders in the library directory that are not managed by beets?

But you’re right; just doing a `beet move` to a new directory and then `beet move`ing the files back should work great!

Some other things to be aware of:

- Use the `fetchart` plugin to pick up image files alongside music files.
- Use the `clutter` option to configure how beets automatically deletes non-music files in otherwise-empty directories.
- See the third-party [extrafiles](https://github.com/Holzhaus/beets-extrafiles) plugin for moving arbitrary files alongside music.

---

<div class="post-metadata">

### Author: ![andermic](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@andermic](https://discourse.beets.io/u/andermic)
#### Post date: [January 17, 2020, 2:49pm UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069/3 "2020-01-17T14:49:32Z")

</div>

Thanks for the hints. I’ll read up on these plugins/options and give my library a refresh today.

---

<div class="post-metadata">

### Author: ![andermic](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@andermic](https://discourse.beets.io/u/andermic)
#### Post date: [January 17, 2020, 6:02pm UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069/4 "2020-01-17T18:02:07Z")

</div>

Quick question on the move. I have my music library mounted at `/music` which is actually `/mnt/music/Library/Albums`. If I change the mount point of `/music` to be `/mnt/music/Library` and then update my directory setting to `/music/Albums` that will probably screw up the whole database, right?

I think my best step here is to just use the logical paths for moving and not messing with the library/directory setting.

Nevermind. I set the mount point wrong and messed up my library so I’m just going an import in the new location.

---

<div class="post-metadata">

### Author: ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)
#### Post date: [January 17, 2020, 9:54pm UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069/5 "2020-01-17T21:54:00Z")

</div>

OK, sounds good. FYI, there is an FAQ about relocating your library.

---

<div class="post-metadata">

### Author: ![andermic](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@andermic](https://discourse.beets.io/u/andermic)
#### Post date: [January 17, 2020, 10:09pm UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069/6 "2020-01-17T22:09:07Z")

</div>

Yeah, I’m using that. I realized after asking my question that it’s very specific to my situation and doesn’t really apply to beets. I was trying to determine what it would do if I changed the mount point of my music under beets’ config for the directory. I’m just doing this the long way now since it’s the most straight forward.

---

<div class="post-metadata">

### Author: ![bearcatsandor](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/bearcatsandor/32/488_2.png) [@bearcatsandor](https://discourse.beets.io/u/bearcatsandor)
#### Post date: [March 1, 2021, 5:37pm UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069/7 "2021-03-01T17:37:24Z")

</div>

I realize this topic is about a year old, but that extrafiles plugin looks great. Is there any chance it might be included with beets at some point?

---

<div class="post-metadata">

### Author: ![ctrueden](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/ctrueden/32/475_2.png) [@ctrueden](https://discourse.beets.io/u/ctrueden)
#### Post date: [March 15, 2021, 4:54pm UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069/8 "2021-03-15T16:54:26Z")

</div>

> [@adrian](#):
>
> See the third-party [extrafiles](https://github.com/Holzhaus/beets-extrafiles) plugin for moving arbitrary files alongside music.

> [@bearcatsandor](#):
>
> that extrafiles plugin looks great.

I agree that it would be awesome for beets to have robust built-in support for managing companion/non-music files. However, I’d caution against the `extrafiles` plugin in its current form. It’s buggy. I was initially happy to find it, but after using it in practice, I noticed non-music companion files sometimes disappearing (i.e. being deleted). Someone would need to write some integration tests for it that exercise various scenarios, to prove that it works properly in combination with e.g. `beet move`. Caveat emptor.

---

<div class="post-metadata">

### Author: ![rik](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/rik/32/315_2.png) [@rik](https://discourse.beets.io/u/rik)
#### Post date: [March 19, 2021, 1:47am UTC](https://discourse.beets.io/t/clean-up-library-folders-without-moving/1069/9 "2021-03-19T01:47:59Z")

</div>

i think i have issues like those in this thread: the items `path` built into the database does not match where the music files are being mounted. i tried using `beet move` with the directory specifying the new location, but it wants to create some new directory? can you spell out just how you intend the `<beetDirectory>+<itemPath>` to look, and i’ll just go thru and change the sqliteDB to make them appropriate. thanks!
