How to move your iTunes music library from a PC to a Mac without losing metadata (ratings, play counts, album art, etc.)

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 PreferencesAdvancedGeneral) 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 this tutorial 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 the most current version of iTunes. 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 perform a search.

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 TextWrangler (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 SearchFind 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 TextWrangler 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 here.

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.


Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed to have articles like this delivered automatically to your feed reader. If you don't have a feed reader, you can always sign up for email updates and have fresh content delivered daily to your inbox.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Trackbacks & Pingbacks

[...] goggle is you friend. Here is just one ling that will walk you thru it faster then I can type it. How to move your iTunes music library from a PC to a Mac without losing metadata (ratings, play coun… Hope this helps Clay __________________ I use windows to let in fresh [...]


Comments

thanks man… makes the most sense of anything i’ve found thus far… still struggling to move my docs as well.

i appreciate your help!

no problem, steve. what do you mean you’re struggling to move your documents?

thanks a lot, jake! i had tried using the same tutorial that you mentioned and was having problems, but i followed your updated one and it worked perfectly. such a relief to have the transfer all done with all my info intact.

lars: no problem. i’m glad everything worked out for you… i totally understand the feeling of relief upon seeing all of the info intact! thanks for stopping by.

I’m preparing to do exactly this and have been searching for a handy guide. This stands out as the most thorough. Nice job. I haven’t done it yet, but a question that stands out is what to do with the Album Artwork folder? Will its contents be rebuilt when you open iTunes in Step 8 or do you just copy and paste from your PC? Thanks!

Alex: You don’t have to touch the album artwork folder, as far as I know. I believe the artwork for individual files are stored within the metadata of the audio file itself (but I could be wrong). I didn’t have to move anything, and almost all of my artwork transferred.

“7. Manually corrupt the “iTunes Library” file.”
No need for this.
Put the edited iTunes Music library.xml file on the desktop.
Delete the iTunes library file, open iTunes then File -> Import and select the iTunes library.xml file on the desktop.

was wondering if you know anything about this, on a similar topic.

ive transferred my itunes from one PC to a new PC. everything seems fine, but some of the artwork has not transferred.

why is this, and how do i make sure ALL of the artwork is transferred across?

many thanks

Chris: Is this what you did? Or just something you think will work? The manual I have in this post works fine.

Will: I’m not sure why some of it is missing, either. It happened to me when I transferred my stuff; I would estimate about 5% of my album artwork didn’t transfer. For those songs without artwork, I just used the “Get album artwork from iTunes” option. Besides, I’d rather have to do that then lose all of my metadata. ;)

Yes, this is something I have done.

yes it is something i have done.

i have approx 11,000 songs and over the years spent a lot of time getting the artwork.

but it does appear that around 5% of my artwork is missing, strangely i now think it happens to be the same artwork that came from the ‘get album artwork’ option….

so i agree, i think get album artwork will solve most of it.

its just irritating – why cant i have everything on one computer exactly the same on another?! – ah well, u cant have everything

thanks

awesome job on this. i’ve been reading through many other articles related to this, but none of them would keep everything fully intact. i was putting off getting my new mac book pro for months because i didn’t know how i was going to transfer all my music, and now i feel silly i did that.

let me tell you it was one big sigh of relief when itunes opened up and all the play counts were there. really ingenious of you to figure it out.

thanks again.

nathan: Thanks, man. I let out a huge sigh of relief as well when the play counts transferred! Enjot your new MacBook Pro!

Hi Man,

Thanks for adding this level of detail to my original tutorial (on SchmolleWorld). I never got past ‘take your favourite editor and do a careful search and replace’. :)

Schmolle

Schmolle: My pleasure, man. I work best with visual examples, so I figured I might as well help others out with it.

Thanks! You say, “If you don’t mind letting iTunes manage your music, there are easier ways to make the transfer.” I like easier — can you point me to one of these? I want to make sure I retain my playlists & playcounts after I transfer from PC to Mac, but I seem to be getting conflicting info on whether I need to edit the xml file if I consolidate & let iTunes manage my music.

PS: I can’t use CDs/DVDs to transfer because my PC’s drive does not work, and I can’t use my iPod because it’s too small. I will be using an external drive.

