iTunes trashed my library! Can XML save my sanity?
June 25, 2004 7:48 PM   Subscribe

iTunes trashed my library! Can XML save my sanity?

Hundreds of tracks are suddenly missing from my iTunes library. I want (need!) to restore the missing tracks, but I can't discern any pattern in the omissions, and the prospect of combing through 30GB of music individually makes me want to give up and put the iPod up on eBay. Here's what I have: an XML export of my library taken 5/26 and a second export taken today. Here's what I need: a list of tracks that are in the first file but not in the second--ignoring changes I'm not interested in, like different play counts. I'm not a coder but it seems to me like this is the kind of thing computers ought to excel at. Where do I start?
posted by kjh to Computers & Internet (8 answers total)
 
You could just delete everything in the library, then drag your music folder into iTunes to make a new one, or else import your backup. It'd be easier than trying any kind of custom programming you might do.
posted by kindall at 8:06 PM on June 25, 2004


Response by poster: You could just delete everything in the library, then drag your music folder into iTunes to make a new one, or else import your backup. It'd be easier than trying any kind of custom programming you might do.

I'd like to save this as a last resort: blowing away my whole library would erase all my ratings, play counts, playlists, etc.; while importing the entire backup would result in a plurality of duplicated songs.
posted by kjh at 8:09 PM on June 25, 2004


Can you import the backup, keeping the old ratings, and then tell iTunes to remove the dupes?
posted by thebabelfish at 9:51 PM on June 25, 2004


I'm not sure I follow 100 percent but it sounds like you're saying that the files are not listed in your library but that they're still on the hard drive, in the proper folder.

If that's the case, you simply go into iTunes, click File | Add to Library. Point to the root directory of your mp3s and click Okay. iTunes will rummage through the folder looking for any music that isn't currently in the library and add it. It'll ignore stuff that's already listed in the library. I've done this countless times.
posted by dobbs at 10:00 PM on June 25, 2004


Oh, and if that's not what you're talking about, perhaps you could open the two files in Word and use its "Compare Documents" features (found in the track changes section of Tools). I'm not sure how Word will view the XML code but with normal documents, it'll highlight the lines that are different in the two docs and you can than add the tracks manually.
posted by dobbs at 10:03 PM on June 25, 2004


If you have OSX in a terminal try
diff file.one file.two > tracks.txt
posted by plexi at 10:22 PM on June 25, 2004


Bit late, this, I know - but you should always keep a backup of your itunes library. I lost my library - twice - and now keep two version of the library on different disks. On a PC, Syncback is a good, free way of doing this regularly.
posted by ascullion at 1:58 AM on June 26, 2004


(And if you have the dev tools, do opendiff file.one file.two and it'll be all graphical.)
posted by Utilitaritron at 7:08 AM on June 26, 2004


« Older Three sided roof rack   |   Framed! Newer »
This thread is closed to new comments.