iTunes logo and iPhone 5sApple does not allow an iPhone to be synced with multiple iTunes libraries, presumably because users would simply share songs with each other and lower already declining music sales on the iTunes Store. When you sync an iPhone with another Mac or PC, a warning pops up on iTunes that an iPhone can only be synced with one library at a time.

If you proceed to sync your iPhone with the secondary computer, the contents of that iTunes library will automatically replace whatever media you had on your device in the first place. On a side note, that doesn’t include things like contacts, calendars or settings. Those are safe, but any songs or videos are not. Fortunately, there is a solution for how to use an iPhone with more than one iTunes library. The method is explained in detail ahead… 

iPhone library iTunes error

For reference, here is the exact error message that is displayed:

“The iPhone is synced with another iTunes library. Do you want to erase this iPhone and sync with this iTunes library? An iPhone can be synced with only one iTunes library at a time. Erasing and syncing replaces the contents of this iPhone with the contents of this iTunes library.”

How to sync an iPhone with iTunes on more than one computer

The way that Apple recognizes which iTunes library is linked to your iPhone, iPad or iPod touch is based on a Library Persistent ID key that is hidden on Mac and PC. By essentially copying and pasting this key between your primary and secondary computers, you can trick your iPhone into thinking it is syncing with the iTunes library it was originally paired with. Simply follow these step-by-step instructions for OS X:

Step 1 and 2: On the Mac that your iPhone normally syncs with, open a new Finder window and navigate to Go in the top menu bar. From the drop-down menu, click on Go To Folder.

Step 3: Type in ~/Music/iTunes into the text prompt that opens. Next, click on the Go button or simply press Enter.

Go to folder Music iTunes

 

Step 4: You should now see a list of files. It is highly recommended that you highlight each of these files and create duplicates to serve as backups. You technically only need to backup the .itdb, .itl and .xml files, including the Previous iTunes Libraries folder, but backing up everything is your safest bet. After selecting all of the files, hold down Command + C followed by Command + V to create copies. It is important to have a backup of each file just in case something were to go wrong.

save all files in iTunes folder

Step 5: Open iTunes Music Library.xml with TextEdit and write down or copy and paste the Library Persistent ID. This is a 16-character string. Make sure that you do not modify any other parts of this file.

library persistent string

Step 6: On the secondary Mac, repeat steps 1 to 4. Again, you technically only need to backup the .itdb, .itl and .xml files, including the Previous iTunes Libraries folder, but backing up everything doesn’t hurt.

Step 7: On the secondary Mac, make sure iTunes is closed. Then, delete all of the .itl files in the Previous iTunes Libraries folder. If this folder does not exist, skip this step.

Step 8: On the secondary Mac, open iTunes Music Library.xml with TextEdit and replace the Library Persistent ID with the string you obtained from the original computer in step five. Then save the file.

library persistent string

Step 9: On the secondary Mac, open iTunes Library.itl with TextEdit and delete the entire contents of the file. Then save the file.

delete itunes library itl

 

Step 10: Open iTunes. You should see the error saying”The files “iTunes Library.itl” does not appear to be a valid iTunes library file. iTunes has attempted to recover your iTunes library and renamed this file to “iTunes Library (Damaged)”.” Click OK and you should be able to sync your iPhone with the iTunes library on this secondary computer.

You should now be able to sync your iPhone with both iTunes libraries without any errors, and the existing media on your iPhone shouldn’t be erased after doing so. This how to was inspired by a tweet we received from iDownloadBlog reader Bobby Sammarco, and I encourage other readers to connect with us on Twitter if they have questions of their own. We just might write an article to answer your questions too.

Windows

  • Windows users can navigate to C:\Users\USERNAME\Music\iTunes instead and still follow virtually the same step-by-step instructions outlined above. Notepad can be used instead of TextEdit to edit the necessary XML files.

