Access iPhone Backup, recover files from iPhone backup

output from python fileIt was bound to happen sooner or later. I took a photo with my phone and used the image as the wallpaper for when the phone is locked. However, I completely overlooked this when I deleted the original image from the camera roll. This meant I had an image in place but no way of accessing it, and I quite liked the image!

It turns out that when you connect your iPhone to your Mac and iTunes starts, it runs a backup and places some files in your ‘~Library/Applications Support/MobileSync/Backup folder. The problem is that they are SQLLite files and not easily readable in any simple way. This is where I turn to the Apple community, particularly the discussions, and ask for help. Here is the post I made.

I was so pleased with the response – almost immediate and ultimately one of the most helpful. It appears there is a Python script able to open those files and restore the folder structure from the innards of your phone. The thread answers the questions most folk will have, but I thought I’d post here too.

What you need to do is copy the backup folder and all it’s contents to an easily accessible place – I chose a new folder on my desktop. Copy the Python script into the same folder. You then need to change the permissions on that script to ensure that it is executable. You should do this through the terminal, which means you’ll probably need to use ‘sudo’ and ‘chown’ to set the values correctly. Once you have done this you can run the script. You do this by typing ‘sudo’, then the complete path to the script, a forward slash, then the complete path to the folder (you can simply drag the items into the terminal window to do this and the paths will be filled in automatically for you). Finish with a forward slash and then ‘*.mdbackup’.

What this will do is reconstruct the entire iPhone folder structure inside the place you have got the python script and backup folder. Once done you can then set the permissions for the resulting foder and copy to all items inside… you can then access and manipulate the files.

This was, in fact, ludicrously easy – I had help from a former colleague who is something of a star with this stuff, but if you know a few basic commands in the terminal you should be OK.

I’ve also uploaded the Python script for you all to download from here in case it goes offline elsewhere. The original is HERE. The one I used (and changed ownership on) is HERE.

61 thoughts on “Access iPhone Backup, recover files from iPhone backup

  • 21 January, 2011 at 4:19 am
    Permalink

    I accidentally overwrote my backup file for my iphone 4. (on mac) I got the file back off my time machine back up and placed it on my desktop. I have a backup file from the application support/mobilebackup/backups (it says it has about 3,000 files inside of it that are all named with about 20 random characters) When I try to restore my iphone by choosing a file manually, it won’t let me chose it. How do I use this back up file off my desktop?

  • 26 March, 2011 at 1:12 am
    Permalink

    Wow… maybe someone can point me in the right direction. Somehow my I-Touch got into trouble and Apple support said my only recourse was to RESTORE the unit. DAMN..!! This would ‘wipe’ it clean, erasing all the pictures/videos I just took while on vacation.!!

    Subsequently, despite Apple supports lack of help… I’ve located the ‘backup’ files..!! The files have long seemingly arbitrary names, and in WINXP don’t show any file “extensions”. I can open some of the files using QuickTime… some not… they may be ‘info’ files related to the Itouch or something.

    My question…. Is there some way for me to access these files directly from QuickTime or another viewer for printing or converting..??? I’d like to convert them or save them in some form that is more easily identifiable… and of course I’d like to edit/crop/fix/print them in an editor.

    Thanks for any help…!!!

  • 13 April, 2011 at 10:50 am
    Permalink

    Hi Gt ski – the only way to get those files out of the folders with long and arbitrary names is to use a method like that described in the post. The files are database files and need to be decrypted… or you need to go through them one by one, opening every sub folder.

    Needless to say there are a number of commercial tools that are now available since the post was written which can help get to your content – some are referenced in the comments above. I no longer use the Python scripts above, and tend to back up my phone on a Mac using ‘Phone View’. Not sure if there is a similar app for Windows though… sorry!

  • 19 August, 2011 at 5:54 am
    Permalink

    Hi,

    I need to know to to do this but on a pc. I updated my iPhone 4 to te 4.3.5 version and at the end it said that there was an error and needed to restore. I hit ok. The thing restored and reinstalled and it seemed like everything worked fine. However, when I saw my iphone all my stuff was gone. I had only previously synced my songs and ringtones. I did not synced the rest of the stuff. I did the restore again from a back up on my pc, but the things were not there, I tried again and same. The only backups that are available to me on the iTunes do not hold any of my contacts or notes. The things that I want to get back the most are my contacts and my notes. I have done some research on the internet and was able to locate the one backup on the files in another folder on at C:\Documents and Settings\abi\Application Data\Apple Computer\MobileSync\Backup. I want to try this file to see if it has all my contacts and stuff!! But how do I make it so that it shows on itunes as one of the ones I can restore from? or is there any other way to do it?!?!?
    All your help is highly appreciated!!
    -Sofia-

  • 27 August, 2011 at 5:14 pm
    Permalink

    Hey, i’ve lost all my data on the iPhone 4 but i’ve the backup fodlers i’m using windows not Mac. so is there anyway to restore my pics on the camera Roll ? your help will be much appreciated.

  • 27 August, 2011 at 5:17 pm
    Permalink

    Sofia i got the same issue while updating to 4.3.5 but i got back only my contacts as they were stored on Outlook, but i lost my notes, Messages and all the pics on my Camera Roll, please if you found out anything let me know and your help will be much appreciated.

    BR,
    Mohamed Allam

  • 28 August, 2011 at 10:07 pm
    Permalink

    Sofia, Mohamed – I am not sure how best to advise you both. I would think the scripts posted above could be used on a PC as long as Python can run. This is not a simple task, and would really need someone who knows what they are doing with this stuff… it isn’t like a commercial application… this is geeky and nerdy and works through all kinds of different levels. If that’s you, then great! However, from what you’ve both posted I would guess it isn’t…

  • 14 September, 2011 at 5:19 pm
    Permalink

    See the following site: http://modmyi.com/forums/general-iphone-chat/370201-extract-photos-iphone-backup-files.html. Read Mitch42 on 5-1-2011. It definitely works for picture files (jpg). I sorted, changed all to jpg and then opened each. If they open as my picture I moved them out. I then renamed everything left to .mov. The videos that were videos would then play. Key: copy the back up folder to a new folder first. Also, if you don’t see the folders noted in the post, you may have to choose the option to show hidden folders. Search google to find out how. Still trying to determine how to deal with contacts and notes, but this worked for pics and videos.

  • 25 September, 2011 at 7:42 pm
    Permalink

    Here’s one to stretch your brains..
    I was adding a new contact in my Add feild (phone # and name) portion of my iphone 4 but was unable to complete the task. I had added a phone number and name and left this window open for half an hour. When I came back to it I accidentally pushed Cancel (my eyes are bad) I instantly realized y mistake but the name and phone number is gone. Is it possible that it was backed up automatically and I can recover this information?

  • 3 October, 2011 at 11:30 am
    Permalink

    Great! The forum entry mentioned by JG (14 September, 2011 at 5:19 pm) works really well albeit a quick and dirty approach. Thanks!

  • 17 November, 2011 at 10:34 am
    Permalink

    I have lost my pics and I see back up folder on my computer but unable to restore or convert back to pictures. I also tried as per ‘JAY”‘s link but dones’t work. PLS HELP as I need my pics back

Leave a Reply

Your email address will not be published. Required fields are marked *

* Copy This Password *

* Type Or Paste Password Here *

13 − 9 =