Reader Alex Christie has run into a common iTunes frustration. He writes:
I have a lot of media files in my iTunes library and because of that, I store my iTunes media on a separate drive. I've configured iTunes so that it knows to place files on that drive but sometimes it loses track of the drive and reverts its storage location back to my internal drive. Is there any way I can prevent that or, at least, be warned that it's happened?
[ FREE DOWNLOAD: The Apple security survival guide ]
I sympathize, Alex. Like you, I have a lot of media. Unlike you, I store it on a NAS (Network Attached Storage) so all my devices can use the same media library. If the NAS isn't mounted (or iTunes believes it isn't) not only is my library full of exclamation marks (indicating iTunes can't find the files) but in iTunes' Advanced preference, the iTunes Media folder location switches back to the default, which is the Music folder in your user account.
Having suffered with this behavior for years, I finally did something about it. What I did is this:
First, I quit iTunes. I then copied the iTunes folder from its default location (chris/Music/iTunes) to the folder on my NAS where I store iTunes media (music, TV shows, movies, audiobooks, podcasts, etc). I then held down the Option key and launched iTunes. In the Choose iTunes Library window that appeared, I clicked the Choose Library button and navigated to the iTunes library I'd copied to the NAS and clicked the Open button. iTunes launched with no exclamation marks and with the location path correctly pointing to the NAS.
I then quit iTunes, navigated to the iTunes folder on my startup drive (again, chris/Music/iTunes), selected the iTunes Library.itl file, pressed Command-I to bring up its Info window, ticked its Locked box, and closed the window. When this file is locked, iTunes can't properly launch the iTunes library that file is associated with.
I then unmounted my NAS and launched iTunes. As expected I received an error, which read "The Folder Containing 'iTunes Library' cannot be found, and is required. Please choose or create a new iTunes library." When I clicked OK to dismiss the window I once again had the chance to navigate to where my real iTunes library was. My NAS still appeared as a shared device in the sidebar so I simply selected it, navigated to the iTunes folder, and clicked the Open button. iTunes opened without complaint and could play all my media. (If this kind of thing happens often, you can create an alias of the drive's iTunes folder, drop it on the desktop, and when prompted, simply drag it into the navigation window and click Open.)
Obviously this doesn't solve the problem of iTunes forgetting where you've asked it to save its media. But it does force iTunes to issue a warning that it can't find the location you've configured and is doing its level-best to return to the default iTunes folder. When you see that warning, you can take immediate measures to address the problem rather than discovering, weeks later, that iTunes has been shoving newly acquired media into its default storage location.
Note that I found when using this technique with my NAS, I had to copy the iTunes folder from each Mac to the NAS--using a different name for each, naturally. When I tried to launch iTunes with another Mac's iTunes folder I received an error.
This story, "Prevent iTunes from switching library locations" was originally published by Macworld.