
I spent the better part of yesterday trying to load my iTunes library on my new MacBook Pro. I was bound and determined NOT to lose all of the metadata associated with my music -- star ratings, play counts, playlists, album art, etc. Call me superficial, but I just didn't want to lose all of that information; information that has been compiled for 3,300+ audio files over the last three years.
Anyway, I eventually got it all figured out, but I thought I'd pass along what I learned. The tutorial below will help you if you DON'T let iTunes manage your Music folder (you can check this setting in Preferences → Advanced → General) and you're moving from a PC to a Mac. If you don't mind letting iTunes manage your music, there are easier ways to make the transfer.
I followed for the most part, but I got hung up towards the end of the process. So I paraphrased and edited that tutorial to help out people like me (and, presumably, you) who want to switch from a PC to a Mac.
1. Transfer all of your music from the PC to the Mac.
Don't delete anything -- you want all of the same files on both the PC and the Mac. There are lots of ways to transfer your files documented elsewhere, so I won't cover that here.
It will make things easier if you try to replicate the folder structure on your Mac that you had on your PC. For example, on my PC I had a folder located in D:/Music/ and within the "Music folder" were four sub-folders: "Downloads" (D:/Music/Downloads/), "Full Albums", "Single mp3s", and "Owned Albums (mp3 backup)". When I copied the music to my Mac, I kept the same folder structure, within my new music folder: /Users/jakebouma/Music/. More on this later.
2. Check for up-to-date software.
Make sure that both machines are running . Might seem like a no-brainer, but it's important.
3. Find and transfer "iTunes Music Library.xml"
On your PC, locate a file called "iTunes Music Library.xml". By default in Windows, iTunes will place this file in the "My Music" folder. For example, C:/Documents and Settings/Jake/My Documents/My Music/iTunes/iTunes Music Library.xml. If you're having trouble finding the file, just .
Making sure that this file is not deleted, transfer it from your PC to your Mac. You can do this many ways, including using a USB drive; I emailed the file to myself.
4. Open "iTunes Music Library.xml" on the Mac.
Using a text editor like (all screenshots will be of this application), open the iTunes Library.xml that you just transferred to the Mac. You can do this by holding ?command and clicking on the file.

The next step is where retaining the basic file structure from PC to Mac (Step 1) comes in handy. This file, iTunes Music Library.xml, contains ALL of the metadata associated with the music in your iTunes library (ratings, play counts, album art, etc.), including where it is located on your hard drive. All you need to do is change the file locations in this file to reflect their new location on the Mac to keep all of this vital metadata intact.
Rather than editing this file by hand, which would take hours and hours, you're going to use the "Find" and "Replace All" function.
5. Find and replace.
First, you need to find the "Location" line of a file. This is the line that tells iTunes where to find the file with which it associates the metadata. In Step 1, I mentioned that one of my folders was called "Owned Albums (mp3 backup)". iTunes recognizes this file as located at file://localhost/D:/Owned%20Albums%20(mp3%20backup). The %20s denote the use of spaces.

Because all of the files in "Owned Albums (mp3 backup)" on my PC now reside in a similar folder called "Owned Albums (mp3 backup)" on my Mac, all i have to do is change the beginning of the file locations.
Highlight the beginning of the file location, and copy it (?command + C). In TextWrangler, click Search ? Find or press ?command + F to open the "Find & Replace" pane. In the top "Search For" box, paste the text you highlighted (?command + V). In the bottom "Replace With" box, enter the beginning of the file location on your Mac. (To find the location of a file on your mac, just ?command + click the file, and choose "Get Info". The location is the line that says "Where".) Make sure that you add file://localhost/ before the location of the Mac file in the "Replace With" box, or iTunes won't be able to find your files. Here's what it should look like (click the image for larger file):

Make sure the "Start at Top" box is checked, and then click the "Replace All" button on the right side.

Voilà! Repeat this as necessary for the number of folders you have. Save this file.
6. Copy and replace "iTunes Music Library.xml".
Make sure that iTunes is closed and locate the iTunes folder on your Mac. Mine is in Users/jakebouma/Music/iTunes. If you have never opened iTunes on your Mac, there won't be any files here. If you have, there will be two files: iTunes Music Library.xml (not the one you just edited) and iTunes Library.

Copy and replace the iTunes Music Library.xml in this folder with the iTunes Music Library.xml that you just edited in Step 5. Do not open iTunes yet.
7. Manually corrupt the "iTunes Library" file.
Use a text editor such as to open the iTunes Library file (not the .xml file -- see the image in Step 6). Select all of the text (?command + A) and delete it. The file should now be blank, with zero characters in it; save it (?command + S). iTunes Library's filesize should now be zero KB (This is important, because some text editors -- e.g. UltraEdit -- may append invisible characters to the beginning of the file).
If this file is corrupted, which is what the above paragraph details, iTunes will default to iTunes Music Library.xml for all of its information. iTunes will automatically rebuild this file itself, so it's okay to corrupt it for now.
8. Open iTunes and let it do its thing.
A prompt with a progress bar will come up -- iTunes is rebuilding your library. Depending on how powerful your computer is and the size of your music library, this may take a while. When this ends, iTunes will come up with a message saying that the library file was corrupted/damaged and it tried to rebuild things for you. Press "OK" and iTunes will finally launch.
9. Tidy up.
After you've made sure that all of your metadata is intact and the files play correctly, you'll probably want to tidy things up a bit now, such as reformatting your columns in the library and all the playlists and setting the Preferences as you'd like them.
I don't subscribe to a whole lot of podcasts, so I just went to the iTunes Store and re-subscribed to them all. If you want to keep past episodes, follow the instructions .
That's it! You're done!
10. Reformat your iPod (optional).
If you have an iPod and it was set up on your PC, the iTunes on your Mac will say "Only Macintosh-formatted iPods can be updated" when you plug in your iPod. Your iPod will still sync properly with this message, it just won't download any new iPod software that Apple releases. To fix this, click "Restore" and iTunes will automatically reformat your iPod for your Mac and re-sync all of your music.
Phwew! Please leave comments if you have any questions or if something was unclear. I wrote this to save people the headache I went through.

