My iTunes preferences/media folder location keeps going to default

Per the question, I set iTunes Preferences/Media folder location to be "\\Volume1\Music" (which is my NAS). Songs in my library that are located there play just fine. iTunes sees the songs obviously. But every time I close iTunes (and/or shut off my computer and then open iTunes again), it keeps defaulting back to the C: drive iTunes Music folder. It's like it can't find or see the NAS. Odd, since the NAS is always on.


I've searched all over and I cannot find an answer so I'm hoping the community can provide help here.


I posted this question the other day but it was deleted for some reason so I'm re-adding it.


[Re-Titled by Moderator]

Posted on Jul 31, 2021 12:32 PM

Reply

Similar questions

178 replies

Aug 7, 2021 3:00 AM in response to William Richards3

William Richards3 wrote:

So %20 is actually a space as far as XML file is concerned? I didn't know that. I wonder why I need to remove those spaces then (or %20 in this case)?


As noted:


The file:// notation is a form of URL, like a web address. Spaces aren't allowed in URLs so have to be replaced by some form of escape character, usually %20. You don't need to change these, that is a red herring.


If you're systematically replacing part of an existing path in the XML file to make the library work on a different path than iTunes used to create it then you need to make sure that don't include any spaces in the replacement part and instead use %20 wherever you would have had a space.


tt2

Aug 7, 2021 5:49 AM in response to turingtest2

turingtest2 wrote:


William Richards3 wrote:

So %20 is actually a space as far as XML file is concerned? I didn't know that. I wonder why I need to remove those spaces then (or %20 in this case)?

As noted:

The file:// notation is a form of URL, like a web address. Spaces aren't allowed in URLs so have to be replaced by some form of escape character, usually %20. You don't need to change these, that is a red herring.

If you're systematically replacing part of an existing path in the XML file to make the library work on a different path than iTunes used to create it then you need to make sure that don't include any spaces in the replacement part and instead use %20 wherever you would have had a space.

I'm so sorry, I'm not totally understanding the last paragraph above. Could you give me an example(s) of what you mean? I just am lost as to what I would do here. This particular element is all new to me so I'm sorry that I don't understand.

tt2

Thanks!

Aug 7, 2021 11:40 AM in response to turingtest2

turingtest2 wrote:

Say your existing path to a track was:
Y:\iTunes\iTunes Music\Beatles\Abbey Road\01 Come Together.m4a
Which the XML file would record as:
file://localhost/Y:/iTunes/iTunes%20Music/Beatles/Abbey%20Road/01%20Come%20Together.m4a

What does localhost stand for? Why does XML create this in its file? Do all XML files have that? Not biggie, I'm just curious.

and you wanted to correct things such that the XML was using the media folder /volume1/iTunes/iTunes Media then you would need to use %20 instead of a space in the replacement text where it appears in iTunes Media. I.e. replace "localhost/Y:/iTunes/iTunes%20Music" with "volume1/iTunes/iTunes%20Media" so the resultant path becomes:
file://volume1/iTunes/iTunes%20Media/Beatles/Abbey%20Road/01%20Come%20Together.m4a


I follow the last examples (I think).

The point is that you must not put spaces in XML file location strings. There won't be any there already, they only way they would be added is if you didn't consider them if they feature as part of a replacement string, in which case use %20 where you would otherwise want a space.

This last paragraph though still leaves me confused, sorry. I won't do anything I don't need to do. You're saying there won't be any there already, I understand that. But this I don't understand:


"they only way they would be added is if you didn't consider them if they feature as part of a replacement string, in which case use %20 where you would otherwise want a space. "


I realize I'm probably making this more complicated than it needs to be, right? haha


