Recently I had a task at hand while switching from one computer to another. I had to move all of my ~10GB of music from one computer to another ! That was not the “tough” part though ! The tough part was – How to maintain the ~310 playlists that I had set up ! I have no idea why I have those many playlists ! I guess I am a little over-organised at times ;-) !

Anyways, here is the way I did it ! It was pretty simple eventually…

Step 1: Keep the iTunes folder organized

Step 1Let iTunes handle the organization of your music i.e. when you copy the file to iTunes, it will automatically create the folder for that particular song on your hard disk (in an organized way). To do go to Edit > Preferences. Select the “Advanced” tab and make sure the following options are selected

Step 2: De-authorize the iTunes on the old computer

To do this go to Advanced > Deauthorize Audible Account. This is helpful if you buy any songs from the iTunes online store. Since the iTunes music you buy has a maximum of 5 licenses, you can transfer it only to 5 machines at a time – however of you deauthorize then you can re-use that license.

Step 3: Copy all the music from one computer to another

Copy all the music you have from the source computer to the destination computer. If possible (and to ease the transfer) copy it to the same location in the destination computer. Since your music is all organised, all the music is under the folder specified in the “Advance” tab under Preferences. (See above image). In my case it is D:\music\itunes.

Step 4: Export your entire library

Step 2In iTunes (source omputer) go to File > Export Library and export the library to an xml file. The default filename is Libray.xml. This spits out all the playlist information, song ratings, path to the media file etc. to an xml file. Copy this file over to the destination computer

Step 5: Edit the Library.xml (if needed)

If you did not copy all your music (Step 3) to the same location in the destination computer as it was in the old computer then edit the Library.xml file and replace all the occurance of that location with the path of the new location. Eg. replace all “D:/music/itunes” to “C:/musiclibray”. You can do this using any word processor. I am a little geeky and I use gvim a lot – which makes search and replace just a simple command. If you want to use gvim to do the following then download, install and open the file Library.xml in gvim. Then use the command

:%s/D\:\/music\/itunes/C\:\/musiclibrary/g

to replace all the location occurance.

Step 6: Import the library in the destination computer

In iTunes, go to File > Import and select the Library.xml that you saved in Step 4. Voila ! all your music, playlists and ratings appear in your iTunes in the destination computer. To be able to play the music you bought from iTunes, you will have to authorize the computer the same way you deauthorized the computer in Step 2