Hey there I hope someone can assist me. About a year ago my iTunes became corrupted. I could not listen to music or anything. I did call Apple for support and it never got resolved. I tried many times to uninstall reinstall etc. Finally I got tired and deleted everything except the itunes folder. I believe I deleted the iTunes Music Library.xml and the iTunes Library.itl. Ok so I just reinstalled iTunes with new music. I have been trying to import, move the folder replace the folder etc. Nothing has worked. I contacted Apple and they allowed me to re-download all of the music from before. However I can not move all of the other music into the iTunes. The most simple solution would be to get if from the iPod but I do not have it anymore. Additionally something happened to my orginal windows profile so I need to now move all of my docs pictures etc so I can whip the machine clean. How can I get the old folder of music back?

iTunes Diva: I’m not sure if I can help you, especially if Apple customer service hasn’t helped! Just keep scouring the internet!

I actually had two itunes library.xml files: one in my c:\music folder and one in the c:\music\itunes folder. I had to do some creative find/replace/copy/paste to reduce it to one file, but it all worked flawlessly, and I ended up with only 100 duplicates in a library of over 6500 items.

Thanks a ton for this, it worked great!

Thanks – this is great. I just got my first Mac and was able to move everything over almost perfectly. One question/problem though: my PC iTunes library has 5657 songs – my Mac iTunes library has 17 less – 5640. Any idea how that happened, or how I can easily ID what the missing 17 songs are?

@Alex (and others): the album artwork comes in two forms:

1) Metadata within the files themselves.

2) JPGs that iTunes downloads and keeps seperately from the MP3s.

When you transfer files, obviously the metadata enclosed in the MP3 file will transfer along. At its destination, iTunes will recognise and display it.

All the stuff that sits in the Album Artwork folder will have been left behind; it is those files that iTunes will download automatically.

Now, how to prevent any issues? I reccommend turning off the auto-download option, which allows you to identify the music files that do not have enclosed album art. Find the album art for those files. You can do this either by using iTunes to find it for only that file, then picking it out of the album art folder and stuffing it into the metadata yourself, or by using an MP3 editor with album art finding capabilities. I personally really like Tag&Rename which does all that.

An alternative might be to transfer the album art folder along. Dunno if and/or how well that works.

@Chris: you are right about the import functionality. This has been a feature that Apple has gradually expanded over the last few versions. These instructions/methods date back to well before that import functionality was usable; iirc at first, it would only import track names as if they were new files.

@Patty: if you are willing to go ‘the Apple way’ you get the benefit of being able to use their advice on the Apple forums. Look there for a solution that fits your situation.

@Chip: I reckon it is most likely that you had a few track in there that actually did not have files (anymore). They do not get past the initial filter that iTunes runs across a newly rebuilt Library.itl. In that sense, it is a roundabout way to get rid of broken tracks.. :)

If you do want to know exactly, I would personally opt for an old XML file and the new one, than parsing them on a command line with grep, sed, sort and/or uniq. Shouldn’t be too difficult for anyone comfortable with UNIX (or the Terminal, as MacHeads tend to know it :) but it might take some time to run if your files are big.

Something like:

(cat old.xml new.xml) | sed -n ‘/^.*Name\(.*\)/\1/p’ | sort | uniq -u

should give you names that appear only once in the combined set. Not the exact answer you are looking for, but it should narrow down the field considerably.

Oh, bugger. The forum software ate my command line. Contact me if you need particular assistance. (or refer to any entry level UNIX book)

I followed your procedure and found that about 1/3 of my music does not appear in iTunes on the Mac. It seems that in the XML from the PC the paths are truncated for long file names. So when the library rebuilds it doesn’t find the folders and/or songs that were truncated. Do you have any ideas on how to handle this?

To add some more, one song folder is called “The Future Starts Here_ The Essential Doors Hits”. One of the song files is “01 Break On Through (To The Other Side) [New Stereo Mix] (Advanced Resolution).mp3″

In the line in the XML is:
Locationfile:/localhost/Users/saedelstein/Music/iTunes/iTunes%20Music/The%20Doors/The%20Future%20Starts%20Here_%20The%20Essential%20Doors%20Hits/01%20Break%20On%20Through%20(To%20The%20Other%20Si.mp3

The following text is cut off in the XML:
de) [New Stereo Mix] (Advanced Resolution)

My best bet would be that your editor is at fault. What text editor did you use? If you try any other one, do you get the same results?

