iTunes + new hard drive = headache
October 30, 2009 11:58 AM   Subscribe

MrR moved my music drive (to a larger hard drive yay!) and iTunes is not handling this gracefully at all. (He hates iTunes, will not use it, and therefore did not follow any of the procedures detailed in the answers to this question.) The directory trees are all the same, the only change is the drive letter. How do I get iTunes to look in the right place without losing all the metadata (ratings, play dates/frequency)? (PC; iTunes does not organise my library; the old drive is already removed from my computer and wiped. Changing each file path individually is functionally not acceptable (30K files!), nor is changing the drive letter.)
posted by jlkr to Computers & Internet (23 answers total) 4 users marked this as a favorite
1. Find your "iTunes Music Library.xml" file (it should be in My Music\iTunes).
2. Open it with a text editor (notepad is fine... just run notepad and drag the file into there)
3. Do a search-and-replace for the proper path (e.g. global replace "file://localhost/F:/" with "file://localhost/G:/").

Do this when iTunes isn't running, of course. This is untested but it should work. Make a backup copy of the XML file first in case this messes anything up.

Alternatively, you could use Computer Management to assign the old drive letter to the new drive. If all you have on the drive is music and no other apps are reliant on the drive letter, this might be the easier solution. (Control Panel -> Administrative Tools -> Computer Management -> Disk Management on the sidebar -> right-click the proper volume -> "Change drive letter and paths" -- this will require a reboot)
posted by neckro23 at 12:17 PM on October 30, 2009

You should be able to go to Preferences -> Advanced and change the iTunes Media Folder Location by browsing to your new drive. I'm looking at it on a mac right now so the verbiage may be slightly different, but I did this on Windows a month or so ago and it was similar. I also did not have iTunes managing my library, and it worked fine.
posted by bwanabetty at 12:28 PM on October 30, 2009

And to clarify, you need to browse to the directory the music is in on that drive, by default iTunes Music.
posted by bwanabetty at 12:36 PM on October 30, 2009

You may also be able to change the drive letter of the new drive so it is the same as the old one, assuming the old drive letter isn't in use by some other drive now.
posted by kindall at 12:41 PM on October 30, 2009

If your old drive is wiped, and the library files didn't get copied over, then your metadata (play count, ratings, comments, etc) is GONE.

If the library files got copied over to the new drive, and are living in a directory that also contains the "iTunes Music" folder, then you are just about all set.

In the iTunes Preferences->Advanced, choose RESET (to "clear" the hard-coded path to your old library location), then close iTunes. Open it again, holding down the option key, choose "Use Library..", and browse to find your library file on the new drive. Done.
posted by Aquaman at 1:34 PM on October 30, 2009

On PC, hold down the Shift key instead.
posted by Aquaman at 1:38 PM on October 30, 2009

you can't keep all of the metadata. this thread is about my attempt to do the same thing. i ended up messing with drive letters.
posted by anthropomorphic at 2:09 PM on October 30, 2009

MrR moved my music drive (to a larger hard drive yay!) and iTunes is not handling this gracefully at all. (He hates iTunes, will not use it, and therefore did not follow any of the procedures detailed in the answers to this question.)

So really, he didn't move it at all, he borked it up for you to fix. How helpful.

The advice above is all good: changing the drive letter "back" to what it used to be is the easiest solution (silly Windows and those letters), but if you've already run iTunes since and tried to fix things from there that might be too late.

If that doesn't work, but you still have that "iTunes Music Library.xml" file (or a backup of it) from your main hard disk (probably C:, right?) then that is your golden ticket. Make a copy of it now. Make three copies, and save them. Then try the editing tricks above.

Once you let iTunes make a new "iTunes Music Library.xml" file, you're done. That file is your library, and if it's lost, you have to rebuild by dragging all those folders into iTunes again and building a new library.
posted by rokusan at 2:30 PM on October 30, 2009

editing the xml file doesn't work. itunes recreates the library from the .itl file, which is uneditable.
posted by anthropomorphic at 3:19 PM on October 30, 2009

Response by poster: The music files were (and still are) on a separate drive/partition from iTunes and the library files. iTunes and the library files are still intact on C, the music files are now on G. iTunes is currently pointing to music files on M, which doesn't exist. While it is possible to GetInfo and redirect the pointers to the new location; doing that for each of nearly 30K files is not really practical.

Changing the drive letter back isn't feasible.

OK, so apparently all the metadata is borked. I was afraid of that.

Thanks, all.
posted by jlkr at 3:38 PM on October 30, 2009

Best answer: If you still have the XML file, it's still possible.

iTunes does recreate the library from the .itl file, however if that file is corrupted or missing it'll regenerate it in its entirety from the XML file. I've done this before and it's a quick, easy fix.

For more information, I've used Part 2 of this guide to great effect. Good luck!
posted by bookdragoness at 4:16 PM on October 30, 2009 [1 favorite]

Sorry, meant to have the "this guide" be the link, not "Part 2".
posted by bookdragoness at 4:17 PM on October 30, 2009

jlkr, your situation is exactly what mine was -- I moved my files from a drive called G to a new one I installed and called M. iTunes and library files left on C. Then I just changed the location of the music files one time in the iTunes preferences (not for each file) as I mentioned above, and everthing worked fine. Including preserving the metadata, which is still on C for you.
posted by bwanabetty at 4:28 PM on October 30, 2009

Sorry, I meant I moved my music files from C to M.
posted by bwanabetty at 4:29 PM on October 30, 2009

Response by poster: bwanabetty: apparently,"iTunes Media Folder Location" means something different on a Mac than on a PC. While I can change it, it does me no good iTunes still can't find the music files.

I'm going to give bookdragoness suggestion a try.
posted by jlkr at 4:41 PM on October 30, 2009

Response by poster: And dragoness' suggestion probably would have worked, except that while the computer was editing the xml file, the keyboard got trod upon/poked at and two thirds of the xml file went away (I went to the loo while I was waiting -- 30K find-and-replace takes a while). For the part of the xml file that remained, the transition worked fine. I still have to reload the rest of the files.
posted by jlkr at 5:17 PM on October 30, 2009

Response by poster: whee! found an .xml backup, so will only lose 3 weeks of metadata, rather than six years. bookdragoness for the win!
posted by jlkr at 7:10 PM on October 30, 2009

Glad to hear it! I've been handing that guide out like candy in the last couple of months. :)
posted by bookdragoness at 8:07 PM on October 30, 2009

six years [of metadata]

Now would be a good time to back up your library file.
posted by secret about box at 10:32 PM on October 30, 2009

Response by poster: Oh, I back up the iTunes folder every month. That's why I only lost 3 weeks. But yeah, there's a new backup now.
posted by jlkr at 5:16 PM on October 31, 2009

did it capture your "date added" field?
posted by anthropomorphic at 6:46 PM on November 1, 2009

Response by poster: anthropomorphic: sort of. Everything shows up as -Added- on 10-30, but the Date Modified field shows when I actually burned them to disk. That date isn't always when I added them to iTunes, but it's close enough.
posted by jlkr at 9:57 AM on November 2, 2009

thanks, jlkr!
posted by anthropomorphic at 11:14 AM on November 4, 2009

« Older Help my procrastinating husband see...   |   Socially Awkward Newer »
This thread is closed to new comments.