Home > Guides > How to Move an iTunes Library from a PC to Mac(and Back)?

How to Move an iTunes Library from a PC to Mac(and Back)?

You've put a lot of time into your iTunes library, meticulously creating just the right playlists, and rating every song you've got. Now you've decided to make the switch - from Windows to Mac (or back). Sadly, transferring your iTunes library along with your playlists and ratings isn't just a matter of moving the music files. Sure, the song-specific metadata like artist and album will be copied over in the files, but the data YOU assigned, the playlists and ratings? Those live inside iTunes' internal database files which can't be simply copied from PC to Mac.

Moving your song ratings and playlists from a PC to Mac isn't impossible, but it takes a little elbow grease. Here's how to get the job done.

Note: The best, Apple-endorsed way to move an iTunes library is to use iTunes 7's built-in backup and restore. This copies the contents of your library to CD's or DVD's, and nowhere else (WTF, Apple?).

However, if you're like me and you've got a 60 gigabyte library and you don't have time to stand around wasting burning dozens of discs, this way's for you. The method described here lets you copy the files directly from one computer to another and take your playlists and song ratings with you.

Warning: This method is NOT prescribed by Apple in any of their documentation, so before you start, BACK UP YOUR MUSIC LIBRARY. Just in case.

Ready to move iTunes? Let's do it.

On the source machine

To ensure that both machines keep the same folder structure, on the source library, in iTunes' Preferences pane, the Advanced tab, make sure that "Keep iTunes folder organized" and "Copy files to iTunes Music folder when adding to library" are both checked.


Then, from the Advanced menu, choose "Consolidate Library." The consolidation process may take some time, depending on the speed of your machine and size of your library.

When that process completes, you're ready to export your library data. From iTunes' File menu, choose "Export Library..." and save the Library.xml file somewhere on the destination machine.

On the destination machine

Now it's time to prepare the Mac, your destination machine. First, create a new iTunes library. (iTunes will do this automatically if it's the first time you're launching it; if you want to store your new library somewhere other than the default, hold down the Option key (Shift on Windows) when starting iTunes to create a new library.)

Just like on the source machine, make sure that "Keep iTunes folder organized" and "Copy files to iTunes Music folder when adding to library" are both checked inside iTunes' Preferences. Make a note of the folder where your new library's music files will live, and quit iTunes.

Now it's time to copy your music files from the source machine's music folder to the destination machine's music folder. You can do this over the network, or using an external drive. Just make sure the destination has all the same songs as the source.

Convert the Library.xml file from PC to Mac format

Now, the Library.xml file that you exported on the source contains all your music playlists and ratings, but it contains file paths specific to your PC. Macs and PC's deal with file paths differently; PC's use drive letters but Mac's do not. So in order to make it importable by your Mac, we have to find and replace the Windows paths throughout the file with Mac-friendly paths.

To do so, open the Library.xml file in a text editor. If you have a very large iTunes Library, like I do, this file could be several megabytes (19, in my case), so opening it might take more time than usual. If you can, use a machine with LOTS of memory.

Now, you'll notice that the Library.xml file from a PC will contain, along with a lot of other plain text XML markup, references to music locations in this format: file://localhost/F:/path/to/iTunes/. Using a simple find and replace, change those notations to the destination path using Mac format, for example, file://localhost/path/to/iTunes/. Here's what my find and replace looked like, from the PC's F: drive location to my Mac's external drive named "Media".

Notice the Mac path does NOT include a drive letter, but the PC does. Replace the /path/to/iTunes/ with the folder's where your new library lives. Save the edited file. (Depending on the speed of your machine and size of the Library.xml file, this may take a few minutes.)

Make sure you double-check that the source path was correctly replaced with the destination path; if this part isn't exactly right, you'll be screwed later on.

Import your Library

Now your new library is ready for all your hard-earned ratings and playlists. Launch iTunes on the destination machine. Even though you copied all the music to the right folder, iTunes doesn't see it. Yet.

From the File menu, choose "Import..." and select the Library.xml file you exported and edited from the source - then let 'er go. It will take some time, but iTunes will suck in all the playlists, and tracks with rating information into your new library.


When you're done, you'll notice that you have duplicates of standard-issue iTunes playlists, like the Top 25 Most Played, Music Videos, etc. You can delete those dupes. Also, that whole Determining Gapless playback process might take awhile in your new library, too.

One important note: This method successfully transfers all your song ratings and playlists, smart or otherwise. However, it does NOT transfer other metadata, like Last Played and Play Count. This, quite frankly, sucks sideways. (However, using iTunes' built-in backup and restore to 60 gazillion discs, Play Count IS transferred.) That said...

Congratulations! You've transferred your over-sized iTunes library from a PC to Mac. (This works the other way around too, just reverse the file path replacements.)

Related Guide: Export QuickTime X videos to iPod/iPhone on Mac