I think the gist is that I should change each of the nearly 15,000 songs and remove the "localhost" from the song. I can do a replace all and hopefully that would work (though I'd probably do in stages instead of all at once). The other part of the location with all the %20 I would just leave alone, right?


So on this song, I would only change the localhost and leave the rest of the song with the %20s alone?

file://localhost//volume1/music1/Beach%20Boys/Little%20Duece%20Coupe/Beach%20Boys%20-%20409.m4a


I noticed at the very start of the XML file it looks like sort of a setup for the whole file? So I see this highlighted in yellow below (MUSIC FOLDER)"



Do I change that as well as each of the almost 15,000 songs?

SIDE NOTE: He says: You will need to scan the file and remove all smart playlist entries.


I did a search in the XML file for a regular playlist I manually created and found it. I then did the same for a smart playlist and found those too. For the smart playlist I noticed a bunch of data at the end which isn't a part of the manually created playlist:


Here's a regular playlist:


That's likely why he's saying to remove the smart playlists? (all that data that shows up that I didn't see on a couple of manually created playlists. You know this I'm sure, but I was just trying to understand this all.


Thanks!!!


tt2


Aug 7, 2021 2:02 PM in response to turingtest2

I'll probably just delete the ten or so smart playlists I have as they serve no real purpose right now and then it won't be an issue for the updated xml file that will be a reflection of that action.


When you mention playlist folders, are you referencing playlist folders that might exist within the Xml? I only make a manual playlist. I don't have any playlist folders that I'm aware of unless making a manual

playlist is actually a folder? One guy on the forum said he makes folders of his playlists but it wasn't really related to this. Just wondering.


So I wouldn't need to worry about it if I've not made any playlist folders?


How does the XML know what songs are in a particular playlist? That's kind of fascinating actually.


Thanks.

Aug 9, 2021 3:29 PM in response to turingtest2

If I type Volume1 into the address bar in Windows explorer, it brings up this

https://volume1:5001/

but only after I say it's a safe site. My Kaspersky wants to block it. I had to say "I accept the risk" or whatever and let it go to Synology after I entered my credentials.


I then re-read your question and realized I wasn't putting two backslashes in. When I did that, it brings it in as below:


So typing it with two backslashes is what I needed to do. Now that it's showing again, I shouldn't worry about DS720 on your comments, right?

Why would I type this so it comes up? Should I always make sure I have this open on my desktop while using iTunes and/or Plex? Or is it simply a way of letting the computer see it when I want to, kind of thing?


Thanks!!!



Aug 10, 2021 4:52 PM in response to turingtest2

Good to know. Thanks.


I am still struggling with importing the music. Plex has brought back the feature they claim. And a forum user who has been nice in trying to also assist me has confirmed its working, yet I don't see it. It's suppose to show up next to the playlist navigation and you click the three dots and it's supposed to say "import playlist from itunes". You have to have other settings such as enable iTunes plugin enabled and the path for iTunes XML - all of which I think I have right. Anyway, I thought I would see if you had any thoughts.


It was pointed out that this path should only have one forward slash after "volume1". The XML had two of them before. I did this on both the song files as well as the Music Folder. Do you think it matters?


file://localhost//volume1/music1/Beach%20Boys/Littl.....etc.


On the XML file for the Y mapped original music library, I noticed that the Music Folder location was:

<key>Music Folder</key><string>file://localhost//DS720/music/<


But all the songs had:

<key>Location</key><string>file://localhost/Y:/MUSIC/Beach%20Boys/Little%20Duece%20Coupe/Beach%20Boys%20-%20409.m4a


Perhaps this was why Plex wasn't seeing the files?? Should I change the Music Folder to be "localhost/Y:/Music/Music"?


Is there a way you know of to install iTunes on a NAS? Synology NAS of mine has iTunes Media on it as an app (like Plex), but I've not used it. Synology tech support calls I've had when asking back last fall and into early this year sort of frowned on using it, saying it wasn't real stable or decent, I don't recall.


When I do the XML path in Plex, based on feedback to put the XML file in a folder outside the Music folder Plex sees/scans, I have the path as:

/volume1/iTunesXML/iTunes Library.xml


The "iTunesXML" is the folder where I put the XML file in.


I've tried also putting it in the same folder as the music (as other forum comments say to do that).


So I think it's something I don't have set right but I can't figure out what. And even if I had the wrong something or other set, you'd think the software would still show the "import iTunes playlists" despite something being off - and then just report an error such as "unable to find or read" the XML or something.


My server "friendly name" is DS720. I can't imagine that I should change it to "volume1" would I? I've not tried that but I'm open to anything. Can you scan this quickly and see if anything jumps out at you? (I'll send to your email).


BTW, Plex SUCKS. No tech support, no chat, nothing other than forums. You're on your own. I would punt it except it's the only thing I know that works with Sonos in the way I want.


If you have Plex, I'd be curious to see if you can browse to the Playlists navigation in the left side and click the three dots and see if "import iTunes playlist" shows up for you. See if that works before you update Plex and note which version you're on. If you see it, that's great. Even if you do, please update it to the newest software and see if it then shows up. If you don't want to bother, or don't have it, that's fine too. I'm just trying to see if it is there as they are telling me.


Thanks!!!!

Aug 11, 2021 12:23 PM in response to William Richards3

A quick question which I don't think got covered earlier, but I noticed on the new iTunes library I created (where I moved the songs right onto the NAS) that the two checkboxes when you go to File / Library / Organize Library, are not checked. The second one was grayed out on the original library I think. Anyway, I loaded the original library today just to check and both boxes are not checked either.


Could this have anything to do with the XML not being seen by Plex? I went back over our previous exchanges and you had said:

"...you would change the iTunes Media folder to \\volume1 to match and make sure that File > Library > Organize Library > Rearrange Files is greyed out. Tick it if it isn't before you start moving any files."


I missed this when I did this whole new library. Should I start over and create another library and make sure the Rearrange Files is checked? And should I also check either of those on the original library again now that the checkboxes are both unchecked? Should both of these boxes be checked with both libraries? Any instruction here would be greatly appreciated.


I'm trying everything I can here to try and get this working.


Thanks!!

Aug 11, 2021 1:29 PM in response to William Richards3

Guy just replied to the question about not having the Music Folder and he said it could be that I'm on an older version of iTunes. So I checked a newer version of iTunes on my laptop and sure enough, it's not there. Maybe I should just remove that from the XML? Could that be confusing Plex?? That the Music Folder location path is there? <key>Music Folder</key><string>file://localhost/Y:/MUSIC/</string>


That's not on the newer iTunes version. And perhaps it's time I break down and update iTunes? I wouldn't need to do the "share XML with other applications" check-box if so would I - as long as the XML can be copied to the NAS?


Thanks.

Aug 11, 2021 2:15 PM in response to turingtest2

turingtest2 wrote:

Hi,

You've probably seen this page before, but it looks like a fairly comprehensive guide.
https://alistairphillips.com/2020/12/31/import-itunes-apple-music-into-plex/
It knocks my assumption about getting rid of localhost out of the way.

I think I sent you that previously as it was familiar to me. I've read that. And yes, it seems localhost is a part of everything I've been reading. I read the forum link inside the article above and I did see that - even with these Ninja's - that Plex doesn't do a good job of importing large playlists (songs) or number of playlists. But still, even if that's the case, I cannot get import itunes playlists to even show up in the left Nav pane. I also noticed in the forum link that it seems it only works with a windows machine?

Following the guide it seems you need to edit the XML so you end up with paths of the form: file://localhost/volume1/Media/Music/<The rest of your path> and then the edited XML goes into:
volume1/Media/Music/, after which you can enable the plugin and import playlists from the XML via
Playlists > Import from iTunes.

I'm confused here. Are you saying I need to create a "Media" folder on my NAS? And then edit the XML so each song has that on it? Wouldn't that be changing the path that CustomRenamer did in moving the songs from the mapped drive?


Right now on my NAS, this are the folders. The two folders that say XML contain the XML file as you're supposed to put that in a different folder than the music/that Plex scans (which is different than what you're saying above).


