My Macbook Pro hard-drive failed recently. It was only about a year and a half old and it just went down without warning. No slowing of the system, no problems, no crashes. It just died suddenly.
Anyway, I had Apple Care so I got it fixed for free with a shiny new HD. However, I lost all my settings including the data relating to my iPhone to iTunes sync. I spent the last 3 months trying to get my iPhone and the new HD to talk to each other. But every single thing I tried didn’t stop me getting the unbelievably irritating message:
But my persistence has finally paid off and I have actually successfully synced my iPhone to my new HD. And, I have of course beaten (and beaten deep into the ground) the stupid stupid annoying irritating erase and sync message. This fills me with a sense of pride and accomplishment.
While I was trying and failing to fix the problem I read many many different solutions and also many different ideas about which software to use and so on. I also read countless times that it was not fixable and that I had to erase my iPhone. Or that I had to jailbreak it. In any case I did not find one clear cohesive step by step to solving this problem.
So I would like to share my solution in the hope that it will help other people get themselves out of this ridiculous situation. This is my own complete and extremely detailed step by step guide to syncing an iPhone with a second/new Mac without losing/deleting/erasing any data.
This solution does not require jailbreaking or anything of that nature, nor does it require you to erase anything from your iPhone.
And yes, this is EXACTLY what I did to get my iPhone to sync with my new HD and iTunes.
I would just like to mention that I am using Snow Leopard with iTunes 10.7 (I downgraded from horrible iTunes 11 – if you want to downgrade read my post here).
This guide does not require jailbreaking or anything of that nature, nor does it require you to erase anything from your iPhone.
Also, I have not used any programs you have to pay for.
This guide uses only freeware or shareware.
And finally, I would also like to link these two sites as the most helpful of the plethora of web information I looked at. Thank you for your help.
A little background reading on why your Apple device won’t sync with multiple computers…
The reason you cannot sync to multiple computers is because Apple creates a special ID called a Library Persistent ID, which is unique to your iPhone and the first iTunes you sync with. Every time you try to sync with a different Mac, your Apple device checks to see if it has a matching ID, and if not refuses to sync without erasing.
Now this is all very well in terms of piracy and so on, but in legitimate cases like mine, where I was not the one at fault (yes, it was all your fault Apple, even the people at the Apple Store agreed that it was nothing that I had done and purely a mechanical faliure!), it is extremely unfair that I should have to erase my iPhone (and yes, if you choose to erase it will remove anything you personally have added to the phone – contacts, photos, music, apps, videos, pics, everything!) just because I have a new HD (legitimately provided by Apple) and a new iTunes (also from Apple).
Anyway, what it boils down to, in essence, is that you need to acquire the original Library Persistent ID, which is written in your iPhone, and force your new iTunes to accept that original ID instead of the new ID it came with.
Step 0: Before we start…
Before starting it is best to be prepared for all possible eventualities.
Therefore, I recommend you back up your iTunes folder, which I usually do by making a copy of the iTunes folder on my desktop. The iTunes folder is located in your Music folder:
User > Music > iTunes
Ensure that iTunes is NOT set to sync devices automatically.
To do this go to the iTunes Preferences and under the Devices tab tick the box that says:
Prevent iPods, iPhones and iPads syncing automatically
Make sure you do this BEFORE you connect your phone.
What you will need…
1.) iTunes. I don’t know if the version of iTunes you are running will make a difference, but I am running 10.7.
2.) UltraEdit. This is software which will allow you to read and edit the iTunes Music Library.xml file (more on this later).
You can download UltraEdit here.
3.) Your iPhone and its USB cable, and of course your Mac.
I have received a comment that this also works for Windows 7, so this method may also work for other Windows users.
4.) Access to this site (mentioned above):
Step 1. Back up
We need to create an iPhone backup in order to acquire your Library Persistent ID. This also means that if something goes wrong you will at least have a partial backup to restore from. It’s a real relief that it’s possible to backup some things on your device without syncing.
If you want to do a backup of your photos just in case see my post on some ways to do this.
1.) Start iTunes.
2.) Connect your iPhone so that it shows up in the lefthand column under Devices. (This is in iTunes 10.7. I am not sure if this is the same in other versions.)
3.) Click on your iPhone.
4.) Under the Summary tab scroll down to Backup and click the option
Back up to this computer
You need to back up to your computer and NOT to iCloud or anywhere else. Ensure that you DO NOT click “Encrypt local backup” as this defeats the object.
5.) Right click on your iPhone (where it is listed under Devices on the lefthand side). This will bring up the menu.
6.) Choose the “Back up” option.
This may take a little while depending on what you have on your iPhone.
You can also backup your Apps by right clicking on your device and choosing:
Transfer Purchases from “—————-’s iPhone”
You will have to verify this using your Apple ID password which is the same one as you use to buy things in the App Store.
Depending what you have this may take time and also space on your computer.
When you have finished backing up, close iTunes and make sure iTunes doesn’t continue to run in the background. You should also disconnect your iPhone just in case.
Step 2. Locate your files
There are several files you will need for the next few steps. Firstly:
❊ iTunes Music Library.xml
❊ iTunes Library.itl
These are both located in your iTunes folder which is, as mentioned earlier,
Users > “Your Home Directory” > Music > iTunes
This is a file which is created during your backup. To find it go to:
Users > “Your Home Directory” > Library > Application Support > MobileSync > Backup
In the Backup folder you will find another folder which has an unintelligible jumble of letters and numbers for a name. Inside this folder you will find the Info.plist file.
Step 3. Acquire your Library Persistent ID
If you are a code whizz it is probably possible to find the ID yourself. However, for the rest of us mere mortals the best way to do it is to get help from this site (which I mentioned earlier).
Just locate and upload your Info.plist file and in return you get your Library Persistent ID (a string of 16 jumbled letters and numbers).
It is as easy at that.
Make a note of your ID (I advise copying and pasting it into a text document for ease of use) for the next step.
Step 4. Edit your iTunes Music Library.xml file
★★Ensure that iTunes is not running in the background★★
1.) Install UltraEdit. (Double click the downloaded dmg file and drag the icon into your Applications folder.)
2.) Start UltraEdit and close the popup window asking if you want to buy UltraEdit (unless you want to buy it. Apparently it is a very good program for code editing and such.)
3.) In UltraEdit, open the iTunes Music Library.xml file we located earlier.
4.) Locate the line which says:
<key>Library Persistent ID</key><string>****************</string>
This 16 letter and number jumble is your current Library Persistent ID.
5.) Delete this current ID, then copy and paste in your original Library Persistent ID which you just acquired from your Info.plist file.
6.) Save your edited iTunes Music Library.xml file and close UltraEdit.
Step 5. Tricking iTunes into accepting your original ID
All the changes are now in place.
However, if we leave the current iTunes Library.itl file in the iTunes folder, iTunes will look at the itl file and override what we’ve done, changing the ID back to the new one.
iTunes must think that the iTunes Library.itl file has been damaged or corrupted before it will accept the changes we made to the iTunes Music Library.xml file.
So to complete the process…
1.) Open TextEdit (or any text editor of your choice).
2.) Save the blank text file as a Rich Text File called “iTunes Library”. Save this to your Desktop.
3.) Rename the file “iTunes Library.itl”.
It will ask you:
Are you sure you want to change the extension from “.rtf” to “.itl”?
Click use .itl.
4.) Open your iTunes folder and rename your current iTunes Library.itl file to something different and move it somewhere safe. I renamed my current file “iTunes Library.itl.my backup” and moved it to my Album Artwork folder, as I wanted the original file to be easy to restore if the process didn’t work.
5.) Once you have removed the current iTunes Library.itl file, drag the blank iTunes Library.itl file you just created into your iTunes folder.
Step 6. And Finally…
All the changes are now complete.
★★At this point I urge you again to make sure your iPhone is not connected and that you have made various backups as I advised before starting.
I did not have any problems with data loss when I did this but it is always good to be safe.★★
1.) Start iTunes.
iTunes will look at the blank iTunes Library.itl file (that we created previously) and think it is corrupt.
Because it thinks the file is corrupt, iTunes will then try to recreate your library data using the iTunes Music Library.xml file we modified.
If you have a very large library this will take a very long time.
Mine is about 15 GB and took about 10-15 minutes but then I don’t really have any album art work or videos and other non music files. It probably also depends how much information you have about each track (artists, albums, ratings etc.) and of course how fast your computer is.
Just leave it to do its own thing, go have a beverage of your choice, and come back when it has finished.
You should find that your iTunes looks exactly the same as before (at least mine did).
★★At this point, to avoid accidents, check that the automatic sync option is still disabled in the iTunes Preferences★★
2.) Now connect your iPhone.
All the steps are now complete and you should be able to sync your iPhone (or iPod or whatever iDevice it is) with iTunes.
Phew! What a long process. But that’s it!
I hope this works for you.
A few extra notes you may find useful…
NOTE 1. Testing the sync…
I think the safest thing to do (once you have completed all the steps above) is to test the iPhone sync by trying to sync something you can restore easily.
For example, I only have a few non Apple tones in my iPhone so I synced the Tones to check it was working.
I only had one problem, which was with an app which said it could not be synced and asked if I wanted to remove it and sync. So I just said yes because it was a free app anyway and I figured one app was a small price to pay for fully functioning iPhone to Mac sync.
NOTE 2. Purchased items…
You may also get this message:
But I just click Transfer every time and everything seems to work out just fine.
NOTE 3. A quick word about my Contact sync…
The first thing I did when I finally got my iPhone to sync properly with my Mac was to sync all my Contacts back to my Mac.
Now I am not 100% sure if this has anything to do with it but I created a fake contact in my Mac Address Book (because it was empty) and my sync went absolutely perfectly. The fake contact is now in my iPhone and all my iPhone contacts are backed up to my Mac.
I imagine that you do not actually need to do this, but if anyone has problems this worked perfectly for me.
EXTRA NOTE REGARDING WINDOWS.
I think this should work for Windows as well but I cannot test it as I do not have a functioning Windows system that will support iTunes 10. The locations will be different of course but the fundamental principle should be the same.
★★ Update ★★
As mentioned above, I have confirmation that this method does indeed work in Windows 7. Thanks go out to the anonymous commentor who confirmed this! Much obliged o(^∇^)o
★★ Update ★★
I have received a comment saying that this method works for the newest OS X (currently Yosemite), the newest iTunes (currently 12) and also for the iPhone 6. Many thanks to filzer for the useful info!