[digg-me]If you tried before to sync your iPhone with more than one computer, you probably had an error message saying that your iPhone is already synced with another iTunes library and asking if you want to erase this iPhone.

There is somewhat of an easy hack for this that Andrew Grant explains on his blog. You will need some basic hacking skills for this (I’m no hacker and I was able to do it). Andrew also lists editing tools that you will need to download: UltraEdit for PC, and HexEdit for Mac.

Basically, the process takes 3 steps:

  1. Backup your library
  2. Find your iTunes library ID
  3. Change your library ID

1. Backing up your library

On the additional computer you want to sync with, backup “iTunes Music Library.xml” and “iTunes Music Library” (you can find these in your iTunes folder in your “My Music” (on XP) or “Music” (on Vista) or in your “Music” directory on Mac) to a safe location. These are the files you will be modifying.

2. Find your iTunes Library ID

On the computer that currently syncs with your iPhone, open “iTunes Music Library.xml” with any text editor and look for the entry between the <string></string> tags, after “Library Persistent ID”. Note that it should be in the first 15 lines of the code. Now copy this entry as you will need it in the next step. You can now close the text editor.

3. Change your library ID

iTunes stores your library info in an XML file and a binary file. You will have to edit both of them. Note that iTunes must be closed. This part is a little tricky so either go to Andrew’s blog or follow directions that I copied from him below:

On the machine you want to sync with open “iTunes Music Library.xml” in a text editor. Again, find the entry between the <string></string> tags after “Library Persistent ID” and copy this entry exactly. This time you can use the clipboard if you wish.

When you have a copy, replace this entry with the one you copied in part 1. Make sure you do not change anything else, and the length of the entry is 16 characters/digits. Save this file and close it.

In the Hex Editor, open “iTunes Music Library” (Tunes Music Library.itl on PC).

Select “Find and Replace” from the Edit menu. Make sure “Hex” matching is selected (not ASCII). In “Find” enter the ID you took a note of in Part 1. In Replace, enter the ID you copied at the start of Part 2. Choose Replace All, there should be one match.

Save this file and close it.

That’s it! See, it’s not that hard.

This is a quick rehash of Andrew’s post. For detailed information with pictures, I highly recommend you go visit his blog.

If you know of an easier way to do that, please let us know in the comments.

  • Douglas

    Thanks ! That came really in a good time, I formated my laptop this week, and was already acepting the idea that I would have to transfer all my data do iPhone again.

  • Hello Douglas,

    Glad I could help 🙂

    Sebastien

  • This is great, but does anyone know where the persistent ID is located on the iPhone?

    I have the opposite problem as my iTunes crashed, and I really don’t want to have to wipe everything off my iPhone if I can avoid it.

    Cheers,

    Scootter

  • Singh

    Hi,

    i have a i phone 16gb not the 3G. the problem is that the PC that i had sync my phone with i don’t have it anymore as i have sold it and now i cant download more songs i have so much already in my i phone that i don’t want to loose all the data in it. so i don’t have a r iTunes Library ID. is there a way i can download more stuff through a different iTune?

  • destro

    I have actually created a small tool (PC only) that does all the work for you
    feel free to download it here:

    http://www.megaupload.com/?d=6QKYMDEZ

    and if you like it, toss a buck or two my way 🙂

    • San

      The file is unavailable!

      • San

        The file is unavailable

  • Joe Bobbins

    thanks i will try maybe