The first "Music" folder has a sub-folder called MUSIC. This was the first music library I did. The Music1 contains the music that was moved from the Y mapped drive (or Music folder on the NAS) and changed the song file location (Get Info) to be "volume1/music1/Beatles - Hey Jude.m4a". So you're saying I need to make a MEDIA folder, then Music? I think that will break the iTunes links to the songs, unless I move everything a third time.


I honestly don't think that's the solution unless I'm missing something. I must confess, I'm am just about ready to give it up. Their software blows. There's no documentation. No live support. No chat available. The forums are an inconsistent, conflicting views mess that is terribly difficult to follow.


For example, the forum in the link in this article was the first that I read about playlists with too many songs (or maybe they meant too many playlists) is something Plex can't handle.


But NOWHERE does anyone say why my import iTunes playlists option isn't showing. The only thing I've seen on that was in some forum where they indicated it will only show up when iTunes and Plex are on the same machine. So perhaps I need to get iTunes installed on my NAS somehow? And I have no clue as to how to do that.


One really good guy who seemed to know his stuff - and did get import itunes playlist to show up in plex - said he put the ITL file, and the other iTune folders into a separate folder on his NAS.


God what a nightmare this has been. All I need to do is import my **** playlists!!!


Thoughts?

tt2


Aug 14, 2021 4:55 PM in response to turingtest2

