Migrating an iTunes Library

June 25th, 2006 2006-06-25T23:46:02-0700

Go go lazyweb!

Here’s the deal: I usually use my PC to listen to music but having just moved back home, there’s no room to set it up. Therefore I’ve instead copied a small subset of that music onto my iBook and will be using that instead for the next few months – iPod syncing et al.

This is great, but just copying the files over causes me to lose ratings and play counts, which are in turn vital for the Smart Playlists that are used to fill my iPod.

Both my iTunes/Win and iTunes/Mac music libraries were set to have the music organised by iTunes, therefore the music has the same names and subdirectory structure on both machines. The difference is just the location of the library: file://localhost/D:/All%20Users/Music/ on the PC and file://localhost/benward/Music/iTunes/iTunes%20Music/ on the Mac.

Now, I’ve had suggestions of mirroring the entire PC Library onto the Mac and then just trimming out the music I don’t want, but there isn’t enough disc space. Nor is there enough disc space on the PC the mirror it locally, trim it and then migrate the whole lot to the Mac.

My attempted solution has been to copy ‘iTunes Music Library.xml’ file from the PC to the iBook and use Find+Replace to change the paths to the files. If this worked it would leave about 3000 dead tracks in my iBook Library, but I suspect that can be cleaned up with a script afterwards.

Trouble is, find and replace doesn’t work. I amend the PC library’s paths, delete the iTunes library files and place the modified XML in the Mac’s iTunes Music directory. Restarting iTunes opens with an empty default Library, replacing my hacked version.

So, does anyone understand the iTunes XML PList better than me and fancy a guess at the hacking required to migrate it?

Thanks.

Tagged

Posted in

4 Responses to “Migrating an iTunes Library”

  1. Comment by http://nascentguruism.com/ Steve Marshall

    June 26th, 2006 at 3:32 pm 2006-06-26PDT15:32:16-0700

    Ok… I’ll try to explain again.

    The full mirror thing is what we, in the industry of techmologies call a ‘backup in case Ben breaks things and cries with the waa-waa-waaing’.

    With that in mind:

    1. On the PC, trim down your iTunes library to what you wanna keep in iTunes.
    2. Close iTunes everywhere, ever
    3. Then do the find and replace dance you mentioned.
    4. Copy all files to iBook, including iTunes Music Library.xml and iTunes Library.itl, but not to ~/Music/[blah]. Do not delete the files from the PC just in case of jam/coke/flaming iBook disc rapists
    5. Find the equivalent of iTunes Library.itl on the iBook, and rename the copied-from-PC iTunes # Library.itl to match.
    6. Move the copied-from-PC files to the appropriate place (library files in ~/Music/iTunes/, but I’m not certain – depends where they may be in the PC…)
    7. Open iTunes and hope.

    If this doesn’t work, then I dunno. I think this worked for me. Or it didn’t, and I simply did the ‘import XML’ thing after copying the files across and putting them where I wanted ‘em, but didn’t worry about losing playcounts and ratings. I forget which. I think it may have been the former, but a knowledge of iTunes suggests the latter.

  2. Comment by http://www.markwilson.co.uk/blog/ Mark Wilson

    July 12th, 2006 at 10:25 pm 2006-07-12PDT22:25:23-0700

    Ben,
    You need to empty the .itl file too (i.e. open it up and delete the contents, then save it again) – that will make iTunes think its corrupt, then will rebuild from your edited .xml.

    There’s a load more info at http://hifiblog.com/past/2006/05/11/howto-move-your-itunes-music-while-preserving-library-data-when-you-dont-let-itunes-manage-your-music-library/ and it’s just worked for me – I’ll write it up and let you know when I’ve posted the method on my blog.

    HTH, Mark

  3. Comment by http://ben-ward.co.uk Ben

    July 31st, 2006 at 10:53 pm 2006-07-31PDT22:53:22-0700

    Steve: Thanks. My previous failures came from not including the ITL file, or more specifically as Mark enlightens, I started iTunes up with just an XML file, no ITL at all. That cause it to reset to default. The the self-corrupted ITL as Mark suggested iTunes went into restoration mode and seems to have imported everything as I’d hope it would.

    Thank you very much both. I can finally sync my iPod again!

    Ben

  4. Comment by gr

    July 4th, 2007 at 6:56 am 2007-07-04PDT06:56:14-0700

    Um.

    Is there something wrong with doing File -> Import on the iBook side?

    That’s what it’s there for. Just import the xml file from you PC, and it will go put things in the right place. Oh.. and you want to import the XML file produced by File -> Export Library, not necessarily the one you scrounged out manually.

    I just did this (granted, between a PowerBook G4 and a MacBook Pro, both running Mac OS X) and it worked like a charm. The only down side was dupes of all the iTunes-provided smart playlists, so I just ditched the lot of those.

Ben Michael Ward.

Ben is a 24 year old Web Developer from Cambridge and is a computing graduate of the University of Manchester.

Talk to me

Email

IM

AIM
iChat
Skype
Yahoo! Messenger
BenWardcouk
Google Talk
Jabber
MSN Messenger
talk@ben-ward.co.uk

Add me to your Address Book

  • Links