I recently had the somewhat unenviable task of combining two large iTunes libraries into one and found that there’s pretty much no information on this online, so I thought I’d share my “technique” in the hope that someone might find it useful. Various guides detail the steps required to move a library to another machine, but not to merge it with another — the process shares some actions, but isn’t quite the same. So here you are, lucky you.
My situation was thus: I had an older Windows PC with a large-ish (40GB) library from an old version of iTunes (I forget which, probably 7), synced with my iPod Classic. I also had my MacBook Pro (iTunes 10) with a smaller library (15GB) synced to my iPhone. I wanted to merge the two in such a way that all the meta-data (play counts, ratings, playlists etc) would be preserved — combined into one definitive library on my MacBook that I could sync to both iPod and iPhone.
I didn’t have constant access to the old PC — only a copy of my iTunes library 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 properly — 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 making changes! It’s easy and good for your health.
One key prerequisite is that both old and new libraries must be sorted by iTunes — you need to use the “keep my music library organised” option so that iTunes organises your files by artist and album. If you don’t do this, you’ll have a tricky time merging the two folder trees together (unless they both use the same custom sorting scheme, but you’ll be lucky).
1. Due to the difference in iTunes library versions, the first thing I did was update the older library to the latest schema. I’m not sure if there are actually any significant differences between 7 and 10, but I didn’t want to make things any harder than necessary. I updated the older library by firing up a Windows 7 virtual machine (I use VirtualBox, which is awesome — but you could just as well use any other Mac or PC separate from your main machine), installing iTunes 10 and replacing the default library with a copy of my old library files. Restarting iTunes automatically updated them, and my old library was shown in iTunes (though none of the tracks were playable because the files weren’t on the system — no problem).
2. I went through a period a while back where I was adding new music to both libraries, so in order to minimise duplicates I sorted my newly updated “older” library by “date added” and deleted everything added after the point where my “newer” library started. I didn’t lose any play counts or ratings here because at this point I was only listening to music on my Mac. I also deleted all podcasts from my older library (had them set up on the new library anyway).
3. I then exported the “older” library from iTunes: File > Library > Export Library. This creates an XML file containing all the library data — I named this something like “Old Library Export” and moved it into OS X via the USB disk.
4. Back on my Mac, where the final merged library was to reside, I set about copying my old music files from the USB disk into my existing (“newer”) library. Both libraries used the following folder structure: iTunes > iTunes Music > [Artist] > [Album]. This meant that I could easily copy the old media into the new library’s folder structure. I essentially did this by opening the “iTunes Music” folder on my Mac (“newer” library), the “iTunes Music” folder on the USB disk (“older” library, copied from my PC) and dragging (moving) the contents of the older library folder into the newer library folder. Because my older library contained much more music, most of the artists would be new additions and wouldn’t already exist in the newer library. 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 original will be replaced completely, irrespective of any common contents. This is a key difference from Windows, where the contents of the folders will be merged. OS X doesn’t do that, and it’s something you need to be aware of.
5. Most of the artists moved across fine — I was left with a handful of artists remaining in the “older” folder that existed in both libraries, and I needed to merge them manually by copying the albums themselves across, overwriting or deleting where necessary. This is basically common sense so hopefully 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 library data itself I needed to make some changes to the XML export of the older library (from earlier), because it contained references to paths on my old system that wouldn’t make any sense on my Mac. I opened the XML file in TextMate (you could use any reasonable text editor) and did a find-and-replace, searching for file://localhost/C:/Users/James/ and replacing it with
Music/iTunes/iTunes%20Media/file://localhost/Users/james/ (split over two lines here for readability). This updated all the Windows-specific paths to the correct paths on my Mac. You’ll need to adjust those paths to reflect your username(s) and the location of your media files.
Music/iTunes/iTunes%20Music/
7. The final step was to merge the library data files.I took a backup of my Mac iTunes library file, then used File > Library > Import Playlist, selecting the XML file created earlier. After much processing and thrashing around, iTunes eventually presented me with a shiny new Library view showing the merged contents of both my old and new libraries. Woo!
Cleanup that I had to perform myself at this point included a few duplicate artists, genres that had become numbers instead of names, and album artwork. iTunes doesn’t preserve album art unless you copy it across yourself (I’m sure this is straightforward enough but I didn’t do it), so the easiest thing is to just hit Advanced > Get Album Artwork and let it sift through your collection itself and download as necessary. Then it was just a matter of syncing my devices and hurrah! Access to all my tunes once again.
In theory this process should work for anyone, but let me know if you get stuck. Good luck!
hey, great article– i look forward to studying it more in depth soon. Quick question tho’.
Have you found an easy way to merge 2 “album artwork” folders?
I’ve been saving my library on an external server from 2 different computers, but the artwork files that i added always remain on the computer in the music folder.
Thank you!
Hi allen, unfortunately I’m not aware of a solution to that! When I did my library merge all the artwork seemed to disappear, so I just let iTunes retrieve most of it again, and grabbed the rest myself. If you wanted to go down this route, you could use something like TuneUp to automate the grabbing of the artwork for you. Hope that’s of some help!
Well. That SO didn’t work. I followed all of your steps but it isn’t finding any of my music. So now I have empty playlists in there and a mess of a music folder. Sad face.
Double-check that the paths to your music files (as specified in the new XML file) are correct. It sounds like you messed up that step. Feel free to contact me with more details.
This site clearly explains how to merge libraries: http://www.ehow.com/how_5704389_consolidate-multiple-itunes-libraries.html
thanks for providing this set of directions. it’s probably the only one i’ve come across that succinctly makes sense.
i did manage to hit a minor snag, though: during the playlist import process, it recognized all the metadata except “date added.” any ideas as to why? that’s sort of the most important field for me.
hope this finds you well. thanks either way.
–J
This happened to me too, and at the time I wasn’t too bothered so I didn’t attempt to find out why.
It’s possible that the two library files use different date formats, and one is getting clobbered in favour of the other. In that case you might be able to write a script to transform the dates.
Good luck!
The date added field refers to the date a file was added to iTunes. So they’re going to be different on each instance of iTunes.
I’m with you on it being an important attribute in a music collection. Unfortunately it doesn’t make sense to preserve ‘date originally added’.
If this works for me I’ll be in your debt forever! I have a large collection of classical music (1,7 Tb now) and somehow iTunes managed to put all my .wav-s in two different files, with, of course, two different .itl and .xml file to go with them. I have already copied all physical music files to one iTunes Music-file and created a new .itl by editing the .xml file, replacing all the paths with find-and-replace. I was going to do the same with the second .xml when I discovered that this file had many key-numbers in it that were similar to key-numbers in the other .xml. So now I’m going to go for the Import Playlist trick in your manual under 7. and see what happens. Afterwards I will come back to report the result or I will have killed myself
Hey there
Thank you very much for your guide. I had a 8y old main lib and a newer one that became my main for the last year and I really wanted to merge. Your instructions helped a lot, but you should mention the omission of “Date Added”. Just like Jay, I really depend (and worship) this information. I “solved” it by making the old lib the base and putting the content of the new one into monthly playlists. No really smooth, but it will have to do.
So I am off enjoying all my precious music in one place and thank you once more!
— S