I’m working on a tool, inspired by the need to wipe my iPhone but first backup my SMS/MMS text messages for retention purposes.
I looked around the internets and found some tools out there, but not all were free. Found some methods of doing this also through the command line with some trickery but I decided to just write a small .NET utility to handle this for me because I’m sure I’ll need to do this again.
You need to have a backup of your iPhone via iTunes on your computer or this tool will not work.
Here’s a screenshot. I plan to implement image attachments, emoticons and other features (like Contact Names instead of just phone numbers). Currently, it does what I need. I can right-click on a contact and export that entire contact’s text history to CSV, RTF, XLS, or TXT.
iPhone SMS Reader
It’s not complicated how this works. There’s actually an SQLite database that is created and stored to the backup folder (location differs for each version of Windows). Through a bit of research I was able to figure out how to extract the data I needed.
If you’re interested in trying this out, let me know. I saw some different information across the ‘net regarding some of the columns in the tables. The version of iOS I tested this is on was 6.1 on an iPhone 3GS.
Some other tools out there that I used after I wrote this. These are geared more toward browsing the complete backups of the iTunes backup of your iPhone.
– This is the SMS/MMS file (SQLite)
Possible Locations of iPhone Backup File:
%APPDATA% = C:Documents and SettingsUSERNAMEApplication Data
%APPDATA% = C:UsersUSERNAMEAppDataRoaming
This snippet is from Linux Sleuthing blog… There are some interesting things that I was wondering that I learned why the case is from this site. The datetime is 31 years (or 978307200 seconds) because Mac Epoch is 1/1/2001 whereas Unix Epoch is 1/1/1970. Cool, eh?
SELECT m.rowid as RowID, DATETIME(date + 978307200, 'unixepoch', 'localtime') as Date, h.id as "Phone Number", m.service as Service, CASE is_from_me WHEN 0 THEN "Received" WHEN 1 THEN "Sent" ELSE "Unknown" END as Type, CASE WHEN date_read > 0 THEN DATETIME(date_read + 978307200, 'unixepoch') WHEN date_delivered > 0 THEN DATETIME(date_delivered + 978307200, 'unixepoch') ELSE NULL END as "Date Read/Sent", text as Text FROM message m, handle h WHERE h.rowid = m.handle_id ORDER BY m.rowid ASC;
Example of the above SQL: