Migrating an iTunes Library

I was an early adopter of the Apple iPod. I suffered through the growing pains that accompanying a new technology. The struggles though were worth it as each iteration of the iPod built upon the previous successes making it one of my favorite gadgets that I couldn’t imagine living without.

While the iPod itself is an incredible device that has changed the way many of us listen to music, an equally important aspect of the experience is iTunes. For all that it does, iTunes is many times maligned. I am sure that if you ask any iTunes user they could produce a laundry list of features or changes they would make to this application yet very few people actually go as far as replacing iTunes with a different application for managing their music files.

I count myself among those users who sometimes have a love/hate relationship with iTunes. I absolutely love the user interface and the ease of use decisions that went into the design of this software. On the other hand I am constantly frustrated by the lack of advanced search criteria or the ability to build more intelligence into a Smartlist.

Perhaps one of the most confusing points of iTunes is the seemly haphazard way it manages your music files and the difficulty users have in migrating their iTunes library from one location to another.

Having been using iTunes for several years now and being a self-proclaimed music pack rat I have somehow accumulated a fairly sizable music library consisting of roughly 12,500 individual songs.

It’s not just the sheer number of music tracks that is alarming to me. It is also the fact that I have spent countless hours managing the data associated with each song. I suffer from some sort of personality defect which causes me to spend enormous amounts of time making sure each track has as much associated information as possible such as composer, lyrics, album art, etc.

Given the amount of time I have spent making sure each track has the most accurate data possible you can imagine my nervousness when it came time to migrate my iTunes library from one computer to another.

I initially made a fairly naïve assumption that I could just copy the music files from one computer to another and all of my data would magically appear including playlists, track play counts, and track ratings. When I copied the files and opened iTunes on the new computer I nearly fainted when I saw this data had all disappeared. This was clearly unacceptable and I began searching for a solution that would allow me to successfully migrate iTunes from one computer to another. What I have come up with is a workflow that works for me. I am sure there are several ways to solve this issue but this one worked for me so I thought I would share it in case others find themselves in a similar dilemma.

The first step I took was to set a few preferences in the iTunes located on the computer I was migrating from. If you are fortunate enough to have all of your music located in a single location; I want to congratulate you. Unfortunately for many of us long-time users the music location has changed through the years and because of this we have music spread across our computer landscapes.

One of the great things about iTunes is that it will keep track of where your music is located. It stores the file location for each of the tracks so when you click on a song it will know exactly where to find that file to begin playing it. The key to migrating to a new computer though is to gather all of this music together through a sort of an iTunes cattle drive.

iTunes1Within the iTunes preferences screen under the Advanced tab are two check boxes that need to be selected. “Keep iTunes Music folder organized” will allow iTunes to create folder structure under your iTunes Music folder by artist and album folders and will go a long ways to making the migration easier. The second preference, “Copy files to iTunes Music folder when adding to library” will allow iTunes to move your music files into the iTunes Music folder thereby neatly putting all of your music in a single place for migration. The key to both of these of course is having accurate data in your iTunes library for artist and album otherwise the files will be consolidated but into a filing system that might be difficult for you to find anything later.

iTunes2Once you have set both of these check boxes you are ready for iTunes to do some heavy lifting. Hidden under the File/Library menu in iTunes is a gem named simply “Consolidate Library”. What this option does is essentially consolidate all of the files listed in your iTunes library into the iTunes Music folder as defined in the iTunes preferences. It will copy the files from their current location into the iTunes Music folder renaming them with the track name and organizing them into a folder structure of ARTIST\ALBUM. Depending on how large your iTunes library is, this step could take a while as it moves all of your songs to a single location. It should also be noted that you need to make sure you have adequate space on the drive where your iTunes Music folder is located.

Once the Consolidate Library option has completed running, your iTunes music files will all be located in the iTunes Music folder ready for migration. You will then need to copy the iTunes Music folder contents from the old computer to the new computer. I used a portable external hard drive to move all of my music. I simply copied the iTunes Music folder to the drive then disconnected the drive and attached it to the new computer and copied the folder to its new location.

Merely copying the files from one computer to another is not enough. If you stopped here the music files would be on the new computer but the new iTunes may not be able to find them and even if it did you would lose ratings and play counts at a minimum.

Going back to the computer you are migrating from, launch iTunes. Under the File/Library menu you will find an entry called “Export Library”. This will create an XML file with all of the information iTunes knows about your music files. This is a key piece that we need to take with us to the new computer. The XML file that is created will have the song information but will be pointing to the file locations on the old computer. We need to edit this file to tell iTunes where to find the songs on the new computer.

An XML file can be opened in any text editor such as TextEdit or TextWrangler. Opening the XML file you will notice an entry for each song file that shows its location. Using the global search and replace function of your text editor, change the disk and folder names from the old system to the new location on your new computer. Once the replacement is completed; save the XML file and transfer it to the new computer.

On the new computer open iTunes and go to the Preferences screen. Under the Advanced tab enter the location where you want your new iTunes Music folder to reside. While on that screen make sure that “Keep iTunes Music folder organized” and “Copy files to iTunes Music folder when adding to library” are both checked.

The next step is to actually import the XML file that we created above. It took me quite a while to figure this part out as it was not as logical as I would have expected. Under the File/Library menu you will find a menu option called “Import Playlist”. I know what you are thinking, we are not importing playlists, we are importing an XML file. Believe me, I didn’t think that was right either but you have to trust me on this.

In the dialog box select the XML that you modified with the new file location and let iTunes do its thing. It will parse the information contained in the XML file and in the end you should see all of your songs listed in the library with their associated ratings, play counts, and other data.

Once done, you should probably review your library and remove any redundant files. I haven’t had a problem with duplicates showing up in this process but if you had multiple copies of some of your music files it could have introduced duplicates during the library consolidation step.

That’s it; you should now have all of your music files with their associated meta data on your new computer and be ready to once again enjoy your music. These steps should work regardless of whether you are transferring your library between two PCs, two Macs, or between PC and Mac. The only differences may be where you find the iTunes preferences. Good luck, hopefully this will make your iTunes transfer less painful and reduce the level of stress in your life.


  1. Donnieboy says:

    Just wanted to drop you a line to say, I enjoy reading your site. I thought about starting a blog myself but don’t have the time.
    Oh well maybe one day….

  2. HenleyL says:

    Hey, I really enjoy your blog. I have a blog too in a totally unrelated field (Online Stock Trading) but I like to check in here on a regular basis, just to see what’s going on and it’s always interesting to say the least. It’s always entertaining what people have to say.

Leave a Reply

Your email address will not be published. Required fields are marked *