Wednesday, October 6, 2010

Viewing Deleted Messages in Your iPhone Backup

Update: Decipher TextMessage can read some deleted texts out of the backup for you. We hope you'll give it a try! http://deciphertools.com  We also have a video about using Decipher TextMessage for recovery on YouTube.

Another Update (2014-12-15): Many things have changed in the database structure of the messages over the years since I wrote this. We have many new tips about deleted message recovery on our newer blog http://deciphertools.com/blog/2014_06_30_guide_to_recover_deleted_text_messages/

Many people who purchase Decipher TextMessage write us asking about the ability to recover deleted messages.  When we say "deleted messages" here, we mean messages that were received and deleted between backups, so that there is no record of the message in a backup.  If you have backed-up your device prior to when the text was deleted, you can use Decipher TextMessage to read the texts in that backup to recover it.  But, the iTunes backup schedule doesn't always nicely coincide with the schedule of our accidents, our fits, or children playing with our phone.  When we get those emails, it tugs at our hearts because we know that you wouldn't be writing if that text wasn't important, and it feels awful having lost it possibly forever.
We're working on adding the ability to read as many deleted messages as we can from the backups, but in the meantime, we wanted to explain why some of your deleted texts may not be totally gone, and how you can go and look for them by hand.
We're going to walk through the steps assuming that you're on a Mac, but the general idea applies on Windows as well.  Also, folks using Windows can check out this very nice walk-though here.

Why your deleted texts may still be around

The iPhone OS stores your texts in a database system called sqlite.  This is relevant because of the way that sqlite handles deleting entries in the database.  When you delete an entry (aka a text), rather than totally obliterating the entry in the database, the entry is just marked as no longer in use, and will be reused later.  There is a chance that the entry for the text you're wishing to see has been recovered and used for a newer text, in which case the text is indeed gone forever.

Looking at all of the messages, including the "deleted" ones

Until we have Decipher TextMessage read those entries waiting to be reused, to look at your deleted messages, you'll have to take a look at the sqllite file by hand.  It's not pretty, but if you know what you're looking for it's doable.  If you haven't already made a backup since the message was created and subsequently deleted, you will need to do so now.  You can force a backup in iTunes by right-clicking on your device under Devices on the left-hand side of iTunes and then selecting "Back Up".
Open Finder and navigate to Home (your username) -> Library -> Application Support -> MobileSync -> Backup.  Within that folder, you will see one or more folders; each one is a backup of a iOS device (iPhone, iPod Touch, iPad).  The awful names are identifiers that iTunes uses to know which device is which, so that it can overwrite the correct backup when it makes a new update of a device.  If you're unsure which folder is for the device that you need to examine, you can use trial and error with the steps below, or if you have Decipher TextMessage 1.5 the folder names are listed in the information window showing which backups were loaded. 

Now that you've found the folder click on the folder to show the files within it.  You'll see more awful file names, either ending in .mddata, .mdinfo, or .mdbackup if you're running iOS 3.1.x (or lower) or ending with nothing if you're running iOS 4.0 (or higher).
The file of interest to us is "3d0d7e5fb2ce288813306e4d4636395e047a3d28" (or "3d0d7e5fb2ce288813306e4d4636395e047a3d28.mddata" or "3d0d7e5fb2ce288813306e4d4636395e047a3d28.mdbackup").  You can find this file in the list by looking through the list (you can alphabetize this list by going to View -> Show View Options and setting the sort order to alphabetical), or by typing in "3d0d" into spotlight in the upper right corner of your finder window.  If you use spotlight, be sure to select to search within just this folder, and by file name.
This file contains the sqllite database for your sms messages.  Right-click on the file and select Open With -> TextEdit.  If TextEdit is not an option yet, select Open With -> Other... and then find TextEdit within the Applications folder.
The top of the file will look like a pile of gibberish, the gibberish is a bunch of sqllite commands about the database table.  If you scroll down a bit, you'll start to see garbage mixed in with the contents of your text messages.  If you squint your eyes a bit and look some more, you'll also see that the phone number for the other party is listed along with the message text (and more sqllite "garbage" of course).
From here, you'll have to explore the file and see what you can find.  Techniques that we find helpful are to search (with command + f) for text that we think was in the message or to search for the other party's phone number, hitting next to jump through all occurrences of it in the file.  It's not glamourous work, but when the deleted message is important, it's worth it!

