New PC & moving itunes library

Update 30/07/2009I just bought an imac and moved the same, but now consolidated, library over to it. Check out the instructions here.

Whoohoo! My new hardware has arrived, last week. I’ve been busy playing with it so that explains the small delay in posting.

Right now I am still going through the tedious procedure of getting everything the way I want it. I have a local network so I can access my old PC. However, dragging my external HD between the two machines is much faster.
Tediousness includes copying my itunes library. Tricking itunes into accepting the old library is somewhat of a challenge. But that’s what’s google is for. Since I found google’s answers a bit disappointing (lots of drag this folder there type of stuff from Apple users), I’ll post some detailed instructions for real users who do not “consolidate” to the itunes folder but choose to keep their music organized manually. To add some difficulty, my new machine has no second harddrive so the paths are different after copying.

If all goes well everything is moved (music, playlists, play statistics, ratings) AND I can sync my ipod with the new pc without that requiring it to be wiped and refilled with the moved library. I’m moving the library, not recreating it.

The Itunes library consists of only two files, its own itunes music folder and whatever external directories you imported (two in my case). One of the two files is a binary file, the other one is an xml file with data on all your songs, including path names, statistics, ratings, etc. Essentially, the xml file contains everything we want to migrate except for the mp3s. Unfortunately, moving the itunes library is not as simple as copying the files to the new machine. Sadly, Apple deliberately made it hard to do what you are about to do. So here’s a step by step guide (windows specific though Apple probably is about the same):

  1. At all times, keep at least one intact backup of all files mentioned in this post. Never work on the originals. Preferably, leave the original library untouched, you can always go back to that.
  2. Start by copying your mp3 folders to your new machine. That may take a
    while. Make sure they are where you want them to be. It took 20 minutes for my folders using an external HD, not
    counting the time it took to create the backup from scratch on
    the external hd (basically I used my incremental backup). Also copy both Itunes files (xml and itl) and the itunes mp3 folder (if not empty)
    onto the external hd.
  3. Now dowload, install, run & close itunes. It will create an itunes
    directory for you the first time it starts, that’s where it will look for its files. Replace the stuff inside this directory (My Documents\My Music\iTunes) with the
    backups on your external hd (including the itunes music folder). Now here comes the tricky part. Thanks for
    this post for putting me on the right track! DO NOT start itunes again until after the steps below.
  4. First fix the pathnames in the xml file. They still point to the old location. Open the file in a capable editor, the thing to look for is search and replace functionality. Search and replace the parts of the path names that are now different: your itunes music folder and any other folders you imported in your old library. Save the file.
  5. Now this is important: iTunes will ignore whatever path info is in the xml file! Unless the itl file becomes corrupted. We can fix that! Open the itl file in an editor, delete the gibberish inside, save. Your itl file is now corrupted, normally this is a bad thing. You still have the xml file though (and a backup of the itl).
  6. Start itunes, it will ‘import’ your music and afterwards complain that the itl file is corrupted, let it fix it.
  7. Check if everything is there. In my case I messed up with the search and replace and some files were missing. Just go back a few steps, copy your backups and retry.
  8. Done. Everything now is on the new PC. What about the ipod? Just plug it in!. You already installed iTunes on the new machine so you have the drivers for your ipod. The key or whatever itunes uses to recognize you ipod is in the xml file. And now also in the recreated itl. Apparently the xml file is sort of a backup of the itl. I suspect the itl is a bit more efficient to manipulate programmatically. I have no idea if this preserves any itunes store stuff you purchased. Presumably, this involves deauthorizing your old machine and authorizing the new one. I never used the itunes store so it’s not an issue for me.

The only thing I lost in the transition is some iTunes preferences that are easy to restore. For example I had some of my playlists set to shuffle. The imported playlists no longer had the shuffle enabled. Big deal. The preferences probably aren’t part of the library. I noticed that the shuffle settings do not sync to the ipod either. This is annoying actually because the shuffle settings is deep down in some menu on the ipod and I only want to shuffle playlists. I like my album songs served up in the order that they were put on the album.

I’ve used winamp for most of the past decade (I think from 1996?). Only when I got my ipod a few months ago, I started using iTunes, by choice. There is an excellent winamp plugin which will allow you to sync winamp with your ipod. Presumably, moving a winamp library is a lot more easy since winamp uses a file based library rather than a database. However, the main developer has left AOL, so winamp development seems a lot less interesting these days. AOL seems to just pile on commercial crap with every release. So I’ve given up on it for now.

