20100113

Transferring iTunes libraries: A multi-version, multi-device, multi-computer, multi-OS journey.

Author's Note: These were some of the worst, and most torturous hours of my life that I will never reclaim. I hope you don't have to do the same...



Moving iTunes libraries from one computer to another is a notoriously difficult process and having just upgraded from an Acer Travelmate 4602 with Windows XP running iTunes 8.2 to a Dell Studio 1557 with 64-bit Windows 7 and iTunes 9, it only got worse than it's reputation. Here are a collection of methods, problems and solutions that should help you with one of the worst bits of software ever: iTunes.





From here on in, I'm going to assume a couple of things: 
1. At least most of your music is imported and not directly bought
2. You don't want to allow iTunes to consolidate your library and ruin your folder structure.
3. You're running iTunes 8 on the old machine. v6 and v7 should also work, but no guarantees on v9
4. You have a USB drive and/or portable HDD (preferred) with quite a lot of space on it
5. iTunes is closed unless you are doing something with it


The Library


First, you need to sync every device you've got with the old machine. This way you can always fall back to the old one. Now, on the new machine you should install iTunes, but be VERY careful to try and install the same family of iTunes on the new as the old. That is, if you are running iTunes 8 on the old, try to install iTunes 8 on the new (try Googling "iTunes 8 " and you might get a hit. I found a copy of iTunes 8.0.2 for 64-bit Vista on the Apple site). Now, go to Edit>Preferences in iTunes (old machine) and on the last tab, check if the "Add to iTunes folder when adding to Library" (or similar) is ticked. If it is, you're going to have to go to the folder listed in the box above and get all the music out of it. 


Next, go to C:\Documents and Settings\\My Documents\My Music\iTunes (C:\Users\\etc on Vista and Win7) and you should find a whole heap of files. Most importantly, there should be an iTunes Library.itl and an iTunes Library.xml. First, make copies of this folder in an 'Original' directory on your USB drive. Now, copy it again to a 'Modified' directory on your USB Drive. Here comes the tricky bit...


Right-click on the *.xml file and choose to Open With Wordpad. Now is the time to decide where your music will be kept on the new machine. For simplicity's sake, I'm going to say that it used to be at D:\media\ and it will be at C:\mp3 on the new machine. Press Ctrl-H to bring up the Find and Replace window. Type the old address into the Find box and the new address into the Replace box and let Wordpad do the work. If you ever have problems with locating missing files in iTunes, now would be the time to fix that using the same replacement method.


How this is going to work is relatively simple. iTunes uses the *.itl file to keep track of your library. Unfortunately, the *.itl file looks like gibberish and nobody has found a way to read or modify it. If we remove the *.itl, iTunes simply gets pissed and gives up. However, if you leave the iTunes file but perform creative maintenance on it (i.e. break it), iTunes will use it's backup, the *.xml file, to rebuild the *.itl, now with all the new information in it.


So, once you've finished with the *.xml file, save it and close it. Copy your whole "iTunes" folder (containing the new *.xml, as well as many other bits and pieces) into the same C:\Documents and Settings\\My Documents\\My Music\iTunes or C:\Users\\My Documents\My Music\iTunes directory, but on the NEW machine. Next, do not start up iTunes yet, but open the *.itl with Notepad. If it looks like a whole lot of gibberish, it's working. Select the whole file (Ctrl-A) and then delete the text (not the file). Save and close the file and use Windows Explorer to check that the file size is now 0 KB. Now, make sure all your music is where you said it would be on the new machine. 


Now is the big question. Fire up iTunes. If all goes well, there should be a dialog box telling you that iTunes is rebuilding your library etc etc and a progress meter will show. Wait for it to finish and your library should be waiting for you.


If it's not, you have a problem that needs fixing. I can't pre-diagnose it because of the sheer complexity of iTunes's flawed workings. E-mail me and I might be able to help.


Final step is to get any music you've bought off the Store. This isn't too difficult. Simply disable automatic syncing in iTunes then connect one of your devices (even an iPod touch or iPhone would do, but I wouldn't recommend it until you've finished the steps below. An iPod would be better). You also should've signed into the Store with your iTunes account from the old computer at least once before you try this. When the iPod appears in iTunes, right-click and select Transfer Purchases and you should get anything you've bought to come off it.


Devices:


Assuming all has worked well, you now have a library and want to re-sync all your devices. Depending on your library, iTunes, and degree of success, the iPod shouldn't even realise that the new computer is not your old one. If it does, you may have to do another first sync and effectively reset your iPod. Hey, you can't get everything.


Now if you have an iPod touch or especially an iPhone, you have to do a lot of things. First, as a fall-back, get back on your old machine and go to C:\Documents and Settings\\Application Data\Apple\MobileSync\Backup (or C:\Users\\AppData\Roaming\Apple Computer\MobileSync\Backup on Vista and Win7). Also note that this is a hidden folder and you may have to enter it straight into the address bar if you can't see it. Now, there should be a folder with lots of funny letters and numbers. Grab the whole folder and put it onto your USB drive, then copy it onto the new machine into the matching directory. 


Now to the tricky bit. Ensure (yes, again) that Automatic Syncing is disabled, then connect your iPhone. When it appears, right-click and choose Transfer Purchases from iPhone and wait for it to complete. You may have to re-sync all your music and some/all of your PIM information, but it's better than nothing.


If that didn't work, or like me you read this about three hours too late, and your iPhone is now pretty much as it came out of the factory, you're going to have to actually make it like it came out of the factory. Connect your (semi-empty) device to the computer and you should get the Device Summary Tab. Click on Restore and follow all the prompts to flash your phone. After that's finished and the phone has activated itself (NB: You need to have Internet to activate) you should get a screen giving you two options: To start off as a new device or (assuming you copied the backup right) to restore it from a backup. As you can guess, we're going to choose the second option. If that doesn't work, you're in deep shit and I've got nothing to help you. Note also that after that first accidental deletion step, you can no longer sync your device to the old machine either, since that will sync the iPhone's distinct emptiness to your old machine, over-ruling it's previous fullness and possibly removing your last chance at rescue. As such, not such a good idea.


Summary: 


By the end of all this, everything should be working just fine. At this point, it's perfectly fine to upgrade your iTunes to whatever version you want since it will preserve your new library. 


If it hasn't worked for you, you can let me know in the comments or e-mail me at ferretynetwork@gmail.com


Good Luck! you could need it...

No comments:

Post a Comment