Yesterday I moved my iTunes library to my MacBook Pro to my desktop PC. Moving the audio files is really easy, but I didn’t want to lose my ratings, play counts, and playlists, and I had been conditioned to think that this was going to be really difficult. I had run into problems moving the files from one PC to another, but now I know that I just wasn’t doing it right. Here’s how you do it.

First, open iTunes on your destination computer (the computer you’re moving the library to). Open the Preferences, go to Advanced, and check “Keep iTunes Music Folder Organized.” This puts iTunes in charge of keeping track of the names and locations of your files. Also take note of the location of where the iTunes library is stored on this PC. Quit iTunes.

Next go to the computer where your iTunes library is. Go to the Preferences, Advanced, and set iTunes to keep files organized there as well. If you didn’t already have iTunes set up this way, it may take some time to shuffle all your files around into its own structure.

Now copy all of the files in the library on the old computer into the location of the iTunes library on the destination computer, keeping the file structure intact. You can do this using a network share, copying them to removable media, or even Zipping them up and emailing them (not recommended if you have 11 gigs of music). Just make sure you preserve the directory structure and put the files wherever iTunes expects them to be stored on the destination computer.

The last step is to copy over the file with all of the metadata. It’s called “iTunes Library” on a Mac, and “iTunes Library.itl” on a PC. Copy the file from the old computer onto the destination computer. By default on my Mac, it goes in ~/Music/iTunes. There will already be an existing version of this file — just find it and overwrite it. If you’re moving from a PC to a Mac you’ll need to remove the extension. If you’re moving from a Mac to a PC, you must add it.

At that point, you should be able to reopen iTunes on the destination PC and see all of your old playlists, a list of your old files, and so forth. If you try to play a file and iTunes asks you to tell it where the file is located, you need to make sure you’ve put all of your audio files in the right directory.