Notes

  • These step-by-step instructions have been tested and verified between two iTunes 11 libraries on separate MacBook Pros running OS X Mavericks. The process should work on older iTunes versions, but the use of HexEdit may be required. Even though the process was successful, your personal mileage may vary depending on various factors. It is important that you backup your files as outlined above to avoid any data loss or other problems.
  • iTunes will display an error when you first open it after following these steps: “The file ‘iTunes Library.itl’ does not appear to be a valid iTunes library file. iTunes has attempted to recover your iTunes library an renamed this file to ‘iTunes Library (Damaged)’. Nevertheless, you can persist through this error by simply clicking OK and your iPhone should work with the secondary iTunes library without any problems.
  • It is important to keep in mind that this workaround solution probably violates Apple’s End User License Agreement (EULA) or other terms and conditions. We are sharing this tutorial for informational purposes only and recommend that you follow these steps at your own risk. The warranty on your iPhone or Mac could be considered void if you are in violation of the EULA or other terms.
  • John Tremendol

    What about windows?! There should be a workaround for that too. However you can always transfer songs, videos and movies from any pc to iphone with softwares like itools, syncios or copytrans.

    • David Gitman

      indeed and iFunbox

      • McBobson

        Yes, iFunbox is really awesome.

      • Invisible

        Really?Have you heard of WALTR?
        It is much better than iFunbox
        it is easier and faster and it supports all the video&music formats
        Look it up

    • Framboogle

      Windows is for losers

      • John Tremendol

        You are not very smart, are you?

      • édith Dupont

        I’m sure he’s not , personly I prefer OS X but that’s not how you tell the world about that

      • edithouse

        he wouldn’t know the answer to that: Because, he’s not very smart 😉

      • Mozaik

        Can you come out of the cave now!!!

      • trumpet444

        I believe something like 90% of consumer market share is made up of Windows XP to 8.1. Every bank you walk into most likely uses a version of Windows. I guarantee that most of the world runs on some form of Windows. I myself prefer OSX but every now and then, especially for games, I boot into Windows 7 or 8.1

      • McBobson

        He’s trolling

      • I disagree with the facts and wish them away therefore he’s trolling is the best response I can think of.

      • DogeCoin

        It’s linux that most of the world runs on, IE servers, super computers, modems, routers. I duel boot between ubuntu and MacOSX

      • Leeve

        Pfftt…

      • ARX8

        lol Windows is for real geeks, noob

      • DogeCoin

        are you high?

      • ARX8

        Oh of course, how could I’ve forgotten

    • Ahmad

      It is as easy as navigating to this folder in Windows 8:

      C:UsersUSERNAMEMusiciTunes

      And the rest is the same. You can open xml file using Notepad

    • Joseph Duffy

      It’s VERY easy sync iOS devices with multiple windows machines. Way easier than demonstrated here. Here’s what you do: (1) copy the itunes folder, the entire folder on to a usb drive. (2) Install iTunes on the 2nd computer if not already. (3) Drag iTunes folder from first PC, to the same location on 2nd PC, and overwrite all files.

      This will erase the library on the 2nd machine, and make it match the first, so you should probably make a backup before attempting. Now the 2nd pc will sync with any devices the first PC can.

  • Modest

    Well done. Now even more Mac stuff please. 🙂

  • Rigs101

    Just use multitunes from big boss repo if you’re jailbroken

  • Joshua Thomas

    Oddly enough, I came into this problem last night and have been battling this ever since. Really would appreciate a Windows walk-thru on doing the same thing.

  • Framboogle

    Nice job iDB, probably one of the most useful articles you have ever posted!

  • Scope

    I make sure to use iTunes as little as possible. I think since I had my first iPhone I’ve used iTunes less than 10 times. I only dare use it when I need to jailbreak which is rarely ever.

    • Palmer Paul

      That’s really terrible advice. You should backup your device in iTunes weekly, so that you when you get stuck in a boot loop, you don’t lose all your “precious data”.

  • k4lsu

    Thanks for Tutorial guys! Really informative. I wonder if it would work on a windows machine? It would be nice to go to work and not have to hurry and click cancel every time iTunes tries to sync my phone.

    PS. It took me 4 tries to post this comment, I hate Disqus.

    • The only difference on Windows is C:UsersUSERNAMEMusiciTunes and using Notepad instead of TextEdit.

  • Awesome tutorial!

  • Inti

    Wallpaper on the MacBook. Give please. Thanks.

    • Palmer Paul

      It’s a stock Apple WP.

  • McBobson

    This is the best tutorial of the year.

  • McBobson

    What’s the Mac wallpaper please?

  • Bobby Sammarco

    Pretty cool that a question I had became a post. Unfortunately though, I no longer have my original Macbook Pro that I first synced my iPhone and iPad with. Am I out of luck?

    • McBobson

      You can use iFunbox as an alternative to iTunes. Also, some people use iTools, syncios or copytrans as an alternative to iTunes.

  • onebyone_

    use iTools
    solved.

  • McBobson

    “Step 4: You should now see a list of files. It is highly recommended that you highlight each of these files and create duplicates to serve as backups. You technically only need to backup the .itdb, .itl and .xml files, including the Previous iTunes Libraries folder, but backing up everything is your safest best.”

    I think you mean safest bet.

  • Nicholas Oldroyd

    There is a WAY easier way to do this…

    Just hold SHIFT or FUNCTION on Windows or Mac while opening iTunes…

    Then you can choose the correct library for the device you want to sync or create a new one to sync a new device.

    Or use a third party iOS syncing program like CopyTrans Manager which is free and lets you add and delete every media type on an iOS device.

  • McBobson

    It worked! Yes yes yeah! Thanks so much for this tutorial.

  • Sicheng Xu

    Well, apparently you’ve got 2 Macs, how about share musics via airdrop?

  • Vitaliy Anonymous

    This is important! Keep in mind, this will reset your “Date Added” field to the current date….unless Apple fixes that issue.

  • Freddy

    Jail break help iPhone 5c 7.1.1 version

  • Cyberlunacy

    doesnt work for me keeps saying it has to wipe all the music on my ipone 5s w/ JB’d 7.1.1
    OSX Mavericks, latest itunes as of 7/17/14

  • dklimke

    This is the same method I have used for years successfully but now as soon as I plug in my iPhone5 the 16char code is resetting to what was there to start with? Suggestions?

  • csbnet

    i have been syncing with two computers. One for podcasts and one for music. never a problem until OS8. Now when I sync the podcasts, it erases all the music

  • Adri

    Okay here’s something that happened/worked for me out of frustration, before I found this tutorial. You might have too much music to do this with. All the music in one library was in the cloud, so I downloaded the songs that I wanted onto my phone one by one from that. Then, when I synced my phone to the second library, voilá, they were all there.

  • Mark B. Fleury

    A quick thanks for this article. I really wish Apple would make it simpler to sync to multiple computers. If you have any questions on iTunes you can contact 4saleUSA Our consultants will answer all questions 7 days/week.

  • Darek Dochnal

    watch movies on vudu app buying 60% off vudu movie credits from netstrada USA reseller today online instantly.

  • A A

    creating secondary library on a second computer is equivalent to erasing the existing content of the iPhone and syncing with the new iTunes library. How about tweaking the same iTunes library without involving the second computer? And the previous method doesn’t work either. Thus far there’s no way around erasing the iPhone content and syncing with the new iTunes library. No matter whats you do, as soon as you check the “manually manage music and videos” it obliges you to erase the content of the iPhone.

  • Gosia

    Thank you! You have saved my life!

  • Nagy János

    Dear Joe,

    Thank you for this guidelines! I try to apply your workaround in this situation:

    1) I have two computers with Windows 7 and Windows 8

    2) I have the iTunes folder on a removable hard drive witch maps with the same letter (X) on both computers

    This means that I have only one Library Persistent ID key and only one upset of those files that you want to move around. Despite that, I cant sync content from both computers to my iDevices, iTunes can distinquies between the two computers anyway and do not recognizes the very same folder on both computers as identical. That must mean that it is some other identification involved too about this iTunes folder.
    Could you, please reflect over this situation. One iTunes folder, but two computers and iTunes on the second computer sees the folder on a different way than iTunes on the first one. What to do to that misery?

  • mayjohnson

    The easiest way to do this is to copy your old iTunes folder (usually located in Music/iTunes or My Music/iTunes) – depending on which version of which operating system you are sing and replace your new iTunes folder which will be in the same location on your new laptop with the older one.
    If it is not convenient way for you, try software solution, download FonePaw iOS Transfer to sync iPhone to another iTunes or computer.
    That usually solves my problems.

  • Inna Zueva

    That’s probably why I don’t like iTunes with its library and everything else!.. I’m using WALTR, it’s great! It uploads any music to a native iphone library (I mean Music app) without all this converting or syncing things and plays it directly from there. It’s just super easy, The best for those who don’t want to waste time or look into complicated apps like me:) P.s. works for both Win&Mac

  • ADeel Khan

    Cant find iTunes Music Library.xml in either windows and mac … this file seems doesnt exist in new versions of itunes. Any idea what to do now?

    • Sie Nicht

      You can actually make iTunes Music Library.xml by going into iTunes, Preferences, Advanced, and Share iTunes Library XML with other applications, and the rest of the directions follows as described. I just did it with the latest iTunes, and it works perfectly!

      Good luck!

      • ADeel Khan

        Thanks, i got the xml file using your suggestion, but still when i try to sync with the new machine, it is giving me same error to ERASE all contents. 🙁 Dont know what i m missing …

  • Frances Alexandria Kavanagh

    This is amazing thank you – it worked!!! I deleted some of my iTunes library when I backed up to an external hardrive and wanted to free up some space on my computer, and this has fixed it!