How to move an iTunes library in 2011

It’s amazing, considering how invested Apple wants us to get in iTunes playlists, play counts, ratings, etc., how hard it is to move all that stuff when you need to move your media files. These instructions may work for some people in some situations, but they never worked for me. After having screwed this up a couple of times, I’ve got a system that seems to work whether you’re moving your files to a new drive, a new computer, or even from Windows to Mac. Based on this, this, and this.

  • The most time-consuming step is to copy your media files. The important thing here is to keep everything in the same folders relative to each other. This is not the time for consolidation and reorganization, unless you’re prepared to start with a new library from scratch. You do not need to consolidate your iTunes library or let iTunes “Keep iTunes folder organized,” and you may want to uncheck “Copy files to iTunes Music folder when adding to library” under Advanced Preferences. You just need to know where all your media files are, and get them to where you want them to be.
  • Go to File > Library > Export Library. This’ll create a file called Library.xml, and might take awhile.
  • Now comes the tricky part. Open Library.xml in a text editor. There’ll be a short header, followed by a block of text like this for every song in your library:
   <key>Track ID</key><integer>20376</integer>
   <key>Name</key><string>Don't Let Me Lose This Dream</string>
   <key>Artist</key><string>Aretha Franklin</string>
   <key>Album Artist</key><string>Aretha Franklin</string>
   <key>Composer</key><string>Aretha Franklin/Teddy White</string>
   <key>Album</key><string>I Never Loved A Man The Way I Loved You</string>
   <key>Kind</key><string>MPEG audio file</string>
   <key>Total Time</key><integer>139728</integer>
   <key>Track Number</key><integer>5</integer>
   <key>Date Modified</key><date>2009-05-20T14:06:57Z</date>
   <key>Date Added</key><date>2010-10-19T02:02:06Z</date>
   <key>Bit Rate</key><integer>192</integer>
   <key>Sample Rate</key><integer>44100</integer>
   <key>Play Count</key><integer>3</integer>
   <key>Play Date</key><integer>3388003973</integer>
   <key>Play Date UTC</key><date>2011-05-12T04:12:53Z</date>
   <key>Persistent ID</key><string>151E35E000A507A9</string>
   <key>Track Type</key><string>File</string>
   <key>Location</key><string>file://localhost/C:/Users/alesh/Music/MUSIC A/Aretha Franklin - I Never Loved A Man The Way I Loved You/05 - Don't Let Me Lose This Dream - Aretha Franklin.mp3.mp3</string></string>
    <key>File Folder Count</key><integer>-1</integer>
   <key>Library Folder Count</key><integer>-1</integer>
  • The bit we care about is the path in the third key from the end. In this case it’s file://localhost/C:/Users/alesh/Music/MUSIC A/Aretha Franklin – I Never Loved A Man The Way I Loved You/05 – Don’t Let Me Lose This Dream – Aretha Franklin.mp3.mp3 — you may see a bunch of “%20” characters instead of spaces … don’t panic.
  • We’re going to do a search and replace for the part of this string that’s changing. In my case, I’ve moved this library from my Windows music folder to a folder on a drive called External on a Mac. So I’m going to do a search for “C:/Users/alesh” and replace it with “Volumes/External”. I’ll end up with file://localhost/Volumes/External/Music/MUSIC A/Aretha Franklin – I Never Loved A Man The Way I Loved You/05 – Don’t Let Me Lose This Dream – Aretha Franklin.mp3.mp3.
  • You need to be careful here, and get everything right (No missing or extra slashes (and yes, they’re always forward slashes), drive letters on Windows but not on Mac, etc. If you’re not sure, do this: just drag one single file into iTunes, export the library, and find the path that iTunes assigned that file. You can delete it (from iTunes, not from the drive) when you’ve got the correct path. When it’s all done, save Library.xml to a new location, so that you have the old one if anything goes wrong.
  • If you’re moving files to a new location on the same computer, now comes the hard part: you need to DELETE all your music from iTunes. Go Edit > Select All and Delete. Confirm that you want to remove the songs from your library, but do not let it remove the files. If you’re moving to a fresh installation of iTunes on a new computer, no need for this obvs.
  • Now go to your fresh clean iTunes, and hit File > Library > Import Playlist. Select your Library.xml file, and go make a sandwich while iTunes imports the file. This’ll take awhile.

Let’s pause here a second and consider that “Import Playlist” command. Apple chose to call it that instead of “Import Library,” making it completely non-transparent to a casual observer that there’s even a way to move a library from one place to another. Shame on you, Apple, for (a) not making this whole process automatic and/or easier, (b) playing coy about the fact that it can be done at all, and © changing how it works from one version of iTunes to another. Rant over.

  • Everything imported? Now one of two things will become apparent: either it will have worked, and you can play your music, or it will not have worked, in which case all your songs will have a warning icon next to them and nothing will play. If it didn’t work, chances are you made a mistake on changing the paths. Delete all the songs from iTunes again, go back to your Library.xml, and try again.
  • If you’re moving to a new computer, you’ll need to transfer your podcast subscriptions, too. Much easier: right-click on the podcast listing in iTunes’ sidebar, hit Export, select “OPLM” as the file format, and drag that file straight onto the Library in iTunes sidebar. You’ll need to download the files again, but your subscriptions are good to go. The same will work for iTunes U subscriptions.
  • What DOESN’T get transferred is your iPod/iPhone/iPad sync settings and your apps. Keep this in mind, because as far as I know you’ll have to recreate that information if the new iTunes install is to be your external device’s new home.
  • And if you’re logging out of your old machine’s iTunes for the last time, remember to go Store > Deauthorize This Computer…

Please let me know if I’ve missed anything, or if this information is incomplete — I’ll be updating this file as necessary.

2 thoughts on “How to move an iTunes library in 2011

  1. Just saw this now and not sure if it still works, but every time I’ve had to move music from one computer to another, I simply copy my iTunes library backup (which I have on an external drive) to the new computer, replacing the default one. As long as my user name is the same, it works. (It’s always been Mac to Mac, should be noted.)

  2. That’ll work if (a) you’re on the same platform and (b) the location of the files is always the same. I’m on a (brand new!) Mac mini, and I’ve moved my home directory to a 3TB external drive (time will tell if this was a wise approach), so it’s been rough. But I think that as apple becomes more air-centric and music libraries grow (which, maybe they’ll just move to the cloud?), this’ll only become more of an issue.

Comments are closed.