39 comments:

  1. what if i cant fond anything that starts with mobile on the apllications support folder?

    ReplyDelete
  2. I cannot see mobile sync either after application support. I am using a mac. I am using IOS 5 and the latest iTunes.

    ReplyDelete
  3. dells11 make sure you are looking in "users/yourusername/library/"
    it won't be in /macintosh HD/library
    you may need to use the "Go" command in finder.

    ReplyDelete
  4. Thanks Lucas. . I'm still struggling as i can't find a text that i deleted 2 days ago. It doesn't appear in the text edit fashion or in the recovered message.
    I even deleted another message to see if thats "recovered" but its not. Anything i can do to my phone or settings to make these texts appear.
    Thanks in advance.

    ReplyDelete
  5. He dells11

    Unfortunately, if you're not seeing the message when editing that 3d0d7... file, it's not there to be recovered, and there isn't much to try beyond that. Are there any other backup folders within your MobileSync/Backup folder to check in?

    ReplyDelete
  6. I just ran two separate tests with the same result.

    I sent myself a text that read "edit to delete" and one that said "swipe to delete" - I then deleted one by pressing edit then delete, and the other by swiping over the conversation then delete.

    Made a new back up.

    The "swiped to delete" texts do not appear within the program or by manually searching the file.

    The "edit to delete" texts appear within both.

    Repeated the process again with same results.

    Your thoughts?

    ReplyDelete
  7. Hi Brandon,

    That is interesting, especially since I would guess that the SMS app uses similar code for both cases. The magic is in whether or not the database file leaves any remnants lying around in the spare space.

    I wonder if we reverse the order if we get different results :)

    ReplyDelete
  8. I tried to recover a text message on my PC by going to My Computer> Local Disk (C:)> Users> me> AppData > Roaming> Apple Computer> MobileSync> found the 3d0d7 file but wasn't able to find the text I was looking for.

    Is there somewhere else I can search or another method I can try?

    ReplyDelete
  9. Unfortunately, if you open that 3d0d7 file (as a text file) and don't see any of the message, there isn't a lot else more to go on. A few things you can try: 1) Open iTunes and in Preferences -> Devices, make sure the date of the last backup is after the message existed :) 2) On your phone, you can try searching (slide to the home screen page previous to your first page of apps) for some of the text -- occasionally the text is still cached in the iPhone search functionality.

    ReplyDelete
  10. I am Using Software Mac OS X Lion 10.7.2 and I can't find anything similar to what you describe. There os no users/yourusername/library? Are there different directions for the newest mac software? There is no option for "library" after home?

    ReplyDelete
    Replies
    1. Excellent question -- on Mac 10.7 Lion, the Library folder is hidden by default. You can unhide it by opening Terminal (Applications -> Utilities -> Terminal) and typing

      chflags nohidden ~/Library/

      (the tilde ~ is next to the 1 key)

      Delete
  11. How can you tell who sent the message? Is it the number above or below the message?

    ReplyDelete
  12. Any other file we can find deleted texts messages in ?

    ReplyDelete
    Replies
    1. Not that we know of, but we are actively looking!

      Delete
  13. Is there a way to find this file for a specific iphone? I sync two phones to my computer and I can only find this file for one of the phones.

    Thanks

    ReplyDelete
    Replies
    1. Are you sure that you've backed up the second phone? Syncing doesn't always create a backup (we have a blog post about that too! http://decipher-media.blogspot.com/2011/05/itunes-sync-vs-backup-how-to-ensure-you.html)

      In iTunes, make sure that you've selected "Backup to: This computer" instead of "iCloud" (if even just for a moment), right-click on your phone and select "Back Up".

      Delete
    2. What if i had not back up my data files in iTunes, even or in icloud, please?

      Delete
  14. The original page with instructions for Windows linked to by this post has disappeared, but we had a saved copy so that we can share it here. Originally from "The General Theory of RIAtivity":

    I figured I’d post this as a follow-up to my previous post a few years back mainly because I regularly get questioned on the topic of how to retrieve deleted text messages. Furthermore, I wanted to post a method which didn’t require JailBreaking a phone or that was overly technical. So here you go, a pretty straighforward method for accessing text messages from your iPhone which may have been deleted but might still be available in the iPhone’s SMS database.

    ASSUMPTIONS: I assume you are running Windows of some flavor and have synched/backed up your iPhone using iTunes on said machine.

    1. Download and install TextPad (http://www.textpad.com/download/index.html)
    2. Open TextPad.
    3. Select Search > Find in Files…
    4. Complete the “Find in Files” dialog as you see in the following screenshot. Make sure you’ve checked the Search subfolders checkbox or else this won’t work. Note: this was taken from a Windows 7 machine. The path value for the “In Folder” field should be the same for Windows Vista (of course, your username will appear instead of “mike” in the path. For pre-Windows Vista your path will be under c:\Documents and Settings\[username]\Application Data\Apple Computer\MobileSync\Backup\


    5. Click Find.
    6. In the TextPad search results pane you should see at least one search result found (even though multiple results may have been returned, they all will point to the same SMS DB file per backup folder). Below is a screenshot of what might appear (your filename will likely be different):

    7. Double-click on one of the search results and the SQLite file will open in the upper pane. Much of it will look like garbage, but there’s alot of human readable info in the file, particularly your text messages. Enjoy

    ReplyDelete
    Replies
    1. The screenshot to which you are referring in this post is not visible to me. Therefore, I don't know what dialog to type in the Search box. Please advise.

      Delete
    2. Hi Audrey,

      I apologize for that -- we were not able to get the screenshots from the blog we were referring to when we got the old text.

      In the search dialog, you'll want to type in the location of your iTunes backup folder -- do you know the path already, or would you like help finding it?

      Also, you can get the path from the small "Backups Loaded" dialog window of Decipher TextMessage, if you have downloaded that from our website.

      Delete
  15. I have read this blog which provide me good information regarding how to view deleted messages in iPhone.In this case Decipher TextMessage help me to recover all the deleted data.
    So thanks for providing this information.

    iPhone App Development

    ReplyDelete
  16. Thank you for the fantastic article. The place else could anyone get that kind of info in such a perfect means of writing ?
    DVD packaging

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. I tried the '3d0d' search in TextEdit, as detailed above, and found deleted text messages in iTunes backup of a iPhone 4s on a Mac. It works! I don't know if it is all of the deleted text messages but it is enough. Thanks.

    I have a few questions though.

    1. I can see the phone number of the iPhone that was backed-up and I can read within the gibberish the deleted text messages of that that iPhone. I can also see the deleted text messages from another person but their phone number does not show up or it is in the gibberish. How can I 'make readable' or draw out of the gibberish the other persons phone number and associate it with a particular text message so that I can prove who that text message came from?

    2. Similar to above, the date and time of particular text messages is not readable or is in the gibberish. How can I make the date and time of a particular text message readable?

    3. Lastly, where are the deleted text message attachments (pics mainly) located within iTunes backup on a Mac?

    Thanks.

    ReplyDelete
    Replies
    1. Hi Todd,

      1) Are you using iOS6 on the 4s that you're looking at backups for? The phone numbers are much harder to extract (and sometimes not possible to extract) from the deleted database rows for iOS6.

      2) The dates are in numeric format, for iOS6 they should be the seconds since 2001.

      3) The pictures *should* be deleted when the message is deleted, but occasionally are not. The way the backups work, the names are hard to predict (and should be scattered amongst the hashed file names).

      Have you given our Decipher TextMessage program a try? It will try to figure out some of the contacts for deleted messages (we're working on adding more strategies for this), and translate the dates for you. We also have been working on some beta versions of the program that will look for deleted images.

      Delete
  19. I just downloaded Decipher TextMessage 5 on my PC. The text messages I want to decipher is the '3d0d' file that I have on a disk. I do not have access to the iPhone 4s or to the iTunes backup of said 4s on this PC. I only have the '3d0d' files that I saved on disk from the iTunes backup of the 4s which was on a Mac.

    How do I 'import' the '3d0d' files from the disk into Decipher TextMessage 5?

    ReplyDelete
    Replies
    1. Hi Todd,

      Normally, Decipher TextMessage 5 needs the entire backup folder in order to read the information, since it looks for attachment files as well as just the messages itself.

      However, if we want to look at the 3d0d files mostly for recovery sake, I think we can get those files imported into the program. Send us an email (info@decipher-media.com) since it will be easier to tailor the instructions for you via email rather than here (and our back-and-forth response time will be a lot quicker!) Also, let me know if you're interested in just recovery from those files, or also importing the messages that aren't deleted.

      Delete
  20. What a brilliant site this is! I have deleted texts I am desperately trying to find too. Tried searching the 3d0d files from all 4 back up folders on my Mac. But his what I did previously - can you suggest why it's not working?

    last night i deleted all sent and received texts from one contact - pressed "clear all" by mistake. I panicked and went into iTunes and restored my phone back to the last back up date. which was unfortunately 16 June so now for ALL my contacts, call logs, texts etc - i only have data up to 16 June and nothing from then until now.

    my question is:
    -is there any way I can get that data back somehow or has it gone forever? i mean all texts and phone logs for all contacts from 16 june to now?

    and if so, how do I do it?

    if i search on spotlight for keywords of any of the missing texts, they are not showing up either.

    any clues would be hugely appreciated THANKS

    ReplyDelete
    Replies
    1. Hi Alstemp,

      This is a great question. Usually, iTunes only keeps one backup of each device, so there is a chance that the data is gone forever.

      However, there is one thing we should look for: when restoring iOS devices, iTunes sometimes (I would love to say always, but I'm not convinced) makes a "snapshot" backup of the phone before doing the restore. The snapshot backup folder is named like the others, with the device UDID, but then the date of the backup is appended to that.

      Do you see any backup folders with June 23rd appended at the end (well, something more like 2013 06 23 and then some time garbage)? Let us know if you need help finding the backup folders, but I assume that since you were looking at 3d0d files, you found the backup folders :)

      Delete
    2. Hi - thanks for quick response. When I double click the blue "back up" folder I then see 4 further folders. These are the 4 folders I open, to locate the 3d0d file and then open with Text Editor.

      Should it be one of those 4 back up folders that have the June 23 date at the end - or the folders IN each of those folders (ie same folders I've been looking through to the find the 3d0d files)? many thanks

      Delete
    3. It should be one of the 4 backup folders that have the 6/23 date at the end. Normally there shouldn't be any folders inside of those 4 (horribly-named UDID) folders.

      Another thing you can try out, when in doubt, is to run our free trial of Decipher Backup Browser: http://deciphertools.com/bb-mac.html The free trial will show you a preview of the backups, and should show you the backup dates for each one as well. That might help give you a better idea of what and when the backups are from.

      Delete
  21. Hi again - I have just downloaded the free trial as above. however i can't see the recover button anywhere? is that available on the trial version? also how do I see the back up dates? many thanks

    ReplyDelete
    Replies
    1. Hi again Alstemp,

      My apologies -- Decipher Backup Browser is a separate tool (than Decipher TextMessage, with the text message recovery feature... which also has a free trial if you want to look there too).

      I figured this tool may be helpful, since it shows information and data in each individual backup, which I thought may help you identify if any of the backups are a newer one for your phone. There are two places to check the backup dates:

      1) Along the left-hand column of the program, you should see a description of the device the backup is for, and then the date of the backup.

      2) In the smaller "Backups Loaded" window, you'll see a lot more information about each backup the program found, including the folder name and backup date.

      I hope that helps!

      Delete
  22. Thanks for your help. unfortunately I cannot get that to work either (can't see "backups loaded" window). anyway - if I can't find it by now I think I have probably lost the info. thanks for the help so far!

    ReplyDelete
  23. I was really need it. Thanks for sharing. I have deleted my some officially msgs. I will be really excited if it reviews. en ucuz iphone

    ReplyDelete
  24. Is there a way to delete your messages from all memory forever?
    If I have deleted some messages, I know that they are still lingering on my phone's memory somewhere. Is there a way to get them out of the phone memory completely besides reseting my phone?

    Thank you!

    ReplyDelete
    Replies
    1. We're actually working on a tool for this now! Well, we're actually working on a tool to free up disk space on iOS devices by deleting "useless" data, and part of that is purging the deleted messages.

      Delete
    2. so what is the difference between backup browser & decypher txt mssg >

      Delete

Note: Only a member of this blog may post a comment.