My MacBook Pro (first generation, dented side resulting in unreliable power cord connection, weak battery) shut off sometime overnight. Unfortunately, when I booted it back up, iTunes told me that the library file was corrupt. Given the size of my library and the fact that I’ve got somewhere close to 100 playlists, and that I just spent about two years going through and listening to everything at least once after the last library deletion, I freaked out.
Then I quit iTunes and started thinking. There are now quite a few files that constitute the “iTunes library,” including iTunes Music Library.xml, iTunes Library Extras.itdb, iTunes Library Genius.itdb, and iTunes Library itself. I knew from past experience that it was iTunes Library that held the playcounts and playlists, so I crossed my fingers, moved everything else out of the folder, and started iTunes. Now it started up, but when it tried to rebuild the Genius data, it told me that it couldn’t save it because of a 13001 error.
I did a lot of research, and through some trial and error I hit upon the following steps:
- I moved all my non-Apple codecs out of the Library/Quicktime folder. In my case, this was a DivX decoder and encoder, and three component files from Flip4Mac WMV. (This was nonintuitive; thanks to this Apple support discussion post for suggesting it.)
- I deleted the ~/Library/Preferences/com.apple.itunes.plist file. (This is iTunes preferences, including your default settings for importing and your library location. You’ll want to reset these at the end of the process.)
- I re-deleted the the iTunes Library Extras.itdb and iTunes Library Genius.itdb files.
- I temporarily moved my external music hard drive from my AirPort Extreme and attached it directly to my Mac. (This might not have been a factor, but I figured it would be a lot faster to get through the Genius rebuild if it didn’t have to do it over an 802.11g network connection. Yes, the MacBook Pro 1st gen only has an 802.11 card, alas.)
- I restarted iTunes and let it rebuild the Genius database all day.
When I came home, it had succeeded.
I don’t know if all these steps were necessary, but I do know that when I didn’t delete the preferences file or the codecs, rebuilding was not successful. Whatever: it worked.