Hello,


I've still not completed the goal but I think I'm closer to why it's been so difficult.


When I first had Plex many years ago now. I added a library and the playlists from iTunes imported fine. I don't recall how I did that, or what settings I used, but they were there.


There were two problems though: 1) I had to have my computer on to access Plex and 2) because of my scattered folder/file structure for music, the playlists were a mess. A playlist with 500 titles in reality, might only have 12 or whatever. Another playlist might have just 1 song. I think it was because Plex layout wants them all in Artist / Album / structure and I clearly was not doing that. So that's when I began work (with your amazing help) to reorganize things.


Concurrent with that, I wanted to put things on a NAS so I didn't have to leave iTunes on all the time.


Unbeknownst to me, this was not as easy as it was when I did it before on my computer. I know you cautioned me several times that iTunes doesn't work well outside it's normal setup or environment and you are clearly right,


But I still have to try to get iTunes working somehow so that playlists import in Plex. What I saw after much trial and effort, along with a lot of research and input, was that - I believe - Plex needs iTunes to be on the same system that Plex is on. Since Plex is hosted on a browser, I don't really understand why, but that is what I've surmised now all this time later.


One gentleman who came by way of a Plex forum, has manipulated iTunes so that Plex can find it and thinks it's running on the same thing. Now why NAS can't do the same thing is a mystery to me as it's just a hard-drive after all. But I think, because iTunes installs system files involving the OS, it is more complex than I could understand.


