3 Replies Latest reply: Feb 12, 2012 3:25 AM by turingtest2
Jtrory Level 1 Level 1 (0 points)

For years now I have had all of my music on an external drive to save space on my PC hard disk, but I have constantly had the issue of iTunes not being able to find my music on the drive. No amount of settings changes or exporting or importing libraries ever helps. The only thing I can do is reimport my entire music collection to reconstruct the library, which is a massive pain in the neck. I am at that point now and I really don't want to have to do this again. If I do it'll have to be goodbye iTunes, it's driving me nuts.


I'm thinking it could be related to one or both of these observations and am curious to know what people think.


First is that occasionally the letter of my external drive gets changed by Windows and that could cause problems. Currently it is N: but I think it might have been J: for a while. This seems to throw iTunes into a wirlwind of confusion - directing it in the Preferences dialog to the new drive letter does not help. The xml file does set the new destination, but iTunes seems to just default back to the C: drive and the Library in there, and resets the Library to whatever it finds on the C: drive, which is nothing at all (thus wiping my Library and causing iTunes not to be able to find any music). Meaning that once my library xml has been overwritten by iTunes, it doesn't matter what drive I'm asking it to look on, none of the music is in the library xml in the first place.


Which brings me to number two. iTunes insists on writing my Library xml file to Documents/Music on the C: drive when none of the music is on that drive. Even when I have iTunes working and it knows where my music is, the actual xml file is still in Documents/Music and I can't change it or move it. It always, always writes it there. This could be a problem because it seems as though when iTunes loses track of the drive letter for my external drive, it immediately looks in Documents/Music and overwrites the library xml accordingly, essentially wiping clean my library, forcing me to have to reconstruct the library by reimporting all my music.


So I think it's two things really. One, how can I get Windows to assign a permanent letter to my external drive? One that will never, ever change. And two, how can I get iTunes to write my library xml and other library related files on the external drive where my music is instead of on the C: drive? Because I think the two being seperated is also causing problems. And I suppose three, are either of these things the problem or is it something else?


Thanks for any help.

  • 1. Re: Why won't iTunes library work with my external drive?
    turingtest2 Level 8 Level 8 (46,550 points)

    Make a split library portable


    Here are the typical layouts for the iTunes folders:




    In the layout above, with the media folder (everything in the red box) inside the library folder, the library is considered to be portable. A portable library can be moved from one path to another without breaking the links between the library and the media and being self-contained is much easier to backup.


    You can rearrange things to make a split library portable by taking a number of small steps which don't break the library.


    Before you start any media files that are outside of the media folder will need to be consolidated. If the library is in the old style layout then it should ideally be be upgraded to iTunes Media Organisation (Library > Organise Library > Rearrange files in the folder <Media Folder>) to ensure that iPod Games, Mobile Applications etc. are brought inside the media folder.


    The basic non-fatal manipulations are:

    • You can connect to an alternate set of library files by holding down Shift (Win) or Option (Mac) when starting iTunes.
    • You can move the library files to a new location as long as the media stays put.
    • You can move the library files and the media together if the media folder is a direct subfolder of the library folder.
    • If you have already moved/copied the media content from a subfolder of the library folder to a different location then you only need to copy the library files for it to appear as if you have moved the entire library in the way allowed above. I.e. just copy the library files into the parent folder of the media folder.
    • You can rename the media folder to iTunes Media (if it isn't already) if the media folder is inside the library folder.
    • iTunes uses the name of the folder holding the library files as the window title. Having made a library "portable" you may need to take a final step of renaming the library folder to iTunes or, if the library files have ended up at the root of a drive, moving all of the library files and content folders into a new folder called iTunes.


    After each change you need to open, test and close the relevant library before attempting another change. If a change broke the library, undo it or revert to using the previous set of library files.


    In essence all you need to do to make your library portable is copy the library files into the parent folder of the media folder on the external/secondary drive and use the hold-down-shift/option-when-starting-iTunes method to connect to it. Other manipulations may be required to normalize the library so that the library and media folders have standard names.


    If you are making the library portable in advance of migrating it from one system to another, don't forget to deauthorise the old computer if you're not planning to use iTunes on it again.


    Regarding your specific questions. once you've created a portable library on an external drive if the drive letter should be changed then shift-start-iTunes will let you connect to the new path and all will be well. If the drive is not connected when iTunes starts then iTunes will report an error, letting you cancel, connect the drive, and restart. Again all will be well. Hence the solution to "two" makes the solution to "one" unnecessary, that said the Disk Management tool within the Computer Management Control Panel will let you modify drive letters.


    FYI the XML file is for use by third party tools and is not the main database of your library. The crucial file is iTunes Library.itl.



  • 2. Re: Why won't iTunes library work with my external drive?
    jtrory1 Level 1 Level 1 (0 points)

    Thanks for all the detailed info. I have placed all of my music within this folder structure on my external drive and reimported all my music. Everything is fine for the moment. The only thing I'm nervous about is that iTunes still places the .itl file on my C drive and will not write it to the external drive. Does iTunes insist on that file being in that location? Is it worth it to move the file? It seems like even if I did, iTunes would just write it again on the C drive. I'm still worried that if my external drive letter changes again iTunes will by default go looking for my music on the C drive instead of following the drive to the new letter, and then overwrite my library file when it can't find my music.

  • 3. Re: Why won't iTunes library work with my external drive?
    turingtest2 Level 8 Level 8 (46,550 points)

    To switch between .itl files you need to click the icon that launches iTunes and immediately press and hold down the shift key. Keep holding down until a dialog pops up asking you to choose or create a library. Click the choose button and navigate to the file you want to use. iTunes will carry on using the same file each time is starts unless the file can't be found or you use shift-start again.


    If the .itl file was in the default location, but can't be found when iTunes starts, then it silently creates a new empty library. If the file was anywhere else it registers an error and then gives you a chance to choose or create a library. If you external drive is disconnected, cancel the dialog, connect the drive, launch iTunes. If the drive letter has changed, and you've made the library portable, click choose and browse to the new location, otherwise cancel and use disk management tools to reassign the correct drive letter.