A few days ago my wife just deleted by mistake some old videos from our daughter (when she was like saying her first words) which were only stored in her WhatsApp. I don’t even have to mention how those videos were important to us (she wasn’t following my advice about how to backup her media) - so I had to help recover the videos.
Since WhatsApp stores backups in Google Drive I thought I could just uninstall and reinstall and it would get the backups. That WOULD be easy, but her WhatsApp was still using an old phone number from Brazil which wasn’t even here with us in America (yeah, I know - she just didn’t want to change the number that all her family had, etc). Since we wouldn’t be able to reactivate WhatsApp using that old number the first thing I made was updating her number, to allow me to restore from the Google Drive backup of previous week.
After we updated her WhatsApp number, I disabled backups or else I would be overwriting the backup of the previous week and would lose the videos she was looking for.
So after uninstalling and reinstalling the app, I’ve learned the hard way that WhatsApp backups (both the messages and the media) which were taken using one phone number cannot be restored to a new number. So basically I lost not only all her messages but also all her media.
So then I found this great tool which allows us to Extract (download) the full WhatsApp backup from Google Drive:
Basically you get your device id, then you fill it together with your Google username/password, and the script will download all pictures/videos and even the encrypted backup of the chats (msgstore.db.crypt14).
Then to restore her chat history back we had to change her number again back to the old number in Brazil, and ask her family in Brazil to get the activation code for us, so we could restore from the Google Drive Backup.
In the end of the day, I didn’t even had to dump the Google Drive backup, but at least I learned something new that can be useful.
And also, while trying to recover her messages, I learned about this other whapa toolkit which contains tools to encrypt or decrypt WhatsApp datastore (requires private key), merge two data stores (merge chat histories from different phones, also requires private key), as well as extracting media from Google Drive (I haven’t tested) or iCloud. If you’re trying to decrypt new format (15) you may need this other tool.
And last: if you need to extract the private key of your WhatsApp and your Android is not rooted, you can use this tool - https://github.com/YuvrajRaghuvanshiS/WhatsApp-Key-Database-Extractor (I had to use
python wa_kdbe.py --allow-reboot) which basically will install an old build of WhatsApp and exploit it to dump the private key using adb.
Fun learning anyway.