I was lighting up the internet last night with foul and obscene posts regarding Apple and Steve Jobs and iTunes’ general suckiness because of one thing: An inability to—inside iTunes—easily make the switch from one computer to another.
I eventually made it work, and this is documentation how. For people who found this via Google, let me specify the exact conditions I was working with:
- Windows XP
- iTunes 9.0?
- The iTunes library was not in the default location (i.e. c:\documents and settings\my username\my music\whateverthehellitunescallsthisdirectory). The media folder was in a separate (internal) hard drive specified as E:\Music
- Home Network (i.e. didn’t have to mess with iPod transfers or external hard drives)
- Dell Studio 16 XPS Laptop
- New installation of iTunes 126.96.36.199
- Defaults for directory settings1
- Windows 7
Move the entire E:\Music directory from the Old PC to the New PC’s default iTunes directory while still maintaining my Library data (i.e. playcount, playlists, song rankings, etc.)
From the initial research that I was doing via Apple help (useless) and Google searches (a bit less useless) it seems that iTunes brands itself as the best music database manager evah yet can’t do what I would regard as a simple task, which is to pick up the database from another installation on the same home network and port it to a new location.
You see, iTunes isn’t a media directory, it’s a media database and the important distinction is that you could have media files (mp3, wav, mp4, aac, videos, etc.) scattered all across your computer and iTunes, being a database, doesn’t care. It simply sticks the (for example) music file into your Library, with the correct labels and artist and album art and links internally to that particular spot on your hard drive. So, if you look at two adjacent songs on your iTunes library, it’s perfectly possible for one of them to be at C:\Music and the other to be at D:\Another Directory\On Another Disc\Deep in a Subdirectory but from the perspective of you using the iTunes Library, it doesn’t matter.
iTunes does this by keeping track, in its library file, where that internal directory reference for the music file is. And herein lies the rub: You can’t just copy all your music to another spot and keep the same Library because every single one of those internal reference links will break. So, in order to move your music from one computer to another, you have to insure that your library references either remain the same, or get changed to reflect the new locations. If you’d asked me yesterday, I’d have said that the new version of iTunes should be able to do this automatically, I mean it’s not like no one’s ever going to buy a new computer ever again, thank you very much Apple. Apparently, I would have been wrong.
As specified above, my directory structure was changing once I was at the new computer so I had to make modifications to my Library in order to change the directory path of each media file. Then I copied over the entire Music directory from the previous computer and voila, it was fine.
This is the exact sequence of events I used, minus the crap that didn’t work
- Exported the Library file from the Old PC: iTunes menu File –> Library –> Export Library and I saved the exported file (an XML file) to my new computer. I was operating on a home network so this was easy.
- Downloaded and installed a trial copy of UltraEdit, an XML editor
- Did a Replace (under the Search menu of UltraEdit) of every instance of “E:/Music/” with “C:/Users/Bill/Music/”.
Two Important Notes:
- In windows, the directory path uses backslashes, like this “\”, however XML uses forward slashes, like this “/”. Make sure when you’re replacing the directory structure text that you’re using forward slashes. If you copy/paste the path from a windows explorer path bar, you’ll get backslashes.
- Also, and I don’t know if this is critical but I didn’t want to find out the hard way, but the directory path in the XML Library file was “E:/Music/”. Note the very last slash. In the windows explorer path bar (suitably modified with slashes instead of backslashes) it was only “C:/Users/Bill/Music”. Note the absence of the last slash. When I did the replace in UltraEdit, I added the last slash onto the path so that I ended up with “C:/Music/Users/Bill/Music/”2
And now I have an iTunes Library on the new PC.
I haven’t yet run all the various features of iTunes yet, such as authorizing the new installation to use my password and the files that I downloaded eons ago (if I still have to do that?). If I run into any trouble that makes me scream for Jobs’ blood, I’ll let you know.
1: Many moons ago I learned/decided that it’s just so much easier to always go with the default directory settings that Windows and iTunes and other programs such as that specify. It makes upgrading and keeping track of things that much simpler.
2: This may or may not have been important. The majority of the paths that were being replace looked like this:
When the replace I describe above operates, it will replace the the last slash (after /Music/) with another slash; basically a wash in the operation. However, I do not know if there are any locations in that XML file that didn’t have anything after the /Music/ which would have ended up with /Music without the slash if I wasn’t careful. This was me being paranoid. I suppose I could have done a search for /Music/ without any further text string but I didn’t think about that until just now.