E-Mail:

TIP: Getting iTunes to See Files After a Drive (Path) Change

  • 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]

8 Comments

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

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

where does one find “music directory in the settings” in iTunes? For the life of me, I can’t find it.

[...] it was time for some XML surgery. It’s no fun editing a 50MB file in TextMate, but the edits looked good. After iTunes [...]

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.

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

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?

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

What Do You Think?

 
53 queries / 0.159 seconds.