FORUMS
Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

[TOOL] Whatsapp Xtract: Backup Messages Extractor / Database Analyzer / Chat-Backup

205 posts
Thanks Meter: 281
 
By ztedd, Senior Member on 5th April 2012, 08:13 AM
Post Reply Email Thread
31st July 2012, 09:39 AM |#251  
OP Senior Member
Thanks Meter: 281
 
More
Quote:
Originally Posted by Pimped.UK

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)

You can try the following:

1. Create a new backup (menu Button - Settings - Chat Settings - Backup Chat history)
2. Force-Close Whatsapp so that it won't receive any new messages.
3. now you should have two .db.crypt files, the older one with all your backupped chats and the newer one with ~ 613+ messages. Use Whatsapp Xtract to convert the .db.crypt files to .htm and unencrypted .db files
4. Now use the tool SQLite Compare (see howto) to merge the two .db files into one
5. Now copy the merged .db file as "msgstore.db" into the folder /sdcard/WhatsApp/Databases and make sure that there isn't any other file there (copy the other files in another folder)
6. uninstall whatsapp, install whatsapp and choose yes when asked to import the backup

If you want to include the merging function into the code of Whatsapp Xtract, you should have a look at the SQLite commands of Python. It's quite similar to SQL. Until someone has done this, you can use the mentioned tool SQLite Compare, though it's a bit difficult to use.
The Following 5 Users Say Thank You to ztedd For This Useful Post: [ View ] Gift ztedd Ad-Free
 
 
31st July 2012, 09:42 AM |#252  
OP Senior Member
Thanks Meter: 281
 
More
Quote:
Originally Posted by seeto84

