What happens when I rename a directory or file that has already been scanned?

Just curious to understand what happens when I rename a directory or file containing an artist or album or track that is already in the Roon database. If I made changes to the metadata in Roon for that artist/album are they retained?


Hi Foxmoon,

Changing directory or file names in the OS won’t affect metadata. Editing tags embedded in the file with an external editor or editing in Roon will. Edits in Roon are retained in the Roon database rather than in the file, so it is prudent to back up the database. The priority between tags, Roon imported metadata and edits can be user defined since 1.1. See:

Changes to tags should be picked up in real time, but the album/track Edit page has an option to force a rescan if that doesn’t occur.

@andybob yes I understand how the file / Roon / edits mechanism works.

Just trying to understand that when Roon has identified an album for example, it must keep a reference to that album on the filesystem.

When I change that reference (for example change the name of the directory that contains the tracks, say correcting a typo or adding [Mono] to the directory name as an identifier) will Roon still match the album in the database to the changed directory (and subsequently keep my edits associated with that album)?

Hope this clarifies the question.

I think if you change a folder name then Roon will see it as a new item. Applies to single folders with one album and parent folders above that.

I’ve moved files from an organised folder on one drive to a watched folder on another and had edits retained in the database. I’ve also renamed files within a folder and retained edits. I can’t recall shifting edited files between directories or renaming directories; I’ll try it and see.

Edit: My recollection here was wrong, see below. It was tags that remained stable, not edits.

Would be good if someone else can test this as well.

What I’m seeing is that when I rename a folder, the reference is lost. For example trying to play a track from that album, it looks like Roon can no longer find it. This might be expected behavior. Strangely enough though, the renamed folder should be showing up as “new” (something not yet in the Roon database) but it doesn’t seem to. And Roon also doesn’t complain it cannot find the files it no longer has a reference to.

When trying to delete the album from Roon, it does say it cannot find the tracks to be deleted. The album then remains in the database (e.g. it is not deleted from Roon).

Going into Settings -> Setup and clicking “Clean Up Library” doesn’t remove the album too. (it did find some other tracks to be cleaned up but no idea what they are as it doesn’t say).

Did you do a “Force Rescan” ?

Having checked edits ARE lost when I:

  • move files between drives and folders,
  • rename folders;
  • rename files within a folder.

Tags embedded in a file with an external editor remain fixed (as expected).

Hmm, this is unexpected (but good to know):

  1. Edit metadata for an album, added TEST as a value for Version Info.
  2. Note the full path to one of the tracks in the album
  3. Rename the album directory on the file system
  4. Go back to Roon, track will not play
  5. Now do a Force Rescan on the Watched Folder
  6. Old album is deleted from Roon’s database
  7. New album is added with Version Info retained (note new full path to the tracks)

Interesting, would be nice if someone from the dev team can confirm this?

Hey guys – there are some known shortcomings here that we’re working on addressing here.

Tracking files as they move around the filesystem, and as they are modified, is a complicated problem. When a file is moved, or modified, or both, and Roon is unable to establish that is the same as a previously existing file, it will import it as if it were completely new.

Additionally, if Roon observes two copies of the file existing at the same time, one of them will be considered “new” and only one of them (sometimes the wrong one) will be attached to your edits. This latter case is the most troublesome–depending on exactly when and how the OS delivers information to Roon about filesystem changes, it’s possible for a file move to be interpreted as creating a second copy of the file and then deleting the old one.

So, editing a directory name should not have an effect on your edits once this issue is resolved, but there’s a lot of complexity here and as a general rule, if you’ve made significant edits in Roon, for now I would avoid moving or renaming files or folders on disc right now.

We’ve designed an improved version of our file tracking scheme that should be much more reliable when dealing with cases like this, and it’s under active development over here. For now I would recommend moving or editing files on disk, then editing the files in Roon. If you do it the other way around, be aware that there are certain cases where Roon can treat the files as new imports.

If you do need to make edits or move files on disk, I would also strongly recommend making a backup of your Roon database beforehand.

I have a process that works for renaming or moving files with Roon running on Linux.

service roonserver stop

cp -pr /var/roon some_backup_dir # backup just in case…

Move the files you are changing to a location that is NOT Watched by Roon.

service roonserver start

Roon will see the files are no longer there and delete them. You can see this in the log file.

Start up the Roon client and go to “Setup->Settings->Clean Up Library”. You will see a count of deleted tracks. Click on “Clean Up Library”.

Do whatever edits, renames to your files that were moved. When done, move them back into the Watched directory and Roon will import these as if they are new.

This thread pre-dates a release which greatly improved Roon’s file tracking so I will set it to close in 24 hours.

The process described by @Robert_Joe will work, but involves Roon re-analysing the edited/moved files, which may not be wanted if you are moving a large number of files.

This is the current KB page setting out the process for moving files. Remember to close Roon/Roon Server and make a backup of your database before you start.

This topic was automatically closed after 24 hours. New replies are no longer allowed.