Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

permanently change iTunes Media Folder Location

I'm getting seriously agrivated with iTunes resetting to the default media folder location when I am disconnected from my NAS.

I bought some music yesterday on my iPhone and synced it with my Macbook. Turns out it synced it to the /user/ folder instead of the smb://nas folder. Then when I noticed this and copied the files over, it asked if I wanted to overwrite the folders (in Windows you say "yes" and it doesn't affect the items within the overwritten folder), so I said "yes" and it deleted the existing music in two of my folders... music I bought and cannot recover.

Why the **** does iTunes do such stupid things? I love my iPad, my iPhone and my Mac.. but seriously... iTunes is the worst program I've ever used (and I've used some bad ones).

So now that my rant is over... does anyone know how I can modify/tweek/hack iTunes so that my NAS is the permanent iTunes Media Folder, EVEN IF I disconnect and reconnect at a later date? I would rather see an error telling me that I cannot connect to the Media Folder, then have iTunes switch it without my knowing.

Macbook Pro, Mac OS X (10.6.3)

Posted on Jun 12, 2010 9:16 PM

Reply
13 replies

Jun 13, 2010 4:09 PM in response to Moof666

I only use iTunes when I'm connected to the NAS. If I'm out, I usually VPN in... but sometimes I forget to initiate the VPN before launching iTunes, and then iTunes silently fails and reverts back to default settings.

I can still access my music on the NAS but any NEW music gets dumped on the local disk, which then fills up very quickly because I'm only using a 64GB SSD.

I'm looking for a setting to disable/override the defaults.

Jun 13, 2010 7:28 PM in response to rockinthesixstring

rockinthesixstring wrote:
...but sometimes I forget to initiate the VPN before launching iTunes, and then iTunes silently fails and reverts back to default settings.


I believe that is your problem. If it's not connected, iTunes will return to the default location. The only way to avoid it is to be sure you're connected before launching iTunes.

Sep 7, 2010 3:32 AM in response to rockinthesixstring

I too have been searching in vain for a solution to this problem. There are a myriad of reasons why iTunes can lose its connection to an external drive but as the OP said, it SHOULD NOT just silently revert back to the default location it should alert you that there is a problem!

I have been burnt by this stupid design decision so many times that now before I start iTunes I try to check that the external drive is indeed mapped but on occasion I forget i.e. sometimes when I plug my iPhone into recharge.

Please, please, please Apple sort this out or at least provide some config option that will make it work in the way we have described.

Sep 7, 2010 4:27 AM in response to dumb-corporations

If you put your library files on the external/networked drive along with the media folder then if you start iTunes without connecting iTunes will announce that it can't find your library. Simply cancel, connect the drive and restart iTunes. All will be well...