45 Replies to “New PC & moving itunes library”

  1. Hey, I just wanted to tell you that this even works for moving the itunes library with all ratings, playlists, etc. from PC to (Intel)Mac. Same steps, after copying the music, just replace the string “file://localhost/C:/Documents%20and%20Settings/{User}/My%20Documents/My% 20Music/iTunes/iTunes%20Music/” with “file://localhost/Users/{User}/music/iTunes/ iTunes%20Music/” in the PCs XML file, copy it over to the Mac, empty the “iTunes Library” file (same as “iTunes Library.itl” on the PC and restart itues. It reimports the XML and you are done!

    Kind regards, pretzelmonster.

  2. First off, I’m thrilled you wrote this out in such detail. However, I’m running into some hitches so wanted some clarification.

    My ‘deal’ was that my Windows 2000 PC, with its 50GB worth of music and videos for my iPod, got trashed recently. The disk data was fine, it’s just the boot record that got hosed, and after many attempts I gave up and bought a new laptop (overdue for an upgrade anyway).

    So… I decided to attach the itunes library files as an external firewire disk to my laptop. My entire directory of files was be located at:

    c:\Documents%20and%20Settings\KLESSA\My%20Documents\My%Music\ITunes

    I got to step #3… and I specified:
    F:\MusicFiles\ITunes

    as the folder where my music should be.

    When I exited Itunes, that folder was left empty. I didn’t think from your directions that it should have. However, I copied over the .itl and .xml files, and edited the .xml file as you said, with the replace… took forever. However, now when I start back up itunes, in spite of ‘corrupting’ my .itl file, it never asks me to build the libary. Do you need to first delete all the old library files it saved already?

    Thanks for any assistance…

  3. I sure hope you still have a backup. Anyway. The idea of step 3 is to let the new iTunes create a new library (empty) and then replace it with your old, corrupted library.

    In other words the itl and xml file should be where the new iTunes expects them, which is probably on you C drive and not on your F drive.

    BTW. replace goes a lot faster with an editor that supports search & replace all.

    Good luck.

  4. I used your recommendation, jedit, nice quick editor — worked quite well.

    Okay, here’s the deal (and I do have backups, whew!).

    I have my itunes music files saved on a disk.

    I want the itunes library to end up on the F: drive, I don’t have room for them on the C: drive on my laptop (too much music).

    When I installed Itunes, I specified f:\musicfiles for my music directory. After installation and setup, it didn’t create ANYTHING in that folder. So I copied the .itl and .xml files into that folder, did the search/replace for the directory to change it to the new f:\musicfiles location.

    Isn’t that what I should be doing? The weird thing is that even after “corrupting” my .itl file, and confirming that itunes is definitely pointing to f:\musicfiles, it doesn’t seem to want to attempt to read the .itl file or the library at all.

    Thanks for your assistance. I haven’t even begun to worry about the deauthorization of all the music I’ve bought on itunes since my original machine died, dammit.

  5. The crucial step is letting iTunes create an empty library by starting it just once after the installation. After that you copy your own files to the directory that it created (there should be a new itl and xml file there already, which you replace by your own versions) and corrupt the itl. That tricks iTunes into believing that library is part of the whole setup and that it needs to be fixed.

    This worked fine for me. Though as mentioned above, the paths need to be correct in the xml file or it won’t find your files (that happened to me on the first attempt). The path file://localhost/Users/{User}/music/iTunes/ iTunes%20Music/ you pasted above does not seem to point to your F drive ….

  6. HALLELUIA! It worked. Okay, here’s the deal… even though I want my music files to be on the F drive, the library and XML still had to be on the C drive. I didn’t realize that — I think you stated that but it just didn’t get through to me.

    So in other words:
    – within the .xml file, I needed to replace with the F path
    – within iTUnes setup, I specified the F path
    – F Drive and path contain NOTHING but the various music files
    – I modified the .xml and .itl files contained on the C drive, in the iTunes standard place.

    Before, I was modifying the .itl and .xml on the F drive, thinking that’s where I pointed iTunes, that’s where it should go. WRONG!

    It’s now working JUST FINE. I have my playlists, my preferences, my ratings.

    Thanks so much for providing the extensive walk-through on this. Let me know if you ever need any database or programming assistance and I’ll be happy to oblige!

  7. I seriously had to just create an account and login to post a comment to THANK YOU for this post. It just saved my @ss trying to set my itunes up on my new laptop (with my music on my external harddrive). I labored over this for awhile until I found you post and BAM, it was fixed in a few seconds. Thanks man, call it one guy doing another guy a solid.

    1. Hey I am not really sure how/what to replace in the editor. I am not a programmer so this is really new. I have itunes folder with nothing in it and have editor open but am unsure WHAT to replace with WHAT.

  8. I, too, registered for an account just to thank you for this entry. I was SO worried that I would lose my playcounts and playlists after switching to a new computer, nevermind waiting for my iPod to rewrite 8GB of music.

    Personally, I found that using a local area network to transfer the files to the new computer was much faster than an external hard drive. Even using a basic messaging client allowed me to transfer at 20MB/s, much faster than copying files to an external hard drive (though, I must note, my old machine still has USB1.1, so that would have taken forever).

    Also, I found it easier to create an identical folder filepath on the new machine. This way, I didn’t even have to search/replace the filepaths in the .xml file (for more than 2000 songs) and therefore avoided any files from being lost. Granted, I was moving to a hard drive that was identically labelled as on the old PC.

    Anyhow, thanks for your tutorial. It made me feel less stupid than Apple’s “Plug in your iPod” tutorial.

  9. Thanks so much for this. It all worked fine except when I came to burn a CD from iTunes – I’m told that ‘disc recording not found..’
    Is this related to having moved iTunes or is it a separate issue?

  10. Hi Lisa, I’m not sure what that error could mean except that maybe the path information for some songs is not correct. I’ve burned cds from my moved itunes library without errors.

  11. Thanks for a great writeup.

    Has anyone tried this and managed to keep their podcast subscriptions? My previously received podcasts came over, but not the subscriptions.

  12. Thanks so much for this entry! Transferring from my Thinkpad to my Macbook worked like a charm.

    To rmccoy, same thing happened to me. Podcasts went over fine (play count and everything) but I had to resubscribe. No biggie though, just had to click the “subscribe” button again.

  13. I tried all directions.

    Fresh computer. it gives the error that itl is damaged but that is it. When itunes opens no music in library.

    Copied all of it to local hard drive. I have tried it 3 times.

    step by step. All 27 gb of music is under %iTunes\iTunes Music\ then all mp3’s are under F00 F01 F02 and so on…

  14. Hi engvoip,

    The whole point of my explanation above is that not everybody chooses to have their music organized automatically by itunes. Additionally, we’re talking about moving your music to an entirely new machine that might not even be accessible from the old machine directly. Apple does not offer any guidelines on how to do it and even seems to include features in itunes to make this hard for normal users. The explanation on their site only works for moving files around on the same machine.

    And Bamm,

    Sorry to hear it didn’t work for you. Are you sure you edited the paths correctly? %iTunes does not sound right to me.

  15. Ahhh foolish me went for help AFTER I already made my careless mistake. I got a new hardrive so I went zipping through moving my files. And I CUT and pasted my whole Itunes folder.. So that means no backups at all. Would it still be possible in any way for these instructions to work for me? Thanks!

  16. I’ve always stopped when someone/place asks to me create an account to post a comment (“nah, no worthy”) but I couldn’t say the same thing this time _BECAUSE_ I want to tell you: THANK YOU VERY MUCH for your post. A year ago, I tried the steps that Apple suggests to accomplish the same task and it only created frustation; so I decided to keep my old (very) slow computer just to run iTunes. (what a pain!)

    I followed the steps as you describe and it worked smoothly. Again, THANKS for sharing your experience. Great job!

    – Sory

  17. Well that worked AWESOME! Thank you so much! Now I just need some spackle to fix the wall I’ve been beating my head against! 😉 2 notes. Wordpad in Windows works well to find and replace the path. Also, renaming the itl file doesn’t work. Once I followed your instructions exactly, surprise, worked as advertised. That’s the old IT guy in me – speed reading and knowing a “better way”. 🙂 Thanks again.

  18. Very useful information 🙂

    Will this method work as well if you have iTunes organize your music? I read the link posted above for moving to a new hard drive on your system but I will be moving to a new system and I am hoping that it won’t be too painful…

  19. Oh wow, thank you so incredibly much! I was a little skeptical about having to corrupt the itl file (Seriously, Apple, is this REALLY what it’s come to?), but hey, it worked, and I cannot thank you enough!! THANK YOU!!!

  20. This works so beautifully!! It took me about an hour to go through this process for my 30 GB of files but was so worth it! I keep all my songs rated in iTunes and once lost them all, so I’m really happy not to loose the ratings again. Thanks very much for posting this information.

  21. Many thanks. Worked like a charm. I am so very glad that I found this post. (And pretty cool that it is still providing assistance two years after being posted…)

  22. Thanks Baird. Quite nice to see that this post still gets many hits per day. But, I’d really prefer Apple to get off their ass and fix this properly.

  23. Fantastic. I was banging my head in annoyance until I found your post, which means I have kept my itunes library!

  24. This worked like an f’ing champ!!!! Thanks so much – my wife would have been PISSED if I’d lost her “workout playlist” building her new PC.

  25. Thanks so much for all who posted. It worked pretty well for me on the latest version of iTunes (9.02). Here are a couple of other items I though I’d add to the knowledge pool:

    jEDIT worked great. It was incredibly fast. Don’t use WordPad – it can only work with short files. Also, don’t use Word. I tried Word, and it took about 10 minutes to search and replace my 8MB itunes.xml file.

    If your new path includes spaces, remember to substitute %20 for each space.

    Us old DOS hacks are used to using a “\” in the path listing, but use “/” like you find in the iTunes original xml file.

    The podcasts didn’t come over, so I just added the contents of the Podcast folder to the library. You will, however, have to re-subscribe each podcast.

  26. Ok I have downloaded the editor and i am unclear on the instructions on WHAT to replace with WHAT. Consider I am not a programmer and am working with this for the first time.

  27. I had the same problem, new pc and all. But I only needed steps 1-3. After step 3, reopen iTunes. With the latest version, all you need is to authorize your computer via the app store. As in, a window will automatically show up asking you to login and authorize.

  28. Thanks so much for this useful post! I tried to migrate my library from Windows zu Mac for hours and it didn’t work – your tool explained exactly how to do it!
    Thank you!

Leave a Reply