Monday, November 19, 2012

Transfering Your iTunes Library from OSX to Windows 8

This post is not about localization, but it is about something that I was able to do because of my experience as a localization engineer, manipulating files and editing XML.

We recently purchased a desktop with the Windows 8 operating system, in part to replace her pre-Intel iMac.

Now, there are guides to transfer your iTunes library from Mac to Mac. There are guides to transfer your library from Windows to Mac. But, as far as I can tell, there are no guides to transfer your library from Mac to Windows.

I was able to do it, without losing any information about the playlists or play count, etc.* This is how.

This guide was inspired by this guide and this guide, but mostly the first one.

Dale's Guide to Transferring your iTunes Library

Step 1: Transfer your files.
Follow parts 1 and 2 in that first link. This will get all of your music and videos, as well as the database and XML files that contain the information about your library, and put them on an external drive. I used an external hard drive that connects via USB.

Step 2: Make sure iTunes is set up on your new computer.
Download iTunes and open it. Then close it. That's it.

Step 3: Back up the XML file from your new computer.
In your iTunes folder, on your new computer, locate "iTunes Music Library.xml". Copy it somewhere, like your desktop.

Step 4: Rename your old iTunes music folder, inside the iTunes folder to match the new one.
Go to your external hard drive and change the name of your music folder, if needed. On our new computer, it's "iTunes Media". It was something like "iTunes Music Library" or something like that before.

Step 5: Get the file extensions right.
First, make sure to turn on viewing file extensions. Then, locate 3 files inside your old iTunes folder. They will be named "iTunes Library Extras.itdb", "iTunes Library Genius.itdb" and "iTunes Library.itl". On our Mac, one of them was missing the file extension. Add it if needed.

Step 6: Copy the files over.
Copy your files from your external drive to your new computer. Respond "Yes" to any prompts you may get to replace files.

Step 7: Edit the XML.
Do not get overwhelmed. That XML just contains all of the information about your library. No big deal. (Besides, if you mess it up, you have the old one backed up on your old computer and your external hard drive. You backed up your new one in Step 3).

To do this, open a text editor. Not Notepad. Anything but Notepad. Mac uses a different way to represent a new line, and Notepad will display everything in one line. Use Notepad++, or copy the text into Google Docs, or something. Compare the first several lines between your new one (that you backed up in Step 3) and your old one. There are two lines that are important to change in your old one:

<key>Application Version</key><string>x.x</string>
Change this to the version of iTunes in your new XML file. Our version is 10.7

<key>Music Folder</key><string>file://localhost/<file Location></string>
Your old one will have a Mac location. Copy the line from your new one and paste it to replace your old one.

Everything from "Major Version" to "Music Folder" should match the new, backed-up file. Don't change anything below or above that. After you're done editing, save.

Step 8: Open iTunes.
You're done!

* Full disclosure: There were 8 tracks that did not transfer, because apparently the path was too long. They were all from the same album - an audio book. We'll manually transfer them over later. Still, 8 tracks out of almost 2,000 isn't bad. Also, this guide should work for transferring from Windows to Windows as well.