Hi all, is there no any methods for restoring backup for Blackberry?
I have visited this website every single day & hope i can restore the important message history. (

No, apparently there isn't. We haven't figured out yet how to copy the unencrypted database files from a Blackberry device.
Since I don't own a Blackberry, I can't try it myself, so I have to rely on the community to find out if and how the unencrypted database files can be copied (using your known Blackberry encryption key).
31st July 2012, 06:48 PM |#253  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by ztedd

You can try the following:

1. Create a new backup (menu Button - Settings - Chat Settings - Backup Chat history)
2. Force-Close Whatsapp so that it won't receive any new messages.
3. now you should have two .db.crypt files, the older one with all your backupped chats and the newer one with ~ 613+ messages. Use Whatsapp Xtract to convert the .db.crypt files to .htm and unencrypted .db files
4. Now use the tool SQLite Compare (see howto) to merge the two .db files into one
5. Now copy the merged .db file as "msgstore.db" into the folder /sdcard/WhatsApp/Databases and make sure that there isn't any other file there (copy the other files in another folder)
6. uninstall whatsapp, install whatsapp and choose yes when asked to import the backup

If you want to include the merging function into the code of Whatsapp Xtract, you should have a look at the SQLite commands of Python. It's quite similar to SQL. Until someone has done this, you can use the mentioned tool SQLite Compare, though it's a bit difficult to use.

Thanks, that sounds simple enough! From what I was reading around on this thread, would I need to have root access to my phone? It seems that I don't need to root my phone from your reply.

I'm gonna get cracking on with this and let you know how I get on. Hope it works =D =D

---------- Post added at 05:48 PM ---------- Previous post was at 05:22 PM ----------

Quote:
Originally Posted by ztedd

You can try the following:

1. Create a new backup (menu Button - Settings - Chat Settings - Backup Chat history)
2. Force-Close Whatsapp so that it won't receive any new messages.
3. now you should have two .db.crypt files, the older one with all your backupped chats and the newer one with ~ 613+ messages. Use Whatsapp Xtract to convert the .db.crypt files to .htm and unencrypted .db files
4. Now use the tool SQLite Compare (see howto) to merge the two .db files into one
5. Now copy the merged .db file as "msgstore.db" into the folder /sdcard/WhatsApp/Databases and make sure that there isn't any other file there (copy the other files in another folder)
6. uninstall whatsapp, install whatsapp and choose yes when asked to import the backup

If you want to include the merging function into the code of Whatsapp Xtract, you should have a look at the SQLite commands of Python. It's quite similar to SQL. Until someone has done this, you can use the mentioned tool SQLite Compare, though it's a bit difficult to use.

I tried and got up to the part of extracting using the tool and got the following error:

Quote:

C:\WhatsApp>python whatsapp_xtract.py msgstore.db.crypt
Python Version 2.x
Android mode!

trying to repair android database...
trying to decrypt android database...
Traceback (most recent call last):
File "whatsapp_xtract.py", line 2066, in <module>
main(sys.argv[1:])
File "whatsapp_xtract.py", line 988, in main
from Crypto.Cipher import AES
ImportError: No module named Crypto.Cipher

I noticed when I used !install pyCrypto.bat, I got the following output with errors:

Quote:

C:\WhatsApp>rem If you want to decrypt android whatsapp msgtore.db.crypt files,
then you need to run this (after installing ActivePython). If you get errors the
n try to do this: rightclick on this !install pyCrypto.bat and choose "run as ad
ministrator"!

C:\WhatsApp>"C:\Python27\Scripts\pypm" install pycrypto
Get: [pypm-be.activestate.com] :repository-index:
Get: [pypm-free.activestate.com] :repository-index:
autosync: synced 2 repositories
The following packages will be installed into "%APPDATA%\Python" (2.7):
pycrypto-2.5
error: Can't install pycrypto-2.5: requires Business Edition subscription

*** If you have purchased ActivePython Business Edition, please login to
*** your account at:
*** https://account.activestate.com/
*** and download and run the license installer for your platform.
***
*** Please visit <www.activestate.com/business-edition> to learn more
*** about the ActivePython Business Edition offering.

C:\WhatsApp>"C:\Python27\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, 2.4, 2.3, 2.2, 2.1.0, 2.0.1
Status: Not installed
NOTE: This package requires a valid Business Edition license. Please visit www.a
ctivestate.com/business-edition for more details.

C:\WhatsApp>setx pythonpath "C:\Python27"

SUCCESS: Specified value was saved.

C:\WhatsApp>SetEnv -a pythonpath "C:\Python27"
Error - Set Value : The operation completed successfully.
_
Press any key to continue . . .



EDIT: Can't seem to reply so posting as an edit.

I'm sorry, I skim read that part so it just looked like as though you said choose 32bit/64bit, should have paid more attention....my bad!

Will get back on it tonight
31st July 2012, 08:44 PM |#254  
OP Senior Member
Thanks Meter: 281
 
More
Quote:
Originally Posted by Pimped.UK

Thanks, that sounds simple enough! From what I was reading around on this thread, would I need to have root access to my phone? It seems that I don't need to root my phone from your reply.

Yes, you don't need root access.
Quote:
Originally Posted by Pimped.UK

error: Can't install pycrypto-2.5: requires Business Edition subscription

****ing damn it, I don't know how often I answered this question in the last weeks, I even highlighted the following advice in red on the main page:
Quote:
Originally Posted by ztedd

The easiest way is to install ActivePython (on Windows choose 32bit/x86 version even if you have 64bit windows):
http://www.activestate.com/activepython/downloads

What more could I do to make this even clearer??
The Following 2 Users Say Thank You to ztedd For This Useful Post: [ View ] Gift ztedd Ad-Free
8th August 2012, 02:45 PM |#255  
Junior Member
Thanks Meter: 0
 
More
Hi there,

A few days ago I left a message on the forum about reading Whatsappfiles on your computer.
Well... I found a great site myself (after a few weeks searching and trying and searching).
And... it works!

So to help other people, here is the site:

http://www2.unsec.net/whatsapp/

Succes!
13th August 2012, 10:15 PM |#256  
OP Senior Member
Thanks Meter: 281
 
More
Quote:
Originally Posted by Willem Anders

Hi there,

A few days ago I left a message on the forum about reading Whatsappfiles on your computer.
Well... I found a great site myself (after a few weeks searching and trying and searching).
And... it works!

So to help other people, here is the site:

http://www2.unsec.net/whatsapp/

Succes!

Thanks. But you can also use our Whatsapp Xtract tool, I think it's even cooler
For example it displays the smileys
17th August 2012, 12:49 PM |#257  
mayankchopra's Avatar
Member
Flag Bangalore, India
Thanks Meter: 3
 
Donate to Me
More
32 bit version worked
Quote:
Originally Posted by ztedd

This error was already answered in this thread (did you already try a search for it?):
http://forum.xda-developers.com/show...8#post26567882
You need to install 32bit version of ActivePython! As stated in the Howto:


guys those who get media import failed error try 32bit version of activepython it worked for me
20th August 2012, 06:58 PM |#258  
Junior Member
Thanks Meter: 2
 
More
Unhappy DB history
Quote:
Originally Posted by ztedd

General advice on how to backup Whatsapp

Some general advice on how to backup Whatsapp and get the database file:

Android:
- In Whatsapp go to settings - more - Backup Chats
- Copy the folder "Whatsapp" on the SD card to your backup location (e.g., PC)
- (ideally also) use the app Titanium Backup to backup the full whatsapp application together with its data, copy the backup from the folder "TitaniumBackup" on the SD card to your backup location (e.g., PC)
- Use this tool Whatsapp Backup Extractor (download in this thread) to show the chats in a friendly readable format. The necessary files "wa.db" and "msgstore.db" you will find inside the Titanium Backup archive "com.whatsapp-[Date]-[some digits].tar.gz", alternatively (without Titanium Backup) you can use the msgstore.db.crypt file from the folder Whatsapp/Databases on the SD card.

Iphone:
- use Itunes to create an unencrypted Backup
- use an Iphone Backup Tool to get the file net.whatsapp.WhatsApp/Documents/ChatStorage.sqlite, e.g. I-Twin or Iphone Backup Extractor. Make sure to create an unencrypted backup with Itunes, as these tools can't handle encrypted backups. Another possibility are forensic tools like UFED Physical Analyzer.)

Blackberry:
- sync your blackberry with desktop manager and then copy the messagestore.db file from SD
- however, it seems that this file is encrypted? Currently we don't know how to get the unencrypted messagestore.db file
- Blackberry not supported yet!

Nokia:
- not known yet
- Nokia not supported yet!

CHECK IF DATABASE FILE CAN BE OPENED / EDIT CHAT MESSAGES INSIDE DATABASE

You may want to open the decrypted whatsapp database (ChatStorage.sqlite, msgstore.db or msgstore.plain.db) without this tool, e.g. if something goes wrong to check if it can be opened at all or to edit chat messages.
For this use SQLite Database Browser ( http://sqlitebrowser.sourceforge.net/ ).
However it is much more confusing and the messages are ordered by date, not by conversations. Also you won't see the smileys and media files...

IF DATABASE CAN'T BE OPENED: REPAIR DATABASE

Update: This function is now included in Whatsap Xtract 2.1.
If you get an error like this: Error: file is encrypted or is not a database and you tried to open the unencrypted database with SQLite Database Browser but it can't be opened with it, then try the following:
Open the database with Editor, can you see it starts with "SQLite format 3"? Then you may try to repair the database.
Thanks to hape70 for the instructions on how to repair (I translated it from German to English):


MEDIA FILES

If you want to watch the videos, audios and images, you can click on the thumbnails and media links. Popups should open displaying the media.
However, online media files are available only for the last ~ 3 weeks.
But you still can open the offline media files, they are linked as well.
For this it is necessary to at first copy the folder "Media" from /sdcard/Whatsapp (Android) or net.whatsapp.WhatsApp (Iphone) to the certain folder of your computer where this tool is installed. Then run the script. Now the media files should be correctly linked.

HOW TO MERGE MULTIPLE DATABASE FILES WITH SQLite Compare

Merging of multiple backup files is still on the feature request list, but you can use the tool SQLite Compare as a workaround, see howto in this post by ztedd.

I have the same issue with my Blackbery! as I bought a new Bb, I wanted to read the old whatsApp msgs as they contain some numbers I require but hoplessly trying with no success. can someone assit please!!!
22nd August 2012, 11:13 AM |#259  
OP Senior Member
Thanks Meter: 281
 
More
Quote:
Originally Posted by aawadhi63

I have the same issue with my Blackbery! as I bought a new Bb, I wanted to read the old whatsApp msgs as they contain some numbers I require but hoplessly trying with no success. can someone assit please!!!

You already quoted the answer:
Quote:

Blackberry not supported yet!

28th August 2012, 08:20 AM |#260  
Junior Member
Thanks Meter: 0
 
More
Smile
I was doing all steps... then i readed "Not supported for blackberry"

Well i need to read some conversation i have because Im in personal problems. I have some evidence there that can help me a lot.

If you need a donation tell me.. But i need that for blackberry

Please and thanks...
30th August 2012, 10:28 PM |#261  
akeedthe's Avatar
Junior Member
Thanks Meter: 0
 
More
bloody brilliant!!!! works flawlessly. only hitch was python HAD to be installed to program files instead of default.
thanks
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes