Transfer iTune libraries to a new computer

This is a common enough scenario, isn’t it?

It’s surprising that when I had to do this for my son’s new PC, I googled and couldn’t find an answer on how to do this without buying a specialty software tool. Don’t know why Apple doesn’t just publish a FAQ topic on it. As I discovered, it’s simple enough to do it yourself; you do need a little bit of computer skills, mainly be comfortable with a text editing tool, like notepad.exe, in order to do a mass search and replace operation on a text file.

The high level concept is this: moving an itune library is like moving house. Step 1 is to box up your stuff; step 2 is to write down instructions to the movers on where your stuff needs to end up in your new house; step 3 is the physical move to the new house.

Now let’s see how that applies to moving itune libraries.

Step 1. Gather your music files into one location. By default, music files are scattered all over your computer, and that makes moving them cumbersome. Use the Consolidate Library function in itune which copies all your music files into one single folder. Follow this link: to perform this step.

2. Next, tell the “movers” where the new library will end up in your new computer.

To do that, you use the “Export library” function in iTune, which produces an XML file containing the references on where the music files reside on your current computer. Let’s assume this file is called library.xml

Now, here comes the technical part. You need to open up the .xml file in a text editor. I use notepad.exe on Windows. But if you prefer to do this in vi, more powers to you. Inside the text editor, do a mass search and replace on the string representing the existing itune music directory to your target itune directory (note the UNC syntax Apple uses for their directory names and follow that). Since all your music files now reside under a single parent directory, you only need to do this operation once.

Step 3. Transfer the music files to the new computer, along with the edited library.xml file, to the new itune directory location on the new computer.

Finally, launch itune on the new computer, and import the library.xml file.

Voila, all your music files along with all the meta data you had kept on them just magically show up in their new home. Now connect whatever iPod or iPhone devices you may have, and you are back in business.