Here is a quick little how-to on backing up your SMS database on your iPhone4 or 4.0 firmware 3G/3GS.
First of all, why backup SMS.db by itself when you can backup your entire iPhone? There are many reasons, but the biggest one will probably be so that you can restore your text messages without moving over other potentially unwanted data that comes with restoring your iPhone from a full backup. Personally, I wanted a fresh start when moving from my 3G to my iPhone4 – except I had 2 years of text messages stored on my 3G that I’d rather not lose. Now that the iPhone4 jailbreak has been released, it should be no problem to pull the sms.db from the 3GS filesystem and copy it over to the iPhone4.
The short-version of the process is as follows:
- Upgrade to 4.0 (iOS) firmware first, if you’re on a 3G/3Gs.
- For 3GS and earlier models, jailbreak with redsn0w. You can get the latest here. For iPhone4, simply open jailbreakme.com on your device and follow the instructions.
- Install OpenSSH in Cydia.
- SSH or SFTP in to your phone using the IP address listed in your Wifi settings. (Port: 22, username: root, password: alpine)
- CD to the directory: /private/var/mobile/Library/SMS
- Copy sms.db to your local computer
If you have any questions, feel free to use the comments below. If there is enough interest, I’ll further explain any of the above steps in case they aren’t clear enough.
This is a technique that has been covered by a few other sites for the 3G, and hasn’t changed very much with the iPhone4 (Really the only difference that I found is that the path of /var changed to /private/var.) I’ll have to do another post on some more creative reasons to get your hands on your SMS.db. If you know your way around SQL Lite (it’s easy to learn), there’s pretty much no limit to how you can use your iPhone’s SMS database!
Update 06/30/10: This post may have been a bit premature since the iPhone4 has not been (officially?) jailbroken yet? I have not gottten around to attempting to restore SMS.db to my iPhone4 (just don’t have the time for it at the moment). If someone can post a solution that would be great, or I will post my findings here once I get around to trying it.
Update 08/04/10: Now that the jailbreak for the iPhone4 has been officially released, you should be good to go!








Sun
Jun 27, 2010
1:34 pm
Comment
Thomas:This doesnt work I used to always do this but when i did it on ios4 it loads the text but you wont be able to receive or send any texts
Sun
Jun 27, 2010
2:25 pm
Comment
Thomas:If u can help me please respond btw i went from 3.1.2 so my original sms.db file is from 3.1.2 and im trying to put it on 4.0
Wed
Jun 30, 2010
4:59 am
Comment
Confuseled:How would you put the sms.db onto your iphone 4 though?
Wed
Jun 30, 2010
12:55 pm
Comment
Josh:Sorry for the confusion. I haven’t gotten that far either (see updated post). I will be looking for a solution but am just too busy at the moment – if you guys find something would you mind posting it here?
Mon
Aug 2, 2010
8:36 pm
Comment
tuan:hi, i backed up my sms.db, “drafts” folder, and the “parts” folder from my 3g phone. then i went out and got the iphone 4. it took a month for the jailbreakme.com to come out, so i couldn’t load my backup from my 3g to iphone 4 on release day. question: how do i MERGE my iphone 3g sms backup with my iphone 4 sms backup?
i tried this site (https://smsmerge.homedns.org/) even though it said it wouldn’t work with frimwares 3.0 and up without any results (no surprise, i had to try)
sorry, just read the post update. any progress on your iphone 4?
Wed
Aug 4, 2010
3:04 am
Comment
Stephan:Copying the SMS database from my iPhone 3G on 3.1.2 to my newly jailbraked iPhone 4 following these instructions worked perfectly. Thanks!
Wed
Aug 4, 2010
2:59 pm
Comment
Josh:Stephan: Great, glad I could help!
Tuan: That’s a very good question. Off the top of my head, it may be possible to combine the databases using a tool such as SQLite Database Browser. The process would involve exporting SQL dump files of both databases and then importing them into one master database. However, I imagine there would be some table redundancies, so I’m not sure exactly how this would work. Anyone else have any ideas?