Monday, November 1, 2010

Sync iphone to multiple itunes libraries - works on 10.0.1

Its a bit of a pain that you can't sync an iphone to multiple itunes libraries - for me it's between home and office.
It turns out that it is pretty easy to get this to work.

CAUTION: Back up your iTunes media before you do this, as you may need to readd all your music and media after recreating the library file.

Each itunes library has a persistent ID in its Itunes Library.xml file:


<key>Library Persistent ID</key><string>C4C5884F4015XXXE</string>

You need to change this ID on every iTunes you want to sync to to be the same. Save the file.

You also need to change iTunes Library.itl. On OS X, this doesnt have any extension.

Open this with a hex editor and search for the current Library Persistent ID as hex. It should be right near the top. Replace it with the one from your primary machine, but also copy the bit before it:

68 64 66 6d 00 00 00 90 00 00 1c d5 00 16 00 03 06 31 30 2e 30 2e 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 c4 c5 88 4f 40 15 64 de

Now start iTunes. It might complain that the library file is invalid and recreate it. When it does, immediately quit iTunes and check the file. If it's still the same Persistent ID, then the trick has worked and now you should be able to copy music and movies to the device.

Tested on my iPhone 2g running iOS 3.1.3, Mac running iTunes 10.0.1, Win7 running iTunes 10.0.1. Use at own risk.