C:\Temp\WhatsappExtract>rem If you want to decrypt android whatsapp msgtore.db.crypt files, then you need to run this (after installing ActivePython)
C:\Temp\WhatsappExtract>"E:\Programme\Python27\Scripts\pypm" install pycrypto
C:\Temp\WhatsappExtract>"E:\Programme\Python27\Scripts\pypm" show pycrypto
C:\Temp\WhatsappExtract>setx pythonpath "E:\Programme\Python27"
C:\Temp\WhatsappExtract>"E:\Programme\Python32\Scripts\pypm" install pycrypto
The following packages will be installed into "%APPDATA%\Python" (3.2):
pycrypto-2.5
Hit: [pypm-free.activestate.com] pycrypto 2.5
Installing pycrypto-2.5
C:\Temp\WhatsappExtract>"E:\Programme\Python32\Scripts\pypm" show pycrypto
Name: pycrypto
Latest version: 2.5
Author: Dwayne C. Litzenberger <dlitz@dlitz.net>
Summary: Cryptographic modules for Python.
Home Page: http://www.pycrypto.org/
Available versions: 2.5, 2.4.1
Status: Not installed
C:\Temp\WhatsappExtract>setx pythonpath "E:\Programme\Python32"
_
Drcken Sie eine beliebige Taste . . .
As you can see on the first page, it was already requested as a feature, but it's not supported.Halo : )
Can I use this tool to transfer the chat history from iphone to android?
If so, may you tell me the steps? Thank you so much
Sam
I even delete the whole chat history quite regularly, since the database file is always growing bigger and bigger and so filling the internal space. Furthermore, it's just too much hassle to press the "load older messages" button again and again and again... to reach the very old messages. Do you ever do that in fact?
I guess it should be much easier to just watch the older messages on PC or copy the ChatStorage.sqlite.html file on your android.
However if there would be really such a great demand and the money to finance that, it is quite feasible.
You didn't use the newest version. Please download the newest archive from the first pageHi,
I have a problem installing pyCrypt0:
C:\Temp\WhatsappExtract>"E:\Programme\Python32\Scr ipts\pypm" install pycrypto
The following packages will be installed into "%APPDATA%\Python" (3.2):
pycrypto-2.5
Hit: [pypm-free.activestate.com] pycrypto 2.5
Installing pycrypto-2.5
C:\Temp\WhatsappExtract>"E:\Programme\Python32\Scr ipts\pypm" show pycrypto
Status: Not installed
Ca you help me please? Any hint?
Hi ztedd
I ran the script and no records were generated. So I presume that deleted records are REALLY deleted
Cheers
Originally Posted by ztedd
Please, do the following:
- Download, extract and Run SQLite Database Browser
- open ChatStorage.sqlite with SQLite Database Browser
- go to "Execute SQL" tab
- paste this SQL String and then click "Execute query":
SELECT * FROM ZWAMESSAGE WHERE ZCHATSESSION Not In (Select Z_PK From ZWACHATSESSION)
- make a screenshot of the result and post it here (you may blacken parts with private data)
This will help me to get more information on the question whether there are messages that the script doesn't show
Actually I haven't tested this. So I guess I would recommend you to just use Iphone Backup Extractor. That should work.@ Ztedd:
I'm feeling like a complete noob, but in the first post you write:
net.whatsapp.WhatsApp/Documents/ChatStorage.sqlite
(You can use an Iphone Backup Tool to get the file, e.g. I-Twin
As far as I know, I-Twin doesn't import chatstorage.sqlite by default. So how do extract this file by using I-Twin? (I'm using version 3.3 Final)
That's interesting. Haven't noticed that yet, but I'd like to look into this. Maybe you could send me an example database file of that.I think deleted messages are somehow stored in chatstored.sqlite because I can read them if I open the file with notepad (hard to read in notepad, but you can try)
Even in my case chatstorage.sqlite weights 2.5Mb and .html output only 800Kb (so I think not all the info is shown in the .html file)
That's interesting. Haven't noticed that yet, but I'd like to look into this. Maybe you could send me an example database file of that.
I have sent you a PM with my mail address. You can use some hex editor to search and replace phone numbers (with normal editor the database would become corrupted).I only have my chatstorage database, not a sample one.
I can change phone numbers with a text editor to preserve personal information and send it to you somehow (not uploading top a public forum)
You didn't type the correct commands to repair the file.
Please try the following:
- start whatsapp_xtract_console.bat and then type (or copy-paste):
- echo .dump | sqlite3.exe msgstore.plain.db > Temp.sql
- echo .quit | sqlite3.exe -init Temp.sql msgstore_new.db
- python whatsapp_xtract.py msgstore_new.db
Does that work? Which output do you get?
If it doesn't work, maybe the files weren't copied correctly. Maybe you should try again to copy the files from the SD card, e.g. using a different way (maybe ejecting SD card and inserting it in an SD card reader instead of mounting the phone to the PC).
- echo .quit | sqlite3.exe -init Temp.sql msgstore_new.db
This comand will generate the msgstore_new.db with 0KB.
python whatsapp_xtract.py msgstore_new.db
has a error called
"Could not open database file. Guess it's not a valid Android or Iphone database file."
I will backup again the database and Copy it to my pc to try it again. Maybe i have an CRC error at the Copy.
But thanks for your help!
Normally this shouldn't happen, your script is executed in the wrong directory.I have this problem: http://i47.tinypic.com/2wdawib.jpg
C:\Windows\System32>python whatsapp_xtract.py msgstore.db.crypt
python: can't open file 'whatsapp_xtract.py': [Errno 2] No such file or directory
D:\Whatsapp_Xtract_V2.1_2012-05-16>python whatsapp_xtract.py msgstore_new.db
Python Version 3.x
Android mode!
printing output to msgstore_new.db.html ...
Traceback (most recent call last):
File "whatsapp_xtract.py", line 2066, in <module>
main(sys.argv[1:])
File "whatsapp_xtract.py", line 1446, in main
y.media_thumb = "data:image/jpg;base64,\n" + base64.b64encode(y.media_thumb)
.decode("utf-8")
File "C:\Python32\lib\base64.py", line 56, in b64encode
raise TypeError("expected bytes, not %s" % s.__class__.__name__)
TypeError: expected bytes, not str
For Android DB:
python whatsapp_xtract.py msgstore.db -w wa.db
OR (if wa.db is unavailable)
python whatsapp_xtract.py msgstore.db
For iPhone DB: (-w option is ignored)
python whatsapp_xtract.py ChatStorage.sqlite
Merging of multiple whatsapp databases is still on the feature request list.Do you know if it's possible to merge the db-files into one with all messages?
e.g. I have 7 backup files, i deleted some messages every day, and now I want to have an overview of all messages over these last 7 days.
I saw that every message have an ID defined as primary key in the DB-file.
- download sqlite3.exe from http://www.sqlite.org/download.html
- start whatsapp_xtract_console.bat and then type:
- echo .dump | sqlite3.exe msgstore.db > Temp.sql
- echo .quit | sqlite3.exe -init Temp.sql msgstore_new.db
- python whatsapp_xtract.py msgstore_new.db
(make sure to replace the underlined msgstore.db with the name of the database that is unencrypted but can't be opened, sometimes it will be msgstore.plain.db)
You can try the following:I'd like to me able to import a backup into my current conversations in whatsapp or merge one or more db.crypt files together so that I can import them all into whatsapp.
I had a lot of conversations in my backup, but instead of importing them, my whatsapp received 613 new messages so I don't have any of my old conversations. I can import them, but then I lose my current conversations and vice versa.
I'm willing to play around with code if it helps. My speciality is SQL, ASP, Java (not as good at it anymore, but can pick it up fairly quickly)