Fear and Loathing on the Learning Curve: Observations on Life, Tech and Web Design from a Slightly Misanthropic Mind

Merging Two iTunes Libraries

I recently had the some­what unen­vi­able task of com­bin­ing two large iTunes lib­rar­ies into one and found that there’s pretty much no inform­a­tion on this online, so I thought I’d share my “tech­nique” in the hope that someone might find it use­ful. Various guides detail the steps required to move a lib­rary to another machine, but not to merge it with another — the pro­cess shares some actions, but isn’t quite the same. So here you are, lucky you.

My situ­ation was thus: I had an older Windows PC with a large-ish (40GB) lib­rary from an old ver­sion of iTunes (I for­get which, prob­ably 7), synced with my iPod Classic. I also had my MacBook Pro (iTunes 10) with a smal­ler lib­rary (15GB) synced to my iPhone. I wanted to merge the two in such a way that all the meta-data (play counts, rat­ings, playl­ists etc) would be pre­served — com­bined into one defin­it­ive lib­rary on my MacBook that I could sync to both iPod and iPhone.

I didn’t have con­stant access to the old PC — only a copy of my iTunes lib­rary and music files on a USB disk. This meant a couple of extra steps which I’ll detail below. You’ll need a bit of patience and some spare disk space to do this prop­erly — also note that I did most of this on a Mac, so if you’re on Windows your mileage may vary slightly. Please back up any files before mak­ing changes! It’s easy and good for your health.

One key pre­requis­ite is that both old and new lib­rar­ies must be sor­ted by iTunes — you need to use the “keep my music lib­rary organ­ised” option so that iTunes organ­ises your files by artist and album. If you don’t do this, you’ll have a tricky time mer­ging the two folder trees together (unless they both use the same cus­tom sort­ing scheme, but you’ll be lucky).

1. Due to the dif­fer­ence in iTunes lib­rary ver­sions, the first thing I did was update the older lib­rary to the latest schema. I’m not sure if there are actu­ally any sig­ni­fic­ant dif­fer­ences between 7 and 10, but I didn’t want to make things any harder than neces­sary. I updated the older lib­rary by fir­ing up a Windows 7 vir­tual machine (I use VirtualBox, which is awe­some — but you could just as well use any other Mac or PC sep­ar­ate from your main machine), installing iTunes 10 and repla­cing the default lib­rary with a copy of my old lib­rary files. Restarting iTunes auto­mat­ic­ally updated them, and my old lib­rary was shown in iTunes (though none of the tracks were play­able because the files weren’t on the sys­tem — no problem).

2. I went through a period a while back where I was adding new music to both lib­rar­ies, so in order to min­im­ise duplic­ates I sor­ted my newly updated “older” lib­rary by “date added” and deleted everything added after the point where my “newer” lib­rary star­ted. I didn’t lose any play counts or rat­ings here because at this point I was only listen­ing to music on my Mac. I also deleted all pod­casts from my older lib­rary (had them set up on the new lib­rary anyway).

3. I then expor­ted the “older” lib­rary from iTunes: File > Library > Export Library. This cre­ates an XML file con­tain­ing all the lib­rary data — I named this some­thing like “Old Library Export” and moved it into OS X via the USB disk.

4. Back on my Mac, where the final merged lib­rary was to reside, I set about copy­ing my old music files from the USB disk into my exist­ing (“newer”) lib­rary. Both lib­rar­ies used the fol­low­ing folder struc­ture: iTunes > iTunes Music > [Artist] > [Album]. This meant that I could eas­ily copy the old media into the new library’s folder struc­ture. I essen­tially did this by open­ing the “iTunes Music” folder on my Mac (“newer” lib­rary), the “iTunes Music” folder on the USB disk (“older” lib­rary, copied from my PC) and drag­ging (mov­ing) the con­tents of the older lib­rary folder into the newer lib­rary folder. Because my older lib­rary con­tained much more music, most of the artists would be new addi­tions and wouldn’t already exist in the newer lib­rary. Important Mac-specific note: If Finder asks you if you want to replace folders, say no to all. On OS X, if two folders have the same name, the ori­ginal will be replaced com­pletely, irre­spect­ive of any com­mon con­tents. This is a key dif­fer­ence from Windows, where the con­tents of the folders will be merged. OS X doesn’t do that, and it’s some­thing you need to be aware of.

5. Most of the artists moved across fine — I was left with a hand­ful of artists remain­ing in the “older” folder that exis­ted in both lib­rar­ies, and I needed to merge them manu­ally by copy­ing the albums them­selves across, over­writ­ing or delet­ing where neces­sary. This is basic­ally com­mon sense so hope­fully you’ll be able to work this part out.

6. At this point all my actual music files were merged. Before I could merge the lib­rary data itself I needed to make some changes to the XML export of the older lib­rary (from earlier), because it con­tained ref­er­ences to paths on my old sys­tem that wouldn’t make any sense on my Mac. I opened the XML file in TextMate (you could use any reas­on­able text editor) and did a find-and-replace, search­ing for file://localhost/C:/Users/James/
Music/iTunes/iTunes%20Media/
and repla­cing it with file://localhost/Users/james/
Music/iTunes/iTunes%20Music/
(split over two lines here for read­ab­il­ity). This updated all the Windows-specific paths to the cor­rect paths on my Mac. You’ll need to adjust those paths to reflect your username(s) and the loc­a­tion of your media files.

7. The final step was to merge the lib­rary data files.I took a backup of my Mac iTunes lib­rary file, then used File > Library > Import Playlist, select­ing the XML file cre­ated earlier. After much pro­cessing and thrash­ing around, iTunes even­tu­ally presen­ted me with a shiny new Library view show­ing the merged con­tents of both my old and new lib­rar­ies. Woo!

Cleanup that I had to per­form myself at this point included a few duplic­ate artists, genres that had become num­bers instead of names, and album art­work. iTunes doesn’t pre­serve album art unless you copy it across your­self (I’m sure this is straight­for­ward enough but I didn’t do it), so the easi­est thing is to just hit Advanced > Get Album Artwork and let it sift through your col­lec­tion itself and down­load as neces­sary. Then it was just a mat­ter of syncing my devices and hur­rah! Access to all my tunes once again.

In the­ory this pro­cess should work for any­one, but let me know if you get stuck. Good luck!

   

Comment

You can also Register for more profile options.