WhatsApp chats disappeared after Android Operating System Update

  • Replies:3
  • OpenNot stickiedUnanswered
  • Forum posts: 2

Dec 31, 2015 11:35:11 AM via Website

Hello everyone,

I am having a Moto E XT-1022 (1st generation) 2014 model. In order to update its OS from 4.4.4 to 5.1, I had to make 500MB space available so I deleted all WhatsApp database backup files without copying them elsewhere as I knew from my own experience that WhatsApp had nothing to do with Android OS upgradation process since I had already upgraded the same android from OS 4.4 to 4.4.4 and my old Samsung even before that without losing any of my WhatsApp messages but unfortunately, this time all my chats are gone after OS update. As I thought, WhatsApp tried to take the backup automatically on 3AM like any other day, but it's not working either. Now I'm left with a possibly corrupt file msgstore.db.cypt8 (size: 103.62 MB). I have read somewhere that there is a possibility of mending the corrupt backup and regenerating it afresh if the key can be extracted somehow. So is there any ray of hope for me?

I request all kind-hearted developers over here to help me get my WhatsApp back as I just can't afford to lose my three years' important data. I haven't been using WhatsApp for more than a month now. I thought that I could be able to resolve the problem on my own just by Googling and searching through your comments to others who were facing similar problem like mine but I guess, I was wrong.

All of you (respected administractor, moderators, developers and members senior to me), please forgive me if I broke any rule as it was purely unintentional, I'm not a developer and this is my first-ever post.

Thanks and regards,
Rohit Kumar

PS: Mine is a non-rooted device.

Deactivated Account
  • Forum posts: 271

Dec 31, 2015 1:11:11 PM via Website

I think you have not back up the message, and now you could do nothing.

Looking for security app? Try Leo Privacy Guard 3.0.

Join Our Christmas Contest by visiting our Facebook page LEO Privacy Guard

  • Forum posts: 2

Dec 31, 2015 1:28:34 PM via Website

Thanks Roger!

I read this on Stack Exchange but it's a 2014 post dealing with .crypt7 file while mine is .crypt8 extension. Is it gonna work? Can someone improvize on this?

Usually if you place your msgstore.db or msgstore.db.crypt7 file in the following directory on your SD card and reinstall WhatsApp it will see it and ask if you would like to restore your old messages during installation.


However if your database (msgstore.db or msgstore.db.crypt7) is corrupt you may still be able to regenerate the databases using sqlite3.

The WhatsApp Database is an sqlite3 database and is stored unencrypted at this path on the Android device:


Backups of the database are also stored encrypted on the SD card typically at the following location:


The unique key for the encrypted backup databases is stored here:


Access to the /data/data directory requires root access. Alternatively ADB (Android Debug Bridge) can be used to extract the above files after booting into recovery on the device.

If you are dealing msgstore.db.crypt7 files then you must Decrypt them first as follows:

(commands below are run from a linux enviroment)

Extract Key File: /data/data/com.whatsapp/files/key
Extract crypt7 file: /sdcard/WhatsApp/Databases/msgstore.db.crypt7

Extract Decryption Keys from "key" file extracted in step 1:

256-bit AES key:

hexdump -e '2/1 "%02x"' key | cut -b 253-316 > aes.txt

IV (initialisation vector):

hexdump -e '2/1 "%02x"' key | cut -b 221-252 > iv.txt

Strip Header in crypt7 File:

dd if=msgstore.db.crypt7 of=msgstore.db.crypt7.nohdr ibs=67 skip=1

Note: Size of header stripped file in bytes must be divisible by 16

Decrypt crypt7 File:

openssl enc -aes-256-cbc -d -nosalt -nopad -bufsize 16384 -in msgstore.db.crypt7.nohdr -K $(cat aes.txt) -iv $(cat iv.txt) > msgstore.db

Once you have you msgstore.db file either by first decrypting the msgstore.db.crypt7 or by extracting it from the /data/data/com.whatsapp/databases/ directory you can now try to regenerate it using the following commands:

echo .dump | sqlite3.exe msgstore.db > Temp.sql

echo .quit | sqlite3.exe -init Temp.sql msgstore_new.db

Now Try to Restore your database Again

If you followed the procedure above correctly you should now have a msgstore_new.db file.
Rename this file to msgstore.db and place it file in /sdcard/WhatsApp/Databases/ and reinstall WhatsApp. Choose to restore your old database/messages when asked during installation.

  • Forum posts: 105

Jan 4, 2016 8:46:40 AM via Website

Well, forget the stuff what has gone. Henceforth, please remember to keep a backup for all your chat history, in fact you can check mark the auto backup in settings.