How to Retrieve SMS Text Messages from an iPhone Backup

(This post was written when I had an iPhone 3G. SMS conversations may no longer be extractable in this format, but I will leave the post up until I know otherwise.)

I recently wanted to extract an SMS conversation from my phone so I could write a document based on it. Using a free backup extractor and the SQLite database program that comes pre-installed on OS X, I was able to dump the conversation into a spreadsheet in less than five minutes. You’ll need to have synced your phone with your computer first, as the extractor gets the SMS archive from the phone backup made by iTunes.

Note that these instructions are only applicable to Mac OS X, and the extractor requires Leopard. I found the SQLite commands in an excellent Google Code article, but that method required that I jailbreak my phone and install an SFTP server, which interested me not at all.

  1. Download the free iPhone/iPod Touch Backup Extractor program from
  2. Run it. The program will give you a list of available iPhone backups that iTunes has made when you sync your phone with your computer. Choose the latest one.
  3. From the list of apps whose data you could extract, choose “Other Programs” at the bottom. Choose a folder on disk to extract the data to — it will make a number of folders and files, so you should create a new folder for it.
  4. Open Terminal. Change your current directory to “Other Files/Library/SMS” within the folder that you chose in the previous step.
  5. Type the following commands, hitting the return key after each:

    sqllite3 sms.db

    .output output.txt

    SELECT * FROM message;


You can now close Terminal. In the “Other Files/Library/SMS” within the folder to which you extracted the backups, there is now a file called output.txt. This is a pipe-delimited text file that you can import into Excel. Some of the columns are easily recognizable — the phone number to which the text message came from or was sent to, and the text of the message. To get all of the messages exchanged with a particular person, simply sort by the phone number column to get them all together.

Leave a Reply

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