Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
10-14-2011, 08:56 PM #1
Addressbook.sqlitedb and sms.db on iOS 5. Upgrading problems.
- Join Date
- Oct 2010
- Thanked 2 Times in 1 Post
Yesterday I just tried to update my iPhone 4 4.3.3 (jailbroken with Jailbreakme) to iOS 5 but had some problems with corrupt iTunes backup and couldn't restore my old data back into iOS 5. Thankfully I had a manual backup of some of the most important files I had on the phone (address book and sms data) which I'm trying restore to iOS 5 now.
When I migrated from iPhone 3G 3.1.2 to iPhone 4 4.1 I had a similar problem and just cutting and pasting the old files to the new OS (on /var/root/library/addressbook and /sms respectively) worked just fine.
However, address book data used to consist of only two files: AddressBook.sqlitedb and AddressBookImages.sqlitedb. And SMS had only sms.db. However on iOS 5 there are three "versions" for each of those file (AddressBook.sqlitedb, AddressBook.sqlitedb-shm, AddressBook.sqlitedb-wal, AddressBookImages.sqlitedb, AddressBookImages.sqlitedb-shm, AddressBookImages.sqlitedb-wal, sms.sqlitedb, sms.sqlitedb-shm, sms.sqlitedb-wal)
It seems the actual contacts/sms are storred on the .sqlitedb-wal files and not the .sqlitedb ones.
Trying to replace the .sqlitedb files or renaming them to sqlitedb-wal and replacing doesn't work.
Does anyone have any clues on how to proceed on this?
10-15-2011, 08:45 AM #2
I`ve got exactly the same problem with my 3GS. Google shows that these -shm and -wal extensions are cookies.
Has anyone restored those files without any problems and how?
10-15-2011, 05:35 PM #3SMS.db Backup SOLVED!!!
UPDATE 4: December 30 2011: For those who are having problems restoring contacts: TURN OFF iCloud contacts Backup before performing this:
AddressBook restored successfully by deleting everything, copying the backups AddressBook.sqlitedb and AddressBookImages.sqlitedb (images as it says) then respring.
Doing the same for sms.db works partially, since it seams that all previous messages appear in the list but when u go into one, it's empty...
Still working on it, so i'll update you guys if i find a solution
UPDATE 1: SMS.db successfully imported! (using iphonebrowser & iFile - you may use others...):
1. Using iphonebrowser delete all files in /var/mobile/library/sms
2. drop sms.db in same directory
3. Open iFile change owner from "root" to "mobile"
4. Restart iPhone using "Just Boot" in Redsn0w of course.
UPDATE 2: It seems that there's a flow i can't receive SMS. Still working on a fix, feel that i'll solve it pretty soon...
UPDATE 3: 100% Working. I'm able to send, receive and all my previous SMS are here! Whooohooo!
The fix: reboot once more
Last edited by codvisp; 12-30-2011 at 02:53 PM. Reason: UPDATE 4
10-15-2011, 06:40 PM #4
sqlitedb-wal is for iMessage and not normal SMS, which is still the same file sms.db
10-16-2011, 12:30 AM #5
first drop your backup sms.db file into the sms folder via ifile... change its owner to "mobile".. remember do not open the message app.. then backup in itunes.. and then restore from the same backup.. and youre done.. it worked for me..
Last edited by zodiac9; 10-16-2011 at 12:37 AM.
10-16-2011, 01:26 AM #6
10-17-2011, 07:59 AM #7
Originally Posted by choungz
2. Copy into /var/mobile/addressbook your AddressBook.sqlitedb and AddressBookImages.sqlitedb using iFile (since your using it...) and set the permissions of "Owner" for both of the copied files to "mobile" if it's set as "root".
Last edited by codvisp; 10-17-2011 at 08:15 AM.
10-17-2011, 03:36 PM #8** Adressbook working now **
got it working. My Adressbook is back !
How did I got it working? Just use ifunbox and search for the adressbook sql database. There are 2 or 3 different locations. just copy your copy to all locations and reboot. Works for me like a charm. The other ways didnt work so far !
The Following User Says Thank You to gerstemann For This Useful Post:
10-17-2011, 05:10 PM #9
If anyone is having problems going from 4.x.x to 5.0 and manually restoring the contacts database follow codvisp's instructions here! I was frustrated SSH'ing files and not having it work correctly but the instructions below worked 100%! Thanks codvisp you are a lifesaver
10-17-2011, 08:15 PM #10
- Join Date
- Oct 2010
- Thanked 2 Times in 1 Post
10-18-2011, 07:38 AM #11
my pleasure guys
10-18-2011, 11:42 AM #12
Yap, got it working also. thanks
10-18-2011, 08:46 PM #13
10-20-2011, 03:46 AM #14contacts
Contacts restore does not work for me
I did exactly like codevisp said but all i get is empty contacts. I was using iexplore because i am on a mac and i did not find that owner and root option, maybe thats the problem? No luck with ssh or ifile either.
Should i try it on a pc with iphonebrowser?
10-22-2011, 10:17 PM #15
i have a problem i am on ios 5 on my ip4. when i use iphonebrowser i cannot find /var/mobile...... all i see is root and then inside root there are acouple of folders like :
airfair, airlock, books, DCIM, Downloads, Gerneral Storage, HighlandPark, iTunes_Control, PhotoData, Photos, Recordings, and safari.
thats it ... so where to i put my backed up "AddressBook.sqlitedb" and "sms.db"???
10-24-2011, 05:05 PM #16
10-26-2011, 07:58 AM #17
11-03-2011, 02:24 AM #18
Can i just add a couple things
- If you are stuck in the cycle where it keeps respringing automatically. Just delete the contents of SMS/ and then start the above process once booted AND BEFORE ANY APPS ARE LOADED
- In my particular situation, i could restore the SMS database fine, and see all the messages, but when i tried to send one, or receive one, the phone would crash and wipe the database again. There is a point above that rebooting fixed this. However, my situation is also this, once restored, if i re-boot, the phone hangs on the lock screen, and then refreshes, with no SMS. So rebooting in my case, no matter what sequence i tried, with all the correct permissions, my database just wanted to wipe!
If you find yourself in my situation, i used this free tool at iPhone SMS Database Merger for iOS 3.x and 4.x to merge my database to itself (i.e. used the same file for both). There were no duplicates, and it essentially re-wrote the database from scratch. As mentioned, group messages no longer appear as groups but as individual items, but ONLY for the group messages in the file. If you send a group message AFTER this process, it still does it, just the re-write merge process splits them up into individual conversations. (i can't see this being even a minute problem for anyone...can you??)
Once the process was complete, i immediately backed up to iTunes, and now I can now restore from iTunes to any iPhone (4.x and 5.x JB or non JB) and it's perfectly fine.
Obviously some people are having success with just dropping the old sms.db in, and that's good, but for anyone who's just, won't, work. Try the merger. I'm very happy that 4 years of SMS are still accessible by the phone.
12-19-2011, 05:22 PM #19
On a side note: how do you know what to set the owner and permissions to? Except for checking the original file ofcourse..is there a general rule for setting those values?
Last edited by nietvoorniks; 12-19-2011 at 05:25 PM. Reason: Add question
12-22-2011, 02:01 AM #20
When the owner is root, effectively you prevent any (but root) from changing the file. Naturally, when you set it to mobile, changes are allowed to the file by any...
To clarify further, all saves or changes (as an example of a save game file) has to be set as mobile to have access to the read & write...