Itunes - Restoring a Library/Playlists

Situation: I used Time Machine to backup an Mac (<-- redundant) OS X user account. I then reformatted and restored the account (but also created a 2nd ‘primary’ account b/c the other one had some glitches). I would now like to be able to recover my itunes library (e.g. playlists and metadata if possible) currently residing in a raw “itunes music” folder and teach my new iteration of Itunes how to interpret all the old files (if I just drag the files into itunes then I will lose all playlists, starred music etc).

Question: Is there any simple way to restore iTunes using an old ‘itunes’ folder? If not, is it possible to automate the process of creating individual smart playlists for each artist?

I think the problem in solving this task is that google has too many hits for similar issues to make it easy to isolate my particular situation :frowning:

In the Preferences window, go to the “Advanced” tab. This will allow you to choose your iTunes Music directory. However, I’m not sure whether this will give you your playlist information back, or if it will just give you all your files in a central library.

I have tried these methods for iTunes running under Windows and they appear to work, but I don’t know what will happen, whether these files exist or are in the same place, etc., on a Mac.

The easiest thing to try is File>Import…; this imports an XML music library file. These can be created with File>Export Library…, but there is also an XML file called “iTunes Music Library.xml” in the iTunes directory (the parent of the default “iTunes Music” directory), and you should be able to import from this file as well. This XML file contains all of the basic iTunes music library information (locations of music files, playlists, links to album artwork, etc.). When I did this I ended up with duplicates of the existing (default) smart playlists, it had to reprocess for gapless playback, and it wouldn’t import missing files (bug or feature, depending on your situation); but it appeared to work as expected. I don’t use the star ratings, so I didn’t check to see whether those are restored this way. I recommend trying this first because it will get you at least most of what you want, without having to mess with the raw database files.

There’s another more complicated way that avoids this reprocessing and should basically restore a snapshot of the previous iTunes setup. You can’t just copy the old XML file into your new iTunes directory; iTunes appears to use this as a write-only file. But there is another file “iTunes Library.itl” in this directory which apparently is a binary version of the database; this is what iTunes actually reads on startup (it uses this to recreate and restore the above XML file). I was able to copy an old version of the database onto this file to restore the old files and playlists; this overwrites any existing data, so you should only use it for a clean reinstall. (Just on general principles, I recommend making sure that all iTunes-related processes are really killed before trying this. Make sure that iTunes, at least, is not running in the background.)

I don’t know what effect either of these has if you have iTunes set to automatically organize your library. I also don’t know if the second method works when you are copying to a second user account (the ITL may contain user-specific information or something).