Extracting iPhone Backup Data with mobilesync-inspect
I wrote a command line tool called mobilesync-inspect that can list, extract, replace and backup your iPhone/iPod Touch (hereafter I use iPhone to represent both devices) backup data.
To download the prebuilt binaries for Mac OS X and Windows, use this link.
It is well understood now that iTunes backs up the application data on your iPhone in one of your user directories. It is not yet well understood exactly how iTunes makes use of such data, and why the backup/restore process is so slow.
What mobilesync-inspect differs from other similar tools, say, from iphone-backup-decoder, is that it’s duo-platform. I have prebuilt both Mac OS X and Windows versions, in the hope that it helps Windows iPhone users out there. Although iphone-backup-decoder is written in Python, installing Python on Windows and run the script is not trivial matter for the less technically savvy (or people who are busy).
Of course there’s still a hoop to jump: mobilesync-inspect on Windows requires some DLLs from Safari for Windows. But once you have Safari installed, it’s really just four files to copy, and you’re all set. Plus mobilesync-inspect provides more than backing up backup data.
We have heard a lot about app data loss after App Store upgrades. It’s disheartening for me to learn that iTunes did not make versioned backups. If your app is zapped during the upgrade process (this mostly happens if your Internet connection is not stable between the different upgrade stages) and you inadvertently sync your iPhone with iTunes, iTunes will faithfully zap your app along with your app data. It’s quite scary if the app in question is about personal finance data (like what my app is about), to-do lists or password reminders.
One last note: mobilesync-inspect is open source. I probably won’t have too much time taking care of this side project apart from my daily work. I hope that other developers will be interested enough in making use of it to, for example, build a GUI tool for inspecting and manipulating the backup data. For those interested how and why its Windows version requires Safari, the answer is short: to be able to do cross-platform, mobilesync-inspect is written in C++ and makes use of Apple’s own CoreFoundation library to do the mdbackup data I/O (itself in Apple’s own property list format). Frankly I think Apple should put CF for Windows in circulation (currently it’s quite restrictive, tied to WebKit), because it’s a well-designed general-purpose library (think of glib with Apple flavor) and makes cross-platform dev experience far better on Windows.
Also: lukhnos :: Aug.06.2008 :: tekhnologia :: 19 Comments »
This tool really saved me. iTunes wouldn’t accept the backup I wanted to restore from but with this tool I was able to find my data! Thank you so much!
I have been able to extract sms.db and look at the contents, which is great, but I can’t get my phone to replace it’s current sms.db file with this one. I have:
1) replaced the relevant .mdbackup file in the real location with the one I found with mobilesync-inspect, hoping that it would take it.
2) I restore from that backup
But the SMS’s on the phone don’t include all of the ones from the .mdbackup file I placed in the backup. Any idea how to get it to take it?
Hi Daniel,
I’m not sure if I understand when you said “the SMS’s on the phone don’t include all of the ones from the .mdbackup file I placed in the backup”, mind giving an example of how you expected it to work? Thanks.
You’re right that was unclear. This is what I have:
In the MobileSync/Backup folder I have a valid backup that I just made, but it is missing all of my text messages and notes since June. On my desktop I have made a copy of a backup from yesterday with all of the data that I want, however iTunes tells me that it is corrupt and will not use it.
Using your tool I have identified the .mdbackup file that contains the sms.db with all my text messages.
I have replaced that single .mdbackup file in MobileSync/Backup with the one from my Desktop with all of the data that I want. But when I then go to iTunes and choose to restore my phone from a backup, the text messages on the phone remain unchanged. The SMS database that I moved over appears valid. Any idea how to get the phone to use it?
geez, u saved my life..
according to itunes i had a bad backup, so all my notes were gone, but now..::)
thankyou
Hi.
Just tried to recover my adressbook with it.
I ve got an error message :
My command :
C:\mi>mobilesync-inspect extract adb8c77534444e97c31ff15924d50f3e
up c:\
Result :
MobileSync backup directory at: C:\Documents and Settings\user\A
\Apple Computer\MobileSync\Backup
cannot open: C:\Documents and Settings\user\Application Data\App
ileSync\Backup\adb8c77534444e97c31ff15924d50f3ed1fbd3b1.mdbackup
What does it means ?
Thanks
Hi Doug,
If mobilesync-inspect says that, chances are that it’s a file that the program can’t open, for reasons unknown. I run into some of them in my backup directory. I wonder if it means they are corrupt (i.e. not even readable by Apple’s own plist tools) at all.
Daniel,
I haven’t been able to try out restoring sms database as of writing this, hopefully I’ll be able to try it out myself. Meanwhile, have you tried other forums (such as Apple’s own support forum) to raise the awareness of such issue? Might be helpful to many people with similar needs. Thanks!
This tool is great… I wonder if it can preserve the timestamp of the files extracted? I recovered some photos but now they aren’t in order.
Doug - I ran into a similar issue, for me mobilesync-inspect needed the big long folder name that the files are actually in in front of the mdbackup filename, so the syntax was:
mobilesync-inspect extract biglongfoldername\biglongfilename.mdbackup
That said, I’m still having an issue, when I perform an extraction, it tells me it is extracting the files, but they do not appear where I thought I was telling it to put them. So when I do:
mobilesync-inspect extract biglongfoldername\biglong filename.mdbackup c:\test
I don’t get any errors, but I don’t get my sms.db, or anything else for that matter in c:\test. Am I missing something?
Hi Matt,
If you have space in any of the file name (source or destination), try putting double quotes around the name(s)–sorry I didn’t make this clear. Also, when using the extract command, the destination must be a file name, not just a directory (that’s for the backup command instead).
Hope this works.
Lukhnos, it was the lack of target file for a destination that was getting me, thanks for the assistance, awesome utility.
i copied 4 files .DLL in safari to same folder mobilesync-inspect.exe,then double click file mobilesync-inspect.exe but nothing happened so how can i run it.Thanks,i lost my addressbook,Itunes cant be restored due to backup file’s corruption . i want have it(the addressbook).Help me please with a full instruction as im not really good with computers . im using vista home premium.
Hi Dung,
mobilesync-inspect is a command line utility, which means you’ll have to run it under CMD.EXE (the command-line prompt).
THANK YOU VERY……….MUCH……………MUCK.I HAVE MY ADDRESSBOOK.THANKS LUKHNOS,MATT AND EVERYONE
hi guys,
sorry this is all new to me. have the program running however I can’t seem to get the right commands to find and extract sms.db, my notes and calender. I would be very grateful if someone could put up some example commands in order to find sms
thanks
Hey,
I just found this site and program and would also like to note what the exact commands I would need to enter in order to extract my sms.db and put it into a current backup.
Thanks,
Mike
Hi I recently tried using mobilesync-inspect but I ran into the same problem as Dung which was the program not doing anything.
I have the mobilesync folder on my desktop and inside it I have the four dll’s however when I open it it opens loads up the text and then closes all in like 3 seconds.
It does open and it looks like cmd (command-line black screen) which is how im guessing is how its supposed to look. Im really pretty dense when it comes to this whole command line, plutil, python thing as I have never used any of it.
I could really use some help as I need to recover my contacts from one of these mdbackup files.
ok scartch that I got it to work i finally understood sort of.
Ok well I used the list command and put one of the names that used to be in my contacts book. However hear I ran into another wall two to be exact.
Ok so I use list and two things happen it either list the directory of the backup folder and does nothing or
it tries searching for the name I put in and tries opening up all the
backup files and it says cannot open to all of them.
Any help guys?
Thank you so much for your tool… it allowed me to save my contacts that got corrupted!
So, I recently had a hard drive crash, so after reinstalling windows on a new hard drive and getting iTunes reinstalled, it tells me I’m already sync’d with another computer, and I need to erase all the data, sync with the new one, yadda yadda. Well, I have a few apps that aren’t on the appstore anymore (Tris, the tetris clone for instance) and I don’t want to lose them. Fortunatly, I was able to update to the 2.2 firmware without syncing, and doing that made a backup.
I’ve pulled all the backup data out using the backup command, but its unusable since the apps are no longer in their compressed format. Is there any way for me to compress all the app data back into an app, so that I can put it back on my iPhone after I sync to my “new computer”?