TIP: Getting iTunes to See Files After a Drive (Path) Change
- 10
- Add a Comment
- No Related Post
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]

10 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.
russell
September 29th, 2008
at 8:27am
hi thanks for the help i have all my tunes on a ex hard drive and the drive letter change for some reson
so i went into iTunes Music Library.xml and i could see the path of the tunes so i change the ex hard drive letter and bingo it all works again
thansk
Russ
April 14th, 2009
at 8:51pm
I wonder if you’d be able to help here:
I’ve moved my music to an external hard drive, and thus had to do this to get my music back. The problem is, it only worked for music that was actually in my iTunes music folder. This is only a few tracks, mainly ones I downloaded using iTunes. The rest were just in My Music/Artist/etc. The file paths are all correct in the XML file, but iTunes still says they can’t be found. What else can be done?
Collin Kennedy
July 6th, 2009
at 11:49pm
could you help me out though. Im importng music from a cd into itunes, but i dont have enough hard disk space on my default hard disk, wheareas i have someodd 60 gigs on my secondary drive. when i import on itunes it goes to my c drive, how can i make it so that the default path is my d drive? im running windows xp
kees
July 27th, 2009
at 9:19am
thanks. This is the tip I was looking for. I put all my music on a new external hd. I made sure the new hd name and iTunes music folder was the same as before. But iTunes could not find the iTunes music folder! I gave the old hd away , so I had a big problem. In preferences advanced the location of the music folder was changed. First I made a new library by opening iTunes while pressing the option key (mac). Then in (the new library) preferences advanced I made the location of my “iTunes music folder” a folder on my new hd. Imported one song, closed iTunes and opened the new “iTunes Music Library.xml” just to get the path to my new hd (yes noob). And followed the rest of your solution. I used TextWrangler (mac) to search/replace with the new path. I let iTunes index but not copy the files. And now everything works great. listening to music right now. yay
Carlo
November 5th, 2009
at 11:46am
Thanks for having published this. It really helped me understand how the .xml file controls everything for iTunes
Great Job!!!