All this brings me to my query (aside from what I've posted the last couple times). Do you know how I might get iTunes set up so that Plex thinks it's on the same system? As I posted above, the guy told me he "moved" his iTunes stuff out of the My Music folders. But he also contradicted himself (I think) when he said he reinstalled iTunes but to a different location?


In my researching, I came across this post from you way back in 2013. I wondered if any of this could be utilized with what I'm trying to do?


https://discussions.apple.com/thread/5574359


I don't know if I'm on the right path or not, but clearly, and without question, Plex is not allowing me to import my playlists - and I think it's because it doesn't see iTunes anywhere. I've put the XML file in different locations. I already stop Plex and NAS when I make changes and then restart with each attempt to test whether it works or not. Nothing I've done yet has worked.


So I guess in summation:

  1. Can I move iTunes My Music folder?
  2. Will the playlists stay intact?
  3. Can I reinstall iTunes (a newer version?) to a different location (as long as I've not deleted the original system files that were created way back when at the time I initially installed iTunes if moving things isn't doable?


Of course, I don't know what fallout may occur with the XML and all that, but I'm trying so hard to get these playlists imported. Everything else is - and has been - working great with Sonos, Plex, iTunes. It's just these dang playlists.


Thanks as always!

Aug 15, 2021 6:27 AM in response to William Richards3

Hi William,


I finally caved in and installed Plex server on the NAS box I have here which is a really a work tool for offsite backup. I can now make much more sense of what is going on and how this is all supposed to work.


Earlier on you posted this snippet from one of your XML files:


file://localhost//volume1/music1/Al%20Green/Let's%20Stay%20Together/Al%20Green%20-20Let's%20Stay%20Together.m4a


Which indicates that you've got iTunes working with the shared folder music1 on your NAS. This needs almost no editing, but you should eliminate the second // in each path. To do this you would take a copy of the iTunes Library.xml file generated by iTunes and edit it with Notepad++. Use the Search > Replace... function to replace localhost// with localhost/ and replace all.


Save the edited file as volume1/music1/iTunes Library.xml


Now in Plex select the settings wrench, then Plugins and in the space for iTunes library XML path type in volume1/music1/iTunes Library.xml and save changes.


Go to the Music section of the library and click the icon followed by Scan Library Files.


Once you think the scan has completed go to Playlists > ⋮ > Import from iTunes...



Assuming all goes well your playlists should be imported. Setting the actual path to the XML file rather than leaving it blank, and scanning the library before attempting to import the playlists appear to be key to this working correctly. If you don't have a Playlists entry in the Plex library find any song and use the icon to add it to a new playlist which will add that section. You can remove the unwanted playlist later.





If you want to use a folder other than music1 as the primary library (perhaps that one was a test) key things to note are that files paths are case sensitive (i.e. MUSIC and Music are different things and cannot be used interchangeably) and that a file path in the XML should only contain one // immediately after file: with no spaces. Any spaces that you would otherwise have can be replaced with %20. (E.g. if the NAS share was called My Music then <FolderName> in the following would be My%20Music.) For the example where your iTunes media folder is given as Y:\MUSIC you'd copy the artist folders to your chosen music folder on the NAS (if not already there) and replace Y:/Music with volume1/<FolderName> in the XML.


tt2



Aug 15, 2021 6:19 PM in response to William Richards3

I only had one active library so didn't get that prompt. Presumably you want to add imported lists to the Plex Test library you've just created as that is the one you are testing with and that has the relevant media content that goes with the exported and edited XML file. You should probably use the Scan Library Files command for that library before attempting to import the playlists.


tt2

Aug 16, 2021 9:08 AM in response to William Richards3

Hi,


I didn't have time to get a screenshot, but I renamed my test playlist as 1-AM Pop & Classic Rock (4-5*) #1's, copied the updated XML file, corrected to path for the NAS, then used the Playlists > ⋮ > Import from iTunes... command and it imported as expected with the new title.


The key things are to make the right edit to the XML file so that the data makes sense from the perspective of the Plex server on the NAS, tell the iTunes Plugin where the XML file is located, then use Music > ⋮ > Scan Library Files followed by Playlists > ⋮ > Import from iTunes...


From the sound of things all you need to do for your library in the Music1 folder is remove the second // by, for example, replacing //volume1 with /volume1 and replacing all instances through the XML.


tt2

Aug 16, 2021 9:49 AM in response to turingtest2

A quick update. I tried the import iTunes playlists for the Plex Test library I created. I did not get an error message when I imported iTunes playlists on my test "Plex Test" library. However, it also did not import the playlist I created in that iTunes library. I noticed a step that I did not replicate of yours.


YOU SAID: In testing I created a new empty iTunes library in the folder D:\iTunes 4 Plex\ on my Windows 7 box, imported one album, and made a playlist of that album.


ME: What I missed was that you had a folder in your iTunes D:\iTunes 4 Plex\iTunes Media\Music

When I created my new iTunes library and made it on the D drive such as yours, it does not make a Music folder - at least it didn't do that for me. Perhaps that's my version 10.7? Did you actually go in and create this "Music" folder on the D drive? Should I do that? Perhaps that's why it didn't import. But again, I did not get an error message so I'm not sure. I do have a playlist tab for my Plex Test library and the playlist I created within Plex to get that tab to show up (as you did). But the iTunes named playlist is not showing after I imported.


So what I did was essentially copy a Paul Simon album right to the D drive so it's not part of the iTunes 4 Plex folder. Should that be in that folder structure?


One other concept I'm having a really hard time working through: How do I keep my playlists intact so iTunes doesn't lose track of the songs if I try to do this new library (another new one) but use my volume1 playlists? Here are my dilemmas:


  1. What would you do so I can use either my Volume1/music1 library in iTunes or the Y mapped library - both of which are in Plex. Neither of those were created on a D drive for example. Is there a way to do this so I can use the library already on NAS and in Plex or do you think I should start over and create a new library as you did and I did with the Plex Test one?
  2. A few weeks ago at least, I was able to create a new library so that I could keep the original Y mapped one, but then - using CustomRenamer - I moved music from that to my Volume1/Music1 folder on my NAS. (After I moved the Y music, I just copied the music right back on it where it was so that both libraries are now intact. And the playlists are all there on both as well.


Bottom line is how do I keep the playlists intact? What steps would you take? I think the key here is to create iTunes Library on a different drive and then copy it to the NAS as you did. Perhaps I could copy or move the current XML Volume1 XML on the C: iTunes Music folder and move to a different drive?


I'm just kind of stumped as to what to do. Can you please advise? Sure appreciate it!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

My iTunes preferences/media folder location keeps going to default

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.