(Or, How to sync an iPhone with one computer and manually manage music and videos on another).
Because I do most of my music listening at work and my Calendar/Address book are kept in Outlook I have my iPhone setup to sync with my office PC. When I’m at home however I find I also want to put music/podcasts/videos on my iPhone for the weekend or trips.
Normally it’s only possible to sync an iPhone with one computer. If you try to use a second computer you get the warning below that "the iPhone XXX is synced with another iTunes library. Do you want to erase this iPhone and sync with this iTunes library"?

However, I’ve found an easy fix for this. In the instructions below I’ll show how to modify any iTunes Library so it can also be synced with your iPhone. You can then either manually manage your iPhone on a second computer, or sync different data on different machines (E.g. Music at home, Contacts/Calendar at work).
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.
Notes
- 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.
- For the editing part, I recommend UltraEdit on the PC and a combination of TextExit / HexEdit on the Mac. Any hex editor will do, and you only need to edit files on the second machine.
- 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.
Success!
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





2008/04/01, 19:01
Well Done! worked exactly as described.
2008/04/11, 17:06
You sir, are a genius. Freakin’ FINALLY!! I have been looking for a way to put music on my iPhone by using my MacBook Air ever since I got the damned thing.
Here’s the thing- I wanted music I downloaded using my Air to be on my MacBook Pro, but not vice versa b/c my Pro holds the 30+Gigs of music. I finally found a way to get new music from my Air onto the Pro with the ratings intact- msg me if you want details. I’ve been looking for your solution to the iPhone thing forever.
Thanks!
2008/04/12, 19:32
YESSS!!! IT WORKS!!
You’re a genius! Been looking to do this since weeks! Thanks a lot!!
2008/04/15, 11:23
El Perfecto !!!
Thanks a million. It worked like a charm.
2008/05/13, 07:47
Caution. This didn’t work for me. iMac and older Ti book.
2008/05/31, 13:07
Woop, it worked, (desktop pc and a mac now manually managing music.)
2008/06/01, 09:33
Great!!!
2008/06/08, 18:04
You Sir Are a Freakin GENIUS !! …. You made it simple.
Thank You , Thank You !!! sooo much. Just GENIUS !!
2008/06/09, 16:38
Awsome. Thanks for the tip!
2008/06/23, 13:33
Where does Tunes Music Library.itl located on PC?
2008/07/09, 13:15
Thank You , Sir
2008/07/13, 21:47
Awesome, I’ve been looking for how to do this, thanks!
2008/07/14, 20:05
Thanks for the tip. Just want to get some clarification, Under the Summary-tab for each iTunes library (i.e. PC and Mac), we just need to have “manually manage music and videos” turned on only correct? (”Automatically sync when the iPhone is connected” depends on the user of course?)
2008/07/14, 23:35
RE: iTunes 7.7 (Auto-sync is off on both)
I recently tried this. On the Mac: I have INFO/PHOTOS/Apps syncing. On the PC: MUSIC + PODCASTS.
After syncing in from the Mac, and plugging the iPhone on the PC, Apps is turned on–if I turn it off it’ll delete whatever is in the iPhone. So I just left it on for both. Doesn’t seem to have any problem from what I can tell.
Meanwhile, after syncing the MUSIC + PODCASTS on the PC, I then plugged it in to the Mac. The MUSIC + PODCASTS syncing seems to be enabled. Clicking them off would delete the contents; as well as turning on “Manually manage music and videos” on the Mac’s Summary > Option section.
Anyone else experiencing this? TIA
PS. How about more screens?
2008/07/15, 19:12
Exelent guide, worked fine with an iphone 3G
2008/07/15, 21:29
Wow, thanks for this!
I’ve been searching for a way to get this to work since purchasing my new iphone 3g!
I love you!
2008/07/15, 22:55
Just want to update that I got this to work… but just no what I was thinking of doing in the first place =)
… which was to just different data from different iTunes. Basically just need to pick MUSIC/Ringtones as sync, Photos on another, etc. Thanks again.
2008/07/16, 03:26
works great!! thanks
2008/07/16, 11:58
Where is the Hex Editor located?
2008/07/18, 09:10
It seems to work successfully when following the instructions, I can move songs from my work PC to my iphone 3g, however if I attempt to play any song or track through itunes from my iphone, it crashes itunes. Anyone else having this problem?
2008/07/18, 10:30
Joey;
Can you help me out?
Where is the Hex editor located?
Is that something that you download to your computer?
2008/07/18, 15:41
Mac Hex Editor: http://hexedit.sourceforge.net
Windows Hex Editor: http://www.ultraedit.com
2008/07/18, 17:09
I am not able to find the Library Persistent ID in my .itl file.
I have an iphone 3G with iTunes 7.7.0.43 at home and at the office. I’m running windows XP SP3 at home and at the office.
1. I copied the Library Persistent ID from my .xml file on my home PC.
2a. I came into the office and replaced the Library Persistent ID on my office PC’s “iTunes Music Library.xml” with the ID from my home machine.
2b. I opened the “iTunes Library.itl” file from my office machine in XVi32.exe (a hex editor) and searched for the Library Persistent ID string (using the original string that was on my office PC) and it is not being found in the .itl file and therefore cannot be replaced.
Any ideas what I may be doing wrong or has something changed to prevent this in iTunes 7.7? Any suggestions what to try? Should I try having iTunes regenerate the itl file from the modified XML file only?
Thanks.
Don L.
2008/07/18, 18:00
Update. I just tried UltraEdit and it was able to make the change. It looks like the 16 characters in the XML and .ITL file are actually 8 characters on the right hand side in UltraEdit where XVI was treating them as 16 individual hex characters. Hopefully that makes sense.
So I made the change on my office PC and when I did a manual sync to my iphone it moved all the songs from my office PC’s itunes and overwrote the iphone. None of the songs on my iPhone moved over to the PC. Will try again at home tonight an see what happens.
2008/07/19, 13:18
Excellent step-by-step! Worked perfectly. The Hex Editor directions were slightly different, but nothing major. Great job
2008/07/19, 23:41
yah i have a question:
1. I synced my music and videos with my pc and i just currently bought a macbook, if i do this can i create a backup image/ synch it with my iphone and update without losing the data on my current iphone?
thanks and hoping for a quick reply
2008/07/21, 10:07
Update - Went home over the weekend and my iTtunes at home completely overwrote the iPhone. Back at the office today and in iTtunes on my work PC went to Edit-Preferences and the Syncing tab. I checked “Disable automatic syncing for all iPhones and iPods”. I connected my iphone and selected my iPhone. On the summary tab I unchecked “automatically sync when this iPhone is connected” and checked “Sync only checked songs and videos” and “Manually manage music and videos”.
Then I clicked on Music under my iPhone and indeed I can check and uncheck indivual tunes. I went back to the summary tab and clicked the sync button. It moved my music and applications from my iphone to my itunes. Cool!!
However, when I go to the music tab and check “Sync music” I still get the warning, “Are you sure you want to sync musc? All existing content…” So, I still cannot move music from my work iTunes to my iPhone. Any thoughts?
BTW, I also moved all the files out of my “Previous iTunes Libraries” folder in case that was causing a problem. But that does not help either.
Thanks.
2008/07/21, 10:20
Hi Don,
When you check “sync music” it will disable the “manually manage” setting and replace your manually manged songs with the contents from iTunes. That is what the warning refers to.
Also an unfortunate “feature” of iTunes/iPods/iPhone is that the manual-management setting is stored on the iPhone/iPod and NOT in iTunes.
This means you cannot have “automatic” management at home, and “manual” management at work. You either need to;
a) Have both iTunes set to Manual Management
b) Have both iTunes set to automatic management and use something like FolderShare to sync your libraries
I use option a) and keep a playlist of all the tracks at home I sync to my iPhone. This lets me just drag the playlist across whenever I add new songs to it.
2008/07/21, 17:29
Hey, thanks for that amazing tip.
I just want to let you know that thanks to you, me and my friend took it a step further by putting it into a program!
It was written in C++, but it only works as of now on a PC (XP/Vista).
Here’s the app:
2008/07/21, 17:34
Uh, it seams that the link didn’t appear on the post, here it is:
http://www.mediafire.com/?g0ntygbpw7m
2008/07/21, 18:27
Andrew,
Thanks for the clarification. Then it looks like everything is working as advertised!
2008/07/22, 11:33
Can you nake a mac version for this
Thanks
2008/07/22, 12:38
Modz619,
Unfortunately, I’m not able to make it for the mac yet, mainly because I don’t have a mac. But, if someone would like to program it for the mac, that would be great.
2008/07/23, 17:07
Why can you not simply replace the “iTunes Music Library” and “iTunes Music Library.xml” files with the ones from the first computer?
2008/07/23, 19:18
Angus,
I believe you can. But then you tun into replacing the library contents of computer two, with the library of the first computer. Since those files contain the library information, and maybe also the iTunes store information. Then you’ll have to re-import your music to the library and reconfigure iTunes to the way you want it.
Of course you may want to still do that if 1) the second iTunes was just installed, so there won’t be anything to lose and 2) you don’t care
Also, this way (by just replacing the ID), if you were at your friends house and want to copy some music to your iPhone, you won’t destroy his iTunes. You can even backup the two files beforehand and after adding the music to your iPhone, replace the files with the backup. This way, if he has an iPhone too, he will still be able to sync to his iTunes as before, and no harm done.
I hope this sufficiently answeres your question.