For best results your library files should be in the parent folder of your iTunes Media folder (you did call this something sensible like *\\<drive>\iTunes\iTunes Media* didn't you?) so that the entire library is portable, i.e. it won't break if the drive is assigned a new letter/volume name. If you current media folder is something along the lines of *\\<drive>\iTunes Media* then it is usually possible to rearrange things by first moving the library files & album artwork folder to the parent folder, e.g. \\<drive>\ opening and closing iTunes so it recongnises the new relationship between the library & the media folder, then moving the library files, artwork & media folders into a newly created folder called \\<drive>\iTunes.

When moving the library folders use SHIFT(Win) or OPTION(Mac) when starting iTunes to get the option to open the files in their new location.

tt2

Message was edited by: turingtest2

Sep 7, 2010 10:12 AM in response to turingtest2

The easiest way to do this is to mount your smb share under the iTunes default directory. This way it is always pointing at the default directory even when you aren't connected. You won't have to change the library location, and if the smb share doesn't exist. Your music just won't play.

As far as opening iTunes before you are VPNed in. You could just be more careful to make sure that your are connected to your drive before you open iTunes. The only other way to get around this is launch iTunes from a shell script or an applescript that checks to make sure that the drive is mounted before it opens iTunes. It will throw an error (like you suggested) if the smb share isn't mounted and cancel the iTunes launch.

Cheers,
Jay

Sep 7, 2010 7:10 PM in response to rockinthesixstring

I had this problem a while ago when i installed a sonos music system and wanted my music library location to default to a time capsule. However if the capsule is idle when I launched itunes, the library defaults back to its original location. Annoying.

The easiest method I found by far was to create a script using the apple script editor


tell application "iTunes"
activate
end tell


Save this script as an application on your network drive. Remove the default itunes icon from your dock, drag this file there in its place and give it the appropriate icon. Now when its clicked it forces the drive to wake up from its idle state so when itunes launches its able to find your library each time. I have had no problems for almost a year now. I found this solution through a google search, I am not mac savvy enough myself. I hope this helps.

Aug 19, 2011 6:01 AM in response to rockinthesixstring

Hey rockinthesixstring, I had the exact same issue, and it was driving me up a wall. I had thirty gigabytes of music, and only ten gigabytes of space on my primary hard drive (C:), so I moved my library to my second hard drive (D:). BUT ITUNES KEPT RESETTING THE MEDIA LOCATION FOLDER!!! I had to manually change it back every time I opened the program, and re-add all of my files. I noticed something strange, too. All of my settings were also being reset, like the name of my library, grid colors, things like that. I even contacted Apple Support team twice, but they couldn't figure out the issue either.


But then I noticed something else: in my default folder, where iTunes was trying to force my library to be, I had the iTunes preference and library folders (iTunes Library.itl, iTunes Music Library.xml, ect.) but they weren't being created in the iTunes folder on my new drive. Here's what I did (and what worked for me!):


I had the following setup for the folder I wanted my music to be (D:\iTunes\iTunes Media). I went back into iTunes, changed the preferences and media folder to how I wanted it again, and re-imported all of my songs.


Then, **leaving iTunes open**, I created a new folder like this (D:\Music\iTunes\iTunes Media). I only did this to differentiate one from the other, and give it a structure similar to how iTunes prefers it to be. You can name the folders whatever you want. I went back to iTunes, and changed the media folder location to the new one I has just created. Then I went to File>Library>Organize Library>Consolidate Files. This made an exact copy of my initial folder into the new folder.


I then grabbed the iTunes Library.itl file from the folder in the drive (you'll probably find it in the first folder you had on the drive you want it to be on, but it may already be in the new folder) and make sure it's copied to or already in the new folder.


Then close iTunes. This time when you open iTunes, before you click on the program, hold down the SHIFT key. You should see a box open up that has options like "Quit", "Choose Library...", and "Create Library..." Click on "Choose Library..." and locate the iTunes Library.itl file you just saw, and select it.


iTunes will re-import all of the songs again, but if you go to where your new folder on your desired drive is located, you should also see all of the iTunes preference files that weren't there before.


What I realized with this is that iTunes doesn't use the iTunes/iTunes Media/Music folder to keep track of your library. It uses these .itl and .xml files instead. When we created our new media locations on the new drives, iTunes didn't re-create these files onto the new drive. Since iTunes didn't have these files on the new drive to point to when it was restarted, it silently reverted back to the main drive, where it knows those files can be found.


Once this lengthy but worth it process is completed, test out iTunes. You should be able to open and close the program and have your iTunes library there every time without it ever resetting again.


Then go back and delete all the files you had for iTunes in the first folder you created on the new drive. Also make sure that you don't have any iTunes files or folders on your main drive that you don't want your music on. You should have just one copy of your files once this is all over.


This worked for me, and I really hope it works for you, too. For ALL of you!


Happy music listening!

Feb 1, 2014 12:39 AM in response to rockinthesixstring

I too have had this problem, but instead of deleting two folders, it deleted my 27,000+ songs. Thats my 600+ records, my 900+ CDs and decades worth of downloading. I normally back everything up but it just happens that I was dealing with a backup disk failure at the time. If anybody from the iTunes team had been to hand, I could have murdered them. Of course, I can redigitize the records and recopy the CDs but I think it will just be easier to live without. I don't believe this terrible flaw is just a design oversight, but is symptomatic of the Ubercontroling culture that disregards customers' wishes.

Feb 2, 2014 4:33 PM in response to Limnos

Of course, I should have waited till I had my backups sorted out before using iTunes, given it's propensity to create havok, but my software shouldn't be working against me. One should reasonably be able to expect that a music program is not going to delete all of one's music, in normal use.


There used to be a Ford Pinto that was prone to bursing into flames when involved in collisions. Clearly, the best course of action for any driver, was to avoid having an accident. Nonetheless, the Ford Motor Company knew about the flaw and was negligent in not fixing their design flaw.
Losing my music is nowhere as serious as losing my life but if moving one's music library entails the risk of losing it or having it fragmented. I would call that a serious design flaw.

permanently change iTunes Media Folder Location

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