Incidentally, you could create a ‘fresh’ XML file by deleting it and restarting iTunes (obviously with all the music files in their original locations). Once iTunes is closed again, there will have appeared a brand new XML file.

I used TextWrangler but I also tried the Mac’s Text Edit and the long filenames are truncated in both.

I created a fresh XML as you suggested and the filenames are still truncated.

I think the truncations is happening in iTunes because it’s not just the end of the filename that’s cut of. For example,
the folder name is truncated in the middle of the path and the song name is truncated. But the extension .mp3 still appears.

I meant to say “I think the truncations is happening in iTunes ON THE WINDOWS SIDE.”

I did some more investigation and I think I know what’s going on but I have no idea how to deal with it.

When I started out I copied all my music from the PC to the Mac via my home network.

1. On the PC an example folder name is “The Future Starts Here_ The Essential Do” and a song is “01 Break On Through (To The Other Si.mp3″

2. Now I’m noticing that on the Mac the folder name is “The Future Starts Here_ The Essential Doors Hits” and the song name is “01 Break On Through (To The Other Side) [New Stereo Mix] (Advanced Resolution).mp3″

Somehow the folder name and song names got changed from what they were after the original copy to what they are now. Note: I just did a test copy and immediately afterwords the folder name and song name are the short names in #1. Apparently, at some point after the original copy the folder names and song names got changed, I assume it must have been by iTunes.

Now, I think the XML is reflecting the renamed names. But because some of them are so long my guess is that iTunes is then truncating them in the XML so that they don’t match the actual file names.

Does this make sense? If so, any ideas on how to deal with the situation so that the folder names and song names don’t get changed? I can recopy all the music but I’m concerned it will be a waste of time because they same thing will happen again.

Hello

A nice tutorial except that album art *is lost* for all song files that a user used the Get Album Artwork feature in iTunes. The only artwork that is carried over is that which is embedded within the metadata by the user, and the artwork that was embedded within a purchased iTunes Store file. This is a rather major flaw in the design of iTunes if you happen to have thousands of songs that were tagged ‘correctly’ after initially using the Get Album Artwork command. Basically, if you used the Get Album Artwork feature and move your Library (or revitalize from a backup), you lose the artwork, This makes no sense because it is still in the same folder and should reference properly.

cheers!

Thanks for the heads up, consumer_q. It's still not as bad as losing everything though!

I'm REALLY grateful for this. Thank you for taking the time to lay it out so clearly. My wife has been ready to strangle me because I've been at this for a good week. I tried a million other tutorials, but I've come up empty with each one. As a teacher, I have a big appreciation for clear explanations, and this was indeed very clear. Thank you immensely.

No problem, Daniel. I wrote it because it's the tutorial I would have wanted when I was doing it.

No problem, Andrew. I hope that eventually Apple makes it easier to do this… I agree that having to manually corrupt a file is a bit sketchy. But at least it works!

Thanks a ton for this. I've done this with versions of iTunes before 8 and it was much simpler (yet still not simple enough). I, too have about 3k songs and have been maintaining the database for over 3 years and I can't describe how great it is to make playlists based on those factors. For instance I have one that plays four or five rated songs which haven't been played in the last ten days. That's awesome for me so I get a good sampling of my tunes. Your tutorial ensures I can keep doing that. :)

Apple does a lot of stuff right, but you should never have to manually corrupt a file in order to get intuitive functionality.

So what happens if I want to follow your tutorial but I don't want to stop iTunes from managing my music? My friend and I have been trying to get my iTunes into my Mac and we have re-done it at least 4 times now. Each time it's something different. Either no playlists and ratings, music missing or the file cannot be found. Any ideas?

Thank you. It worked perfectly for me!!! I had only to download the album art again.
Thank you very much
Alessandro

I'm glad it helped!

Awesome took like 20 minutes total saved me a TON of frustration and hard work. I have 242 playlists with 5000 songs!

Nice!

This didn't work for me— but it could be my mistake somewhere along the line. One tweak: on number 7, I had TextWrangler wouldn't open the "iTunes Library" file, so I had to ask the "Finder" application to find the file, then clicked "Open" on the "ITunes Library" file and selected the "TextWrangler" application.

Everything worked but for one thing. It did not transfer my ringtones I created on the PC iTunes. Does DRM have anything to do with that? Will I have to create and buy them again?
Thanks Jake.

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.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required)