Trouble accessing Playlists from my iTunes library on a NAS

  • 18 October 2016
  • 21 replies

Userlevel 1
Badge +3
I've succeeded in getting my Sonos to play from ITunes on my NAS, but I could not see any of my playlists

After reading on this forum I realised iTunes records the Playlist in the file 'iTunes Music Library.xml'
Even though I run iTunes of my NAS and I've conolidated my iTunes libraries this file is located on my PC not on the NAS. So I copied it to my NAS Music folder and now I can access the playlists!

Yay ... sort of.

The problem with this fix is I will have to repeat the file copy every time I change iTunes playlists as the master is on PC not NAS.

Hoping someone can offer a nifty solution ... ?

Best answer by jgatie 18 October 2016, 17:48

View original

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

21 replies

Hi. I'm surprised it's working at all! You can try the following, although no guarantees.

First, make sure that in Edit, Preferences, Advanced in iTunes, the location of the iTunes Media Library is the NAS not the PC (I think this must be so, but no harm in confirming).

Open the iTunes Music Library .xml file using Notepad or similar text editor and check the filepath it is using for playlists. If it isn't the NAS path you could do one of two things:

1. Global find and replace to get the right path into the XML

2. Close iTunes. Move the .xml file to another location for safety (or just delete it provided you still have your PC copy to fall back on). Reopen iTunes. This should trigger the .xml to regenerate, hopefully with the right paths. If it doesn't regenerate, copy your PC copy back in.

Also, make sure that Sonos is picking up that .xml - the Sonos Music Library must be defined as the folder in which the .xml sits, or as a folder containing that folder. That is, don't point the Sonos too far down the filepath.

As I say, no promises.....
Userlevel 1
Badge +3
I'm liking your option 2, but some questions first if I may:
1) when you say delete the xml to enable generate I assume you mean the one on the NAS?
2) it thats a yes, why didn;t it generate the xml on NAS before I put the copy there?
3) if that's a no (i.e. I should delete the xml on the PC) what information will iTunes use to regenerate a new xml?
To answer your questions:
1. Yes
2. Don't know. Are you sure it didn't just get copied across with the general move of iTunes. Or maybe you had iTunes open?
3. Don't delete the PC copy. I want you to have a backup that enables you to get back to where you were if for some reason this goes wrong. My preference would be for you to move the NAS .xml somewhere out of the way to act as a further backup.

I just successfully regenerated again to check, but this didn't involve moving my iTunes so not a complete guarantee.
Further possible answer to 2. It did regenerate but didn't change the playlist paths.
Userlevel 1
Badge +3
Before I copied the xml file from PC to NAS I did a search on the NAS for any xml files and there were none. So I copied it over.
Seeing as I've been using iTunes for some time / years and he xml was on PC all that time I can't see why it would decide to generate the xml now?
Maybe my file locations is a remnant of fact I moved my library from PC to NAS a few months back.
Anyway I'll give it a go ... can't hurt (famous last words ? 🙂 )
It generates the .xml because it doesn't find one there after you have removed it. I am absolutely certain that this is related to having moved the iTunes library location.
Userlevel 1
Badge +3
So I deleted NAS file, left PC file where it was and started iTunes.
Nothing has happened yet. Is it meant to auto-generate or do I need to prod it?
Has the .xml file reappeared in NAS//iTunes/Media. or wherever it was before you moved it out?
Did you confirm where you have your iTunes Library pointing in Edit / Preferences / Advanced?
Userlevel 1
Badge +3
No the xml hasn't re-appeared, and yes I had checked the preferences advanced tab and it was pointing to the NAS folders. oh well....
Mine regenerates every time I remove it. Could you tell me the exact path you have in the Advanced tab please? And which folder you recopy the .xml into every time you have to do it?
Userlevel 1
Badge +3
the original xml on the PC is in C:\users\cj\Music\iTunes
I copy the xml to the NAS folder as shown in the snippet image I've attached from preferences

Do you have a "normal" iTunes folder structure within that? I'm not sure if that matters, but I would have expected a further /iTunes/iTunes Media in your filepath, with the .xml file held in the iTunes folder.

Incidentally, what is the date / time last modified for your PC .xml file right now?
And I would have expected a Music folder within ITunes Media, which would contain the music.
Userlevel 1
Badge +3
It's not quite normal I've added a few folder of my own (like lyrics I download independent of iTunes) but the the S:\555 CJ NAS Music\Music folder is there
as is \iTunes U and \Podcasts etc
but no \iTunes media folder

the PC xml modified date/time is today about 30 mins ago
I hesitate to suggest this, because I'm honestly not sure if it will make any difference. But I would be inclined to have a folder structure of CJ NAS Music\iTunes\iTunes Media\Music. I would stop at iTunes Media in the path in the Advanced tab. I would point the Sonos music library at CJ NAS Music and put the .xml in the iTunes folder. I don't think iTunes knows where to put the .xml at the moment.

I could just be wasting your time here. You may want to see if anyone has a better suggestion. But having a non-standard structure may be the cause of the problem.
It would be interesting to close iTunes, move, not delete, your PC .xml (e.g. keep it safe in Documents or somewhere), reopen iTunes and see if .xml is regenerating to PC.
In essence, in moving my iTunes to a NAS I would have preserved all the iTunes folder structures and file locations within that structure that I had on the PC.
Userlevel 1
Badge +3
I've got to hit the sack so I'll get back onto this tomorrow
thanks for your persistence !
Unless it has changed, here's how I used to do it: Copy the iTunes files from your PC to the iTunes directory on the NAS. Start iTunes by holding down the shift key and clicking the icon. You will be prompted to configure a new library files location. Browse to the location on the NAS and select the files there.
Userlevel 1
Badge +3
I think it's solved,

I moved the "iTunes Music library.xml" to NAS (deleting it from PC) and started iTunes holding shift key down. But it wanted to know where the *.itl was, not xml. So I also moved "iTunes Library.itl" to NAS and started again with SHIFT held. I pointed it to the itl file and it looked promising. So I tested it by changing a playlist and restarting. And ... it worked!

Interestingly after the above I saw that a new file "iTunes library.xml" appeared in same NAS directory as "iTunes Music library.xml" but only the former file changed when I modified a playlist. I read somewhere that "iTunes Music library.xml" is an obsolete name and "iTunes library.xml" is the new name. So I deleted "iTunes Music library.xml" and it still worked. Yay!

I've also deleted all files that were on on the PC under C:\users\CJ\Music and it all still works. So I'm pretty sure it's all based on my NAS now. Excellent!

many thanks John B and jgatie!