{ 87 comments… read them below or add one }
← Previous Comments
How do you do this in reverse? A Mac to a PC. I tried this method and it didn't work going from a Mac to PC. Only a portion of the playlists and a small percentage of the songs came over. Any suggestions?
I'm not sure how you'd do this in reverse. If you find something helpful, feel free to post the link back here.
Thank you so much for this. I tried other methods on my new macbook pro and nothing would maintain my playcounts. This worked perfectly first attempt.
Glad it worked, Will!
Jake – Any comment on if this will work from XP to Vista? I have transferred the songs and playlists, but can't find a way to get the ratings over. Thanks. Matt
Matt, I'm not sure if it will work when switching between Windows operating systems… If you try it out, let me know how it works (I would assume you do much the same thing as explained above).
i just got a new imac and have been trying to transfer my itunes from my pc with xp for hours. every time i start from scratch and import my whole library, all of the metadata is gone, which is to be expected, since it's creating a new itl file. i can't get my xp itunes to export an itl file, just xml, so i followed the steps on here a few times, and every time i get it to show my playlists and play counts, 90% of my library disappears from itunes (it shows 3 gb instead of 30).
all of the files are still in the music folder and everything, but they are disappearing from itunes. also, the xml file reduces itself down to ~1mb instead of the 10 mb file i just moved into the itunes folder.
if i then proceed to add the rest of the music back into itunes, it's not helpful, because the metadata for those just-added files isn't there. the playlists each only have a few songs, and the play counts are only there for the original 3gb that showed up.
i am at my wit's end. please, PLEASE email and help me if you can.
I can't get this to work for me. I have Vista on my pc, not XP and I have the brand new MacBook Pro. Is this why it's not working?
It may be Vista that is the problem. It doesn't matter how new your Mac is, unless you're not running Leopard (but I assume you are, since it's new).
What do you mean when you say it's not working? Which part of the process gives you problems?
Mandie, I'm not sure what the problem is. Have you had any luck since posting your comment?
I just tried this method, and even though I managed to get the library with all my songs and playlists transferred to my macbook ok, it is not listing all the songs under the main music category…..How do I get the songs listed there? Anyone have any ideas please?
Thanks!
I tried this yesterday with my new macbook. All of the playlist titles were transferred, but no songs? Anyone know what went wrong?
i just tried it…and for some reason it didnt work.
do you think it's because i had already transferred my songs to my mac?
This was very helpful, and it seems like it ought to work, but for some reason on step 8 nothing happened. When I opened itunes it didn't automatically start building a library based on my new xml file. Do you have any idea what could be wrong? Thanks.
same happened to me. any ideas? maybe because I'm using the very latest version of itunes?
same happened to me. any ideas? maybe because I'm using the very latest version of itunes?
dude, this saved my head from exploding. i found similar explanations on how to do this, but i felt confident about yours and it really helped that it was explained so clearly. my 20,000 song library transferred without any loss of meta data, etc. YOU ROCK!
Glad that it helped… and believe me, I know the feeling of euphoria when everything is there!
Thank you SO MUCH. the move was seamless, fuss-free and basically worked like magic. I've bookmarked this page just in case. You are awesome in every sense of the word.
Thank you SO MUCH. the move was seamless, fuss-free and basically worked like magic. I've bookmarked this page just in case. You are awesome in every sense of the word.
im having the exact same problem.. only 10gb of my 25gb library is being copied
One of the easiest ways to transfer iTunes library is by use software to copy the library contents off your iPod to another computer. I recommend Mac iPod to iPod/Computer/iTunes Transfer.It helps me to copy songs/videos/photos/playlists etc from ipod to Mac directly and safely.
Free download it at: http://www.ipodtocomputercopy.com/macconverter/ma…
Also you can backup your itunes to CDs or DVDs.All you need are blank discs and some time.
Hope it helps.
ummmmm this isent working for meeee
…thanks!…editing the xml file got me rolling again but was not able to get the artwork…not sure why yet…cheers…Drew
dude you saved me from throwing this mac out the window, i had issues at first because i had previously opened iTunes the very first time i got the laptop, causing it to auto-create several sub folders and files inside the iTunes folder. what I then did was to go into the iTunes folder after i totally shut down iTunes and delete everything in it except for the edited XML file and the now empty iTunes Library File. worked like a charm after that. Thank You So Much!!
it didn't work for me…
it didn't work for me…
it didn't work for me…
it didn't work for me…
it didn't work for me…
it didn't work for me…
← Previous Comments
{ 2 trackbacks }