Need to Extract and Merge Playlists after Music Library Relocation (ref#U9M8KC)

Hi! What’s not quite right with Roon?

· None of the above quite fits

None of the above quite fits

· None of these quite match

Tell us what's going on

· Many Playlists have lost most local media tracks when I moved my music library locations
I have restored the previous version of my Roon database from backup, now I need to extract the playlists, or at least the local media from those playlists in a form that I can then merge back in with the latest version of my Roon library.
None of the export options lend themselves to easily exporting the playlist and then re-importing it to the new server version. I have around 80 playlists to export from the restore and then re-merge on the new version.

Tell us about your home network

· Irrelevant. The problem occurred when relocating my music library from my NAS to be local on the Mac that always ran my Roon Server. Full history under this post https://community.roonlabs.com/t/tracks-disappeared-from-playlists-after-library-move-ref-997rf7-pt2/314683/6

Hello @Neville_Davies ,

Thanks for the detailed write-up.

Based on your description, the issue of disappearing tracks likely occurred because Roon “saw” two copies of the same library simultaneously (Old Location + New Location). When this happens, Roon treats the new files as new objects, causing the playlists—which reference the old objects—to break when the old location is removed.

To fix this on your restored database, we need to ensure Roon sees the move as a replacement, not a duplication. Please follow these steps:

  1. Create a Backup of the current state of the restored database.
  2. Go to Settings → Storage and Disable/Remove the old storage location (NAS/Old Path).
  3. Stop Roon Server.
  4. Move your music files to the new location on the Mac.
  5. Start Roon Server, go to Settings → Storage, and Add the new folder.
  6. Allow Roon to fully complete the background audio analysis and scanning before checking playlists.
Migrating Playlists:

Since Roon does not support merging databases, the best approach is to use the restored database to Export your playlists (e.g., as M3U files) and then import them into your current setup.

Could you please share an example M3U file exported from the restored database? Knowing whether it uses absolute or relative paths will help us advise on the best way to import them into your current library.

Thanks.

thank you for the tips Alex
I am already at the stage of having the restored Roon server, but I am simply not going to go through the process of exporting 80+ playlist manually. I am now trying to work with roonapi in python to try and automate. Will convert to relative paths if the output is absolute.

@Neville_Davies,

Thanks for confirming.

Yes, converting to relative paths would be the best solution.

If you are comfortable with scripting, you can generate a list of your current file paths and then ask an LLM to write a script that automatically updates your playlist files to match the new directory structure. This can save you a significant amount of manual editing.

Thanks.

Hi Alex, after spending over half a day trying to get the Roon api to export playlists in python, it’s become clear that this will not work as Roon does not allow the roonapi access to the location of the local media assets, so it cannot create the correct paths or filenames in the playlists, so these are unfortunately useless

If I use the manual export from Roon, what it does it creates a local file and then the path to this local file, not the one in my library. So if I use these, I need to keep this folder as the relative paths and media asset names are the ones that the Roon export has created, not the names of the files in my library. I will then end up with a duplicate for every file in my library.
At this point, I have wasted insane amounts of effort and don’t know what to do. I really don’t want to have to export everything to these playlists, then manually go through the list and add them one by one. This brings back nightmares of plex when it started randomly deleting stuff from my playlists.

If I export everything, then add this folder to a place where my Roon library will pick it up, how do I make Roon prefer the version in my music folder instead of the new playlists folder so that I can delete these duplicates??

I’ve actually found a potential, but ugly solution.
I just tried all of the manual export types again and see that the local asset file names and paths do exist in the excel export. So in theory, I could

  • strip out the paths and turn them into relative paths to the playlists folder in my Roon library
  • create an m3u file for each playlist
  • copy this into the playlists directory that my Roon Server can see
  • restore my Roon database back to newest version
  • then find each of these playlists, use the add to playlist function to copy the tracks back into each Roon playlist
  • then go back and delete the local media playlists

Before I start on this mission, which will cost me sleep, exercise and family time, please tell me if there is any other easier way. Thank you.

in the end I went ahead and did this, scripting the conversion from xlsx to m3u and was able to import the playlists back into the restored Roon Server. Now just merging them back to the Roon playlists one by one, then deleting the m3u and then removing duplicates on each playlist as some files did not get deleted. Hope to be done by end of weekend and never to ever have to do this again

Hey @Neville_Davies,

Thanks so much for your reply and additional information! We apologize for the delay in responding as well.

Roon doesn’t actually care about file paths as much as it cares about file fingerprints. If you have the restored database where the playlists look “broken” (tracks are missing/red), you don’t need to export them. You very likely just need to tell Roon the tracks have moved.

  1. Restore the old database (where the playlists are intact but files are "missing").
  2. Go to Settings > Storage.
  3. Disable the old, dead folder paths (don't delete them yet, just disable).
  4. Add the new music library location.
  5. Roon will scan the new location. Because the file fingerprints match the ones in its database, it should automatically "merge" the new file paths with the existing database entries.
  6. Your playlists should suddenly "light up" and become playable again because Roon realized "Track A" at the old path is the same as "Track A" at the new path.
If the above fails because you've already committed to a new library version and just want the playlist data back, you could use File Tags instead of M3Us. This bypasses the "path" problem entirely.
  1. Open your restored (old) Roon version.
  2. Go to a Playlist, select all tracks (Ctrl+A or Cmd+A).
  3. Click Edit (the three dots) > Edit Tracks > File Tags.
  4. Add a unique tag to the metadata of the actual files, like Playlist: 80s Synth. (This writes directly to the files' ID3 tags).
  5. Repeat for your important playlists.
  6. Open your new Roon version.
  7. Once the files are scanned, use the Focus tool or Search to find the file tag Playlist: 80s Synth.
  8. Select all those files and click Add to Playlist.
With this, it doesn't matter what the file path is. Roon reads the metadata tag you just wrote and finds the file instantly.

Thanks, Neville! :folded_hands: