[Android Apps and Games] kvunadkat:
Backup restore

Dear XDA Developers Community

I have two android based whatsapp databases that I have tried to combine.

The first one is from October 2012 and the second one is the current backup from today.

I have decrypted both msgstore.db (crypt files) into two folders: Whatsapp October 2012 and Whatsapp Present Day.

The decryption process resulted in three files being created in each folder: msgstore.db (crypt file), msgstore.db (html file) and msgstore.plain (daba base file)

The html files in both cases opened and displayed my messages fine and clearly.

I used SQ Lite Browser to view my msgstore.plain files in both cases, as described in the instructions and made a note of the numbers needs and then ran the script.

I then went to SQ Lite Compare and followed the instructions with the October File being on the left and the Present Day file being on the right.

I ran the process for the Table Messages, copying between 1000-1500 messages at a time from right to left, until all 22000 messages were moved as described. No errors came.

I ran the same process for table chat list and this had around 70 entries on the right that needed to be moved to the left.

Many of the rows wouldn’t copy to the left because of a constant error message coming up – this occurred for around 25 of the entries and hence resulted in a blank field on the left side.

I closed the program and then noticed the October folder that contained the msgstore.plain (data base file) had grown in size from 8mb to 13mb – guessing from the new data that had just been merged. This I ran through Whatsapp Xtract and created a new HTML file to read. It appears correctly so I thought I would then change the file name on msgstore.plain to msgstore.db on the newly created 13mb file and move it over to the Whatsapp folder on my phone.

I firstly uninstalled whatsapp from my phone, then deleted the whatsapp folder from the memory. I then used the new Present Day backup folder to insert the msgstore.db (data base file) into the database folder. I left all other folders untouched and then copied the entire whatsapp directory with the five folders (.shared .trash .databases .media and .profile pictures) back on to my phone. Please note the only thing I did with this backup restoration was to delete all files in the databases folder and replace it with the NEW msgstore.plain file which had been renamed to msgstore.db (data file only). All other files in the database folder were deleted.

I then reinstalled whatsapp and for some reason the backup wont restore as whatsapp wont give me that option.

If I use the Present Day Backup created earlier with the msgstore.db (crypt file) then it works fine but for some strange reason it wont work with the msgstore.db (data base file)

Am I doing something wrong here?

Is the fact that the original October 2012 backup file is too old or does this not matter – I know whatsapp doesn’t allow normal restores after 14days and hence why I got stuck without the backup being used originally.

I have given all the information I could upfront in order to try and be clear on the steps Ive followed so that it might be clear on any errors I might have made.

Please help.

PS….thank you so much to those that have developed these tools. I have found it so useful to get this far.

---------- Post added at 05:16 AM ---------- Previous post was at 04:26 AM ----------

OK, so it is really early in the morning and I have just realised that being stupid in trying to put a .db file extension onto something that already has that file extension is going to cause a problem :(:(:(:(:(

So, I have now moved my file msgstore.db on to my phone in the data base folder and created a restore from backup.

It did a restore of some 45k messages but it clearly didn't do a complete and full restore as the messages from many people, and for some people all their messages, didn't correctly appear after the restore.

I'm thinking that this has something to do with the process that resulted errors in the SQ Lite Compare program under the Table Chat_List.

I've gone back into the program to run the process again and the error message is as follows:

"Abort due to constraint violation column key_remote_jid is not unique"

This error message only appears for around 25 of the 75 entries in this table.

Please could someone help me as I do believe I am correctly following all other steps of the process from decrypting original files to restoring the backup.