Limited Edition iPhone header image 2

Sync The iPhone With 2 Computers

October 17th, 2008 · 3 Comments · Apple, iPhone, Mods

Want to sync your iPhone with your work machine and your home computer? What about your laptop and your desktop? Now you can with a simple hex edit.

The instructions below use the example of modifying the iTunes library on my home Mac to work with my existing iPhone/PC setup. If your existing library is on a Mac, or both machines are of the same type, then the steps are identical.


  • On the PC you can find your iTunes folder in your “My Music” (XP) or “Music” (Vista) directory. On the Mac it is in your Music directory.
  • Download UltraEdit on the PC and use TextExit or HexEdit on the Mac. You only need to edit files on the second computer.
  • After completing these steps you will be able to sync your iPhone with both computers, either by normal syncing or choosing one machine to manually manage your music and videos. Unless you also keep your music libraries in sync, I recommend you do not attempt to normal sync the same types of data on both machines.

Backup Your Library

On the machine you want to sync with, backup “iTunes Music Library.xml” and “iTunes Music Library” (Tunes Music Library.itl on PC) to a safe location. These are the files you will be modifying.

1) Find your iTunes Library ID

On the machine your iPhone currently syncs with, open “iTunes Music Library.xml” with a text editor and find the entry between the <string></string> tags, after “Library Persistent ID”. In the example below this is 8B6C633F7DACB74B. Copy this entry exactly to a piece of paper, email, temporary file etc. You can then close this file.

2) Change your Library ID

iTunes stores your library information in two places. An XML file and a binary file. You now need to change the ID in both so they match your other library.

Make sure iTunes is not running.

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.


Start iTunes on the machine you wish to sync with and plug in your iPhone. When you select “Manually manage music and videos” you will no longer be prompted to erase your data, nor will the files on your iPhone be grayed out.

Additional Notes

Previously I’ve found that intentionally corrupting the binary “iTunes Library” file (e.g. replacing it with a text file) would cause iTunes to regenerate it using the XML data. This no longer appears to work for me in iTunes 7.6.1 and the “repaired” file only contains a few songs. This may be because I keep my music on an external drive but I cannot say for sure. Either way, patching the binary file does not take long and removes any chance of later problems.

If you do not care about being able to manually manage items and instead just want to sync different data in different places, there’s a simpler way. Turn off “Automatically sync..” on the summary page of both machines. On the computer you want to sync contacts/calendar with select only these items and perform a sync. Now, on the second machine enable Music/Photos/Etc and perform a second sync. You will be warned the media library will be deleted, but as there’s no media this is fine :)

-Thanks andrewgrant


3 Comments so far ↓

  • Pete

    Nice work andrewgrant! I can’t tell you how much I needed to do this! Email me if you ever need anything. Peace, Pete

  • Dave


    I cant seem to find me old Library ID in the .itl file.. In Hex.. I am running Itunes Ver 8.1.1 on both PC’s (they are both WinXP).. Please help via Email!


  • Trevor Pillar

    Does not work for my Iphone 4 and Itunes 10.
    Any suggestions welcome.

Leave a Comment