TIP: Getting iTunes to See Files After a Drive (Path) Change
- 5
- Add a Comment
After a summer of sweat in my office last year due to four computers running in my small office, I have consolidated down to one PC (desktop) and one Mac (notebook). Only the NAS, switch, and printers (laser and ink) are the other heat contributers at this point. In fact, I sit here in my office without the ceiling fan going and I don’t even have a single bead of sweat on my head.
But I did have one problem: path issue in iTunes. With a 25 MB settings XML file for my Windows install of iTunes, I really didn’t feel like losing all my ratings, play counts, and other metadata that I’ve built up over the last two years. What was I going to do? Hack! I knew all I had to do was change the path in my iTunes Music Library.xml file and I’d be good to go. Thing was, after doing the massive search-and-replace, iTunes still complained that it couldn’t find my music. Ugh! After some head scratching, I figured out the issue and presto, I’m back in business! So here’s what I did.
- First, back up your iTunes Music Library.xml file. In OS X it’s in your $HOME/Music/iTunes/ directory. Windows users can find it in \My Documents\My Music\iTunes.
- Second, open “iTunes Music Library.xml” in a good text editor like TextPad (Windows). Then do a search-and-replace for the old path up to the directory name that did NOT change and replace it with the new path up to the directory name that did not change. For example, search for “\\server1\jamz\” and change it to “\\nas\mp3s\”. So if MC Hammer’s best of was in “\\server1\jamz\mc hammer\greatest hits\” it would now be in “\\nas\mp3s\mc hammer\greatest hits\”.
- Now here’s the important part, open iTunes and change your music directory in the settings. Once you’ve don this, it’ll start re-indexing. You can cancel this as you’ve already taken care of this in your XML file.
- Close iTunes again (to close the settings file and save the changes) and then reopen it. Done!
If you’re doing this on a Mac, you may be aided by an AppleScript called itunesTrackCPR that helps edit your XML file. It gets high user marks and is a free download. You may still have to make the directory change within iTunes preferences after the AppleScript does it’s work.
For me, I saved years of custom settings and was able to move my 90 GB of music onto a Network Attached Server. Now I can kick my Windows 2003 Server to the curb (well, actually to Craigslist) and chill out…a little. :)
[tags]path,itunes,drive,change,settings[/tags]

5 Comments
star
February 23rd, 2007
at 6:45pm
Thanks for your advice.
The link to the itunes Track CPR appeared to be broken in Safari. This is the permalink: http://www.dougscripts.com/itunes/scripts/ss.php?sp=itunestrackcpr
jay
October 22nd, 2007
at 8:02am
your post is quite old but I have exactly the same problem. but your description is not working for me. my xml file will always be overwriten by itunes. do you have any new recommondations?
I’m using os 10.3 an itunes 7
thanks
j
Chet
April 21st, 2008
at 2:28pm
where does one find “music directory in the settings” in iTunes? For the life of me, I can’t find it.
scot hacker’s foobar blog » iTunes and Network Attached Storage
May 7th, 2008
at 10:57pm
[...] it was time for some XML surgery. It’s no fun editing a 50MB file in TextMate, but the edits looked good. After iTunes [...]
tomasio
June 1st, 2008
at 4:51am
Thank you for this entry, it saved my life after I had to restore my music to another location. Editing the original “iTunes Music Library.xml” file after making a backup spared me the reindexing-part. I just opened iTunes after making the path-replacements and my music played from the right location.