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 2, 2021 3:44 PM in response to William Richards3

I noticed a few things I'd sure like your feedback on.


Inside iTunes, I highlighted the DS720 and noticed that a lot of the metadata is missing. I did refresh on the NAS but it didn't matter. You'll notice a number of songs has the genre, and other information I use. But there are quite a large number (such as the Billy Joel example below) that doesn't have this data which is clearly in itunes.


So if the NAS isn't seeing it (at least according to iTunes), then Plex likely won't see it either. And I did go into the XML file and searched a few Billy Joel songs and the data is clearly there.


I can't import it into Plex if the data is not all there.

I saw posts (and maybe you advised doing this - I've lost track I'm so buried in this) that said you should copy the iTunes music folder location (ITL, XML, Artwork, etc.) to your NAS. Should I do that? Could that be the problem? I uploaded (basically imported) the XML to the Music folder where I moved everything.


I gotta tell you, I am about ready to just blow up this whole thing up as I'm so worn down by it all. WHY the **** doesn't Plex (or Apple) allow you to import playlists???!!! If I could do that, this project would have been over six months ago or more but here I sit still struggling. Sorry to vent.


So I guess the summation of things today (which I'm holding out hope you'll reply to expeditiously):


  1. The back and forward slash issue. Does it make any difference? Should I try typing in one single forward slash and then volume1 to match what Plex shows? But what's REALLY odd is that the XML file shows the forward slash which is what Plex sees so maybe it's fine the way it is. Here's an example. If this is how it shows in XML, why does it show the \\volume1\music in iTunes/Get Info???

<key>Location</key><string>file://localhost//volume1/music1/Issac%20Hayes/Shaft/Issac%20Hayes%20-%20Theme%20From%20Shaft.m4a</string>


2. Should I copy the whole second, new library I created (volume1) onto the NAS? In it's own folder, sort of with the other Artist/Album folders?

3. Why isn't all the metadata showing up on the NAS? I could understand if NONE of it is there, but it's only certain artists/songs. Why? And what can be done?


I am at a complete loss as to what to do now that I've finished updating my second library. This took days of work because I use different folders and stuff. For example, "Soundtracks" for those artists that fit that. Or "Tribute Albums", "Classical", etc., where I want them organized into a folder so these random artists don't clog up my library folders and instead they organize within these folders. That takes a lot of work.


Please help. Please.

Thanks.

Aug 3, 2021 6:49 AM in response to William Richards3

William Richards3 wrote:

<snip>
What build of iTunes are you currently running?
I'm still on 10.7.0.21


OK, that ought to be able to store your preferred media folder location. Try right-clicking the iTunes shortcut and use Run as Administrator, then see if the new folder you choose sticks after closing and then opening iTunes.

Where is the iTunes Library.itl file for the library?
C:\Users\Bill\Music\iTunes Volume1

What is the media folder path that you want to use?
\\volume1\music1


So this is a split library scenario. That should still work, particularly as you're taking full manual control of where files actually end up, but still somewhat annoying if you cannot set a media folder in preferences and have it stick.


OTE: I just noticed something that might force me to redo everything I've been doing in the past week or so. When you showed me how to create the Volume1 thing in the regedit file, I did \\volume1 (two backslashes in front of volume1). When I run the CR script, I have it set to what shows above (\\volume1\music1). But I just noticed a couple of things:

In iTunes, it shows the songs with the two backslashes in front.
1. https://discussions.apple.com/content/attachment/964ab839-d6ac-4af5-ada0-23306b321b49
2. But in Plex, it shows only one backslash - and it is a forward backslash (does that matter?). (Now, it could be that it's because I've not added the songs to Plex yet and it's reading it from the mapped Y drive still?)

And will it make a difference in Plex as it relates to the XML file and trying to get Plex to see the playlists, if Plex sees the songs with a forward backslash versus two backwards backslashes?
Here's a song in Plex right now, reading off the Y mapped drive

/volume1/music/MUSIC/Stevie Wonder/Innervisions/Stevie Wonder - Higher Ground.m4a

See Make a split library portable - Apple Community for general background on the layout of the library.

Wow, I hope this isn't going to be an issue. I could add a song from the new \\volume1 NAS location into Plex to see how it reads my new location but I'm worried it could muck things up when I add the new library.

Thoughts?


Windows uses \\ to indicate the start of a network file path. Your NAS (and therefore Plex) is likely based on the SMB file system which uses / at the start (and forward slashes instead of backslashes) for the same path. These are simply two different ways of referring to the same file. As long as whatever software you are using copes with the translation between them it is fine.


Where you may have to be careful is with mapped drives. E.g. if Y:\ is mapped to \\volume1 then you have to be careful using CustomRenamer, or indeed any other process, to move files from one path to the other. In general a move can be thought of as a copy from one location to another, creating any necessary folders first, followed by deleting the original copy of the file and then cleaning up any emptied folders. If there are two different ways of reaching the exact same file then reorganizing operations have the potential to delete files.


tt2

Aug 3, 2021 6:59 AM in response to William Richards3

William Richards3 wrote:

And I also need to add that when I right-click properties on the NAS for the Music folder, it is showing /volume1/Music. So that matches up with what is in Plex.

So should I redo all the music in my new iTunes library and use CR again but do this:
1. Change the regedit file so that it shows "/volume1/music" instead of the \\volume1\music that it is showing now?
2. Then move all the songs once again but to this new location?


  1. What regedit file? Regedit is used to modify the Windows system registry. iTunes generally relies on its own configuration files.
  2. You can use the script to move files where you want to when you're ready as long as you use a script that will update iTunes as to the new location.

I'm not sure it's possible to make a change to this registry but before I move this new music library into Plex I need to make sure this is all as it should be.

1. Which manner of backslashes should I use?
2. Where should I put the iTunes library on the NAS that contains the XML/ITL files per your query? Move it after iTunes first creates, and puts it in the C: Music drive by default?


When working in Windows you should be using the backslash as a folder separator, and \\ as the start of a network path. You will want to continue with a split library layout as putting the library on a NAS would give poor performance, so ignore my normal recommendation on making a split library portable.


tt2

Aug 3, 2021 7:08 AM in response to turingtest2

turingtest2 wrote:


William Richards3 wrote:

<snip>
What build of iTunes are you currently running?
I'm still on 10.7.0.21

OK, that ought to be able to store your preferred media folder location. Try right-clicking the iTunes shortcut and use Run as Administrator, then see if the new folder you choose sticks after closing and then opening iTunes.

You mean to right-click the iTunes icon? I tried that but there was no option to run as Admin. Is there another shortcut I'm not understanding?

Where is the iTunes Library.itl file for the library?
C:\Users\Bill\Music\iTunes Volume1

What is the media folder path that you want to use?
\\volume1\music1

So this is a split library scenario. That should still work, particularly as you're taking full manual control of where files actually end up, but still somewhat annoying if you cannot set a media folder in preferences and have it stick.

I thought overnight that perhaps if I move the entire C:\Users\Bill\Music\iTunes Volume1 folder to the NAS, perhaps it would then see it? Or again, maybe I'm misunderstanding. And as far as it sticking, this is why I created a second iTunes library so that I would just use it for this set up in Plex hopefully and then just use the mapped Y drive for day-to-day listening on my computer while I work. I've thought about removing the mapped drive entirely since I've moved music to the Volume1 location on the NAS and just have it on my local computer on a hard-drive as I used to.


And BTW, do I click "keep iTunes media files organized"? And File/Library/Organize/Consolidate (and/or Reorganize) checkboxes? Would that help keep the location in place?

OTE: I just noticed something that might force me to redo everything I've been doing in the past week or so. When you showed me how to create the Volume1 thing in the regedit file, I did \\volume1 (two backslashes in front of volume1). When I run the CR script, I have it set to what shows above (\\volume1\music1). But I just noticed a couple of things:

In iTunes, it shows the songs with the two backslashes in front.
1. https://discussions.apple.com/content/attachment/964ab839-d6ac-4af5-ada0-23306b321b49
2. But in Plex, it shows only one backslash - and it is a forward backslash (does that matter?). (Now, it could be that it's because I've not added the songs to Plex yet and it's reading it from the mapped Y drive still?)

And will it make a difference in Plex as it relates to the XML file and trying to get Plex to see the playlists, if Plex sees the songs with a forward backslash versus two backwards backslashes?
Here's a song in Plex right now, reading off the Y mapped drive

/volume1/music/MUSIC/Stevie Wonder/Innervisions/Stevie Wonder - Higher Ground.m4a

See Make a split library portable - Apple Community for general background on the layout of the library.

Wow, I hope this isn't going to be an issue. I could add a song from the new \\volume1 NAS location into Plex to see how it reads my new location but I'm worried it could muck things up when I add the new library.

Thoughts?

Windows uses \\ to indicate the start of a network file path. Your NAS (and therefore Plex) is likely based on the SMB file system which uses / at the start (and forward slashes instead of backslashes) for the same path. These are simply two different ways of referring to the same file. As long as whatever software you are using copes with the translation between them it is fine.

I did check the file properties for a song on my NAS and it is indeed the forward slashes (even though it shows backward slashes in iTunes/Get Info, so I believe this is likely okay as you indicate - which is very good news.

Where you may have to be careful is with mapped drives. E.g. if Y:\ is mapped to \\volume1 then you have to be careful using CustomRenamer, or indeed any other process, to move files from one path to the other. In general a move can be thought of as a copy from one location to another, creating any necessary folders first, followed by deleting the original copy of the file and then cleaning up any emptied folders. If there are two different ways of reaching the exact same file then reorganizing operations have the potential to delete files.

I carefully moved music from the new music library ("volume1") to the NAS and no files were lost.


Do you have any insight as to why not all the metadata is showing up per my post above yesterday at 6:44pm? Why would a good number of songs on the NAS for the Music folder have the data in the fields I use (composer, grouping, comments, genre...) and some don't? I thought maybe I should delete the XML and move it to a different location. OR..., maybe I need to move the actual Music folder from the C: drive (as above) to the NAS? Perhaps that would help with the metadata - and also with iTunes knowing where this new, second music library is when I close and then re-open iTunes?


tt2

Thanks!!!

Aug 3, 2021 7:15 AM in response to turingtest2

turingtest2 wrote:


William Richards3 wrote:

And I also need to add that when I right-click properties on the NAS for the Music folder, it is showing /volume1/Music. So that matches up with what is in Plex.

So should I redo all the music in my new iTunes library and use CR again but do this:
1. Change the regedit file so that it shows "/volume1/music" instead of the \\volume1\music that it is showing now?
2. Then move all the songs once again but to this new location?
1.
What regedit file? Regedit is used to modify the Windows system registry. iTunes generally relies on its own configuration files.

My apologies. I misspoke. It was this you had said (and that I created, and works per your guidance): You should be able to edit the file C:\Windows\System32\drivers\etc\hosts in Notepad.

. You can use the script to move files where you want to when you're ready as long as you use a script that will update iTunes as to the new location.

You're talking about music files, right? Not moving these: C:\Users\Bill\Music\iTunes Volume1 files for the second library.


I'm not sure it's possible to make a change to this registry but before I move this new music library into Plex I need to make sure this is all as it should be.

1. Which manner of backslashes should I use?
2. Where should I put the iTunes library on the NAS that contains the XML/ITL files per your query? Move it after iTunes first creates, and puts it in the C: Music drive by default?

Where do you think I should put the XML or won't it matter? Right now I put it in the same folder as the music Artist/albums are located.

hen working in Windows you should be using the backslash as a folder separator, and \\ as the start of a network path. You will want to continue with a split library layout as putting the library on a NAS would give poor performance, so ignore my normal recommendation on making a split library portable.

Yes, I think, based on what I've done, the split library wouldn't be the way to go.

t2

Bill

Aug 3, 2021 9:10 AM in response to William Richards3

Where do you think I should put the XML or won't it matter? Right now I put it in the same folder as the music Artist/albums are located.


iTunes uses the .itl file. The .xml file (if generated automatically) is created in the same folder as the .itl file. You can manually copy it to any other location if that helps you use other software, but then it won't get updated automatically. You can also export an XML version of the library at any point using File > Library > Export Library.


tt2

Aug 3, 2021 9:50 AM in response to turingtest2

Yes, I know to do that. I also understand that if I make changes or updates to the library that I'll have to update the XML if I've copied it to another location outside the iTunes.


And again, should I move the second iTunes library set of music files to the NAS so that the ITL, XML, Artwork, etc. is all on the NAS?


And do you know why the metadata isn't showing up for some songs per my capture from yesterday? Why would it be missing on some songs? I checked the XML file itself, opening it in notepad, and the data is there. Why would it only show on some of the songs? I'm sure this is outside iTunes scope, but just wondered if you had a thought on what I could do. And maybe if I moved the iTunes library set of music files to the NAS, it would pick it up better somehow?


Thanks!

Aug 3, 2021 1:17 PM in response to William Richards3

The file system on the NAS isn't connected to the ITL or XML in any way. Either the tracks have embedded metadata that can be shown, or they don't. There are circumstances in which files aren't tagged, e.g. certain ripping software, files in .wav format, etc. Rarely mp3 files can have more than one tag, and if so it isn't clear which one gets updated when you use iTunes to make changes. This issue is addressed in the multiple tags section of Repair security permissions for iTunes for Windows - Apple Community. Copying or moving files from one location to another shouldn't alter their embedded tags, whether you use Windows Explorer to do it or the CustomRenamer script.


tt2

Aug 3, 2021 2:53 PM in response to turingtest2

turingtest2 wrote:

The file system on the NAS isn't connected to the ITL or XML in any way. Either the tracks have embedded metadata that can be shown, or they don't. There are circumstances in which files aren't tagged, e.g. certain ripping software, files in .wav format, etc. Rarely mp3 files can have more than one tag, and if so it isn't clear which one gets updated when you use iTunes to make changes. This issue is addressed in the multiple tags section of Repair security permissions for iTunes for Windows - Apple Community. Copying or moving files from one location to another shouldn't alter their embedded tags, whether you use Windows Explorer to do it or the CustomRenamer script.

I went to Windows Explorer and have discovered a MASSIVE and MAJOR problem. I've lost track at what point this happened, how it happened and which element(s) are to blame. Likely a combination of things.


I am notorious for having backups. I have backups of my backups, and backups of those and never noticed this before. It could have been the CustomRenamer script, Export/Import, or some script used along the way, or a ripping or converter program, it's hard to know at what step.


As reported, a large number of songs are missing metadata. As all the metadata was showing in iTunes, I assumed it was on the song files as well. It was before, but much has been lost. I'm at a loss as to what to do next. Might as well forget the cause and focus on the solution.


THE GOOD:

All the metadata is in iTunes for the songs. And on songs in Windows Explorer, many songs have most of the metadata. I did notice that two key fields I use, are missing - that being "Rating" and "Grouping".


Most of the data is also on the previously used MP3 song files. I didn't check them all obviously, but every one I did check had most all the fields I need and information in those fields. If not, the Windows right-click/properties, then "ID-Tag" tab allowed me to enter the field I want (though this would also take some work) - and even then, "Rating" field didn't populate the proper rating.


The key fields in no order of importance, other than main ones (Artist, Title, etc.) are: Grouping, BMP, Composer, Comments, Genre, Rating.


THE BAD:

There doesn't appear to be anything - outside of the song files inside iTunes themselves - that has everything I need.

Grouping and Rating is missing from every single one of them. I unfortunately didn't catch this when I replaced MP3 versions with ALAC. I made ALAC versions from .wav files (which contained no metadata of course). But when I used Export/Import, and replaced mp3 with ALAC, the data was there inside iTunes - so I thought all was fine.


While the metadata is on the songs in iTunes, not everything is on song file in Windows explorer, so this is the same phenomenon where the album art would go missing and I would have to use your script (as I recall) to get those to show up.

I either have to manually go through just shy of 15,000 song files and fix in Windows Explorer, and then see if it shows up on the NAS.


And another huge concern now with the NAS I noticed is that they don't have a "Rating" field, or Grouping, or BPM. So if it's not on the file in NAS (at least to see), I'm not sure it would import it into Plex when I add this library to Plex.

If I could just simply get the playlists into Plex, then maybe this additional stuff I've just now discovered, wouldn't be an issue?


Would your repair registry have anything to do with these challenges? As I said, all the information is in iTunes right now. Every single song has all the data I need. How can I best get that data on the songs outside iTunes? Does a script exist that could do that?


The XML file itself shows the data just fine. It must be this Windows Explorer thing that is the culprit. And fact is, the ALAC files with the mapped Y drive doesn't have all the metadata either I discovered. Not even the MP3 files have all the data (including ratings - even when I check that field in Explorer).


Do you think if the song data is missing on some songs - but I am successful in getting the playlists to import into Plex - that it would matter at that point? Because I can play songs from iTunes with the data all there, and with Plex, I won't be creating playlists, or searching for music based on their tags anyway.


Do you have any sensible way to approach this so I can finally end this nightmare???


Priorities for me:

  1. Get the playlists into Plex - even if the song data isn't all there for every song. The Artist/Title certainly are - and the data is in the XML file - so I'm hoping that that would hold the playlists together okay? As long as the playlist shows artist/title, that should be enough?
  2. Figure out the easiest way to get all the song data on the song files so I have it moving forward should I do any other work such as this down the road.


Thank you as always!


t2


Aug 5, 2021 4:28 PM in response to William Richards3

I was able to find the XML path and changed it to the new one - but it appears that it applies to any library coming from the NAS. So I'm not sure how Plex reads the right XML but I'll try some things. I did notice that Plex only puts genres on artists, not individual songs. For a song, the only fields available are "mood". Who the heck devised this platform? So if you want to create playlists, you can only do it based on artist. And even at that, it's cumbersome beyond belief. So who decided not to put genres on artists? Or better still, only have Mood as the only field you can put something on for a song?


Wish me luck.

Aug 6, 2021 9:12 AM in response to turingtest2

I have not given up yet. I am inside the Plex forums and a Plex Ninja (expert?) has replied with this in relation to getting iTunes playlists to import. NOTE: I had created this second iTunes library using the "volume1" and kept the original library as well so this is why there is a MUSIC1 folder now. So the original music library on the NAS/Plex is mapped Y drive and is on the NAS at Music/Music/ folder. The new volume1 library is on the NAS/Plex at Music1. There is no sub-folder.


Here's what the Plex Ninja said:


"I’ve been asking around for a different thread some time ago and got a confirmation that it’s supposed to still be working.

From what I remember, the steps to make this work are:

  1. configure Settings > [Server Name] > Plugins > iTunes library XML path in Plex, pointing to the correct XML path
  2. configure iTunes to allow access to the library.xml file (that used to be a restriction on macOS at least → should be enable the xml file generation in iTunes)
  3. verify the paths referred in the XML file are the same as Plex will see them (e.g. because the PMS is running on the same environment or uses the same mount point structure) – I suppose that’s what you’re pointing out in your last post
  4. create the library w/ import iTunes playlists checked


If this does work, then there must be something I'm doing that is still not lining things up.


Here is the setting for Plex for the setting of the XML path:


From the song file inside iTunes "volume1" second library:


From the song file properties inside Plex: /volume1/music1/Al Green/Let's Stay Together/Al Green - Let's Stay Together.m4a


From the XML song file properties:

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


The folder location of the XML on the PLEX:


Now, I also placed the iTunes folder from the C: drive onto this Music1 folder and it's shown as a folder, same as an album folder. I've tried it both ways but perhaps this is mucking things up.


I saw a post by someone (and others have gone down this path as well in various searches over the many months) and they talk about removing this 20% thing. Here's an example:

https://alistairphillips.com/2020/12/31/import-itunes-apple-music-into-plex/


Remember I'm on version 10.7 for iTunes. Some mentions have said to check "share XML" or whatever checkbox that is in advanced preferences (I don't see that on my version).


There must be some solution here. There's got to be!! Any input would be greatly appreciated. I am so close to resolving this, I can just feel it but I'm not astute enough to figure it out on my own and would really appreciate your input as always. Thanks!

Aug 6, 2021 10:12 AM in response to William Richards3

.iTunes Preferences.plist is a file that iTunes creates in the media folder. It holds an identifier for library and records whether the media folder is in the old layout or the (not quite so) new one as described in Make a split library portable - Apple Community. I.e. do artist folders go directly inside the media folder (old) or into a subfolder called music (new)? Given you are manually/scriptily? managing the layout you can ignore the file.


tt2


Aug 6, 2021 2:42 PM in response to turingtest2



turingtest2 wrote:

I don't think you need to edit the highlighted line, as far as I can tell that declares that there is one library (media) folder. My guess is you have to edit the line a couple above that starts with <key>Location</key>, but for every track. What might confuse the Plex server running on the NAS is the reference to localhost. Replacing localhost with nothing wherever it appears in the XML might make something that is acceptable to Plex. You can see that in the <Location>strings the XML version is already using forward slashes as it uses the file://<somepath> form rather than the Windows standard, so there is no need to change the slashes.

The gentleman in the forum did mention "localhost" to the question someone else was asking (who was also having Import iTunes playlists troubles), but that seemed to have to do with setting the XML path within Plex, not the XML file that I'm aware of. The person starting the forum had his XML path inside Plex as "//localhost/volume1/.....etc" So he said to remove the local host but nothing about that in the actual XML. Makes sense though.


So if I put the XML path within Plex with forward slashed (/volume1/music1/) that would be okay, right? The Plex guy says you need forward slashes.


I wonder why (and I asked him and am awaiting reply) Plex would offer an iTunes import playlist option and expect users (who are likely much less savvy) to edit an XML file to make that work.


As for the forward slashes, he was mentioning it also in the XML path within Plex. Did I mention that he confirmed that with the new version of Plex, the import iTunes playlists option has returned?


If I have to remove the %20 for each song, that's like a bunch of editing - and if it were only one on each song, then I could do "find/replace all" kind of thing. But since there's a lot of them, I'd be worried that it would be problematic.


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


I'd have to remove 8 of them per song. Times nearly 15,000 songs, that's 120,000 edits to find/replace.


I agree with you that it seems like the Key Location is what he's referring to. That seems very logical and I will confirm with him.

t2


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

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.


Using Notepad++ you can run a search and replace operation to replace localhost/ with nothing, then save a copy of the edited XML file and see what Plex makes of it.


tt2

Aug 6, 2021 6:24 PM in response to William Richards3

I did NOT tell you to replace every single space in the xml file with %20. You only need to do that with the file path.


I.e. If you had Some Path With Spaces you would rewrite it as Some%20Path%20With%20Spaces. The paths in the XML file already have any spaces represented by %20. so you don't need to do anything there.


The correct form of the file URL is file://therestofthepath. Two forward slashes, though I think you might get away with three. Four feels like too many.


tt2

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.