Damaged iTunes Library

Today some sort of perfect storm of loading windows froze my computer for longer than normal. After two or three minutes I realized that there was a reasonable chance that my mouse wasn't going to respond, and so I powered my laptop off and restarted it. When I shut it down, iTunes was open on my computer and I suppose it's possible that something was corrupted during this time, because when I opened it after starting my laptop up again (this was a few hours later), it initially prompted me with the iTunes user agreement, and when I clicked accept it said that the iTunes library had been damaged and iTunes created a new library. The new library had only like 10 or 12 artists and (10 or) 12 albums, but information including play counts seemed to be up to date (although I haven't listened to any of the songs in this library in a few months, so it is unclear whether this is truly up to date or if it just appears that way).


I immediately panicked (duh) and googled the issue and, in my haste to fix it, I did the first thing that seemed to work for people. I deleted the iTunes library file and renamed the damaged library "iTunes Library". After trying various iterations of this fix (deleting the xml file, deleting the itl file, even renaming the damaged library "iTunes Library.xml, as if that would change the file to an xml file and save me), I somehow deleted even the new library, and when I opened iTunes it was now completely blank. I freaked out some more, and then did some more research, and found a different fix which involved moving the xml file to the desktop and deleting the itl library. From there, I imported the xml file as a playlist to iTunes from the File > Library > Import Playlist iTunes menu. At first nothing happened, but then I restored the oldest version of the iTunes Library.xml file and it recovered the library that had 12 albums on it. I figured I had screwed it up beyond repair at this point. I tried to System Restore my computer (I understand that this probably wouldn't work, but I thought I should try it anyway) but the system restore failed, giving me an error message after restarting my laptop. I'm not sure what else to do at this point. All my music is still on my computer, but the issue is that if I just re-imported all my music to iTunes, all my play counts would be gone, and they are very important to me. I do have a program that I used in the past called CopyTrans which helped me move music directly from my iPod back to iTunes while keeping all my play counts correct, however this isn't as useful to me as my iPod is only 160GB and I have somewhere around 200GB of music now, so I'd still have to manually move a good 40 or 50GB of music from my Music folders to iTunes without play counts. I hope it won't have to come to that. Finally, in a last ditch effort to fix it myself without posting this, I also tried using a program called Recuva to recover a version of the xml library file from before the ship sank, but to no avail. So what do you guys think, am I screwed? Or is there something I can do to restore my previous iTunes library?


I still have the damaged iTunes Library.itl file, and I'm fairly certain it has the information for my correct library (its filesize is 6.91MB while the new iTunes Library.itl files are merely ~30KB files), but unfortunately I haven't been able to find any way to get it to open or run in iTunes.


Also, for reference, I run iTunes 9 as I strongly prefer its interface and look to 10 and 11. It has not been updated and I'd prefer to keep it that way (or at least, keep it iTunes 9) if possible. I also have a few temporary files, one from about a week or two ago. I have no idea if they can help me restore my library but I figured I might as well mention them. I'll be happy to provide any other information that may be relevant. I'd really appreciate any and all help I can get!


EDIT: Oh, also one more thing. For a while now when I open iTunes instead of opening normally it always opens up as if I'm installing iTunes for the first time despite it already being installed (I get the small window that says "Welcome to iTunes" and has the 'Next' and 'Cancel' options (or maybe they're 'Yes' and 'No', idk). I always just exit out of that box and my iTunes library opens as normal. I've never gone through that installation process because I've been afraid that doing so will wipe my library, but should I do it now? Is there any chance that it might restore my old library somehow? Or, perhaps more reasonably, I should do it now while I have the clean slate library so that it stops popping up when I do recover or refurbish my library?

Posted on Sep 26, 2013 1:48 AM

Reply
3 replies

Sep 26, 2013 3:30 AM in response to aneeshp

The usual recommendation would be to restore a backup. Failing that each time iTunes is updated it creates its own backup of the library database which can often get people out of trouble. See Empty/corrupt library after upgrade/crash for details. In your case however, since you've stuck with an older version for so long, you are unlikely to have a useful version to revert to. I suspect at this point the best you can to is import whichever XML file you're still able to find into a fresh library, and then import the media folder. My scripts ImportDevicePlaylists and SyncStats may let you recover some useful information from the device.


You last issue may be caused by a corrupt iTunesPrefs.xml file, or McAfee deleting it.


tt2

Sep 27, 2013 4:50 PM in response to turingtest2

Thanks for the reply tt2. So I think at this point I am just going to have to start from scratch. I'm going to upgrade my iTunes to the latest version and repopulate my library from my iPod and music folders. I do have a few questions though before I begin this process.


First, I was going to uninstall my iTunes and just download the newest version from the iTunes homepage, but before doing that I wanted to look through the files and folders presently associated with iTunes. I came across a folder called 'iTunes Media' and within that another folder called 'Music'. Inside this music folder I found hundreds of artists and songs within the folders of those artists. It doesn't have all the artists that are found in my dedicated 'Music' folder (under 'My Music'), but it does have a good 1000 or so. What is this folder? Is it a back up of some sort for my music? If I delete this folder will there be any negative repercussions?


Also, I have a few questions about your scripts, which both look like they might be of great help to me. It seems like they are similar to the CopyTrans program I mentioned above, but my main question about using either the scripts or the program is what happens to the files that come from my iPod? As in, where are they stored? To clarify, suppose (for example) I take the song "Black Dog" by Led Zeppelin. I have a file for "Black Dog" stored in my Music folder, which is where my iTunes previously catalogued the song from. From there it went to my iPod. Now that my iTunes has been erased, I am trying to put "Black Dog" (with all of its play counts and other metadata or whatever) back into my iTunes. Will my computer now create a second "Black Dog" file for this "new" version from my iPod? Or will it simply overwrite the old "Black Dog" file in my Music folder? Obviously the latter would make my task easier, so I'm hoping for that, but I feel I should ask nevertheless. Do these questions make sense? I'm happy to clarify further if needed.

Sep 27, 2013 7:28 PM in response to aneeshp

Take a look at the thread How do i re-link my music files / library to iTunes? for some background on how the library would normally be organized. If you have a library that lists the media, and have all the media, then it should be possible to hook them up again. If the media is missing it can normally be extracted from a device with third party tools. Some of these will also copy ratings, playcounts, playlists etc., otherwise I have some scripts for those. When you've got all the media from all possible locations connected to the library my Deduper script can be used to clean up while merging play counts, playlist membership and highest rating.


tt2

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Damaged iTunes Library

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.