[TOOL] Merjapp - merge whatsapp databases - Android Apps and Games

If you ever lost your phone due to an accident, or just had to use a temporary phone for some reason...
And you're one of those who hates to lose history, even if you know you hardly look at it...
This tool is for you.
Pre-requisites:
Neither of your phones where your whatsapp is installed need be rooted.
You must enable USB debugging on both devices
You must have Android SDK, we will be using the Android Debug Bridge (ADB)
Have Android Backup Extractor ready, we will use it.
Instructions:
Connect the phone which holds your old database to your computer, and enable USB debugging.
Use ADB to make a backup of the whatsapp database
Code:
adb.exe backup -f whatsapp.ab com.whatsapp
Use 'Android Backup Extractor' to extract whatsapp.ab to whatsapp.tar
Open whatsapp.tar with 7zip (or any other compression utility) and extract the file called 'msgstore.db'
Rename the file to 'old.db'
Repeat the above steps for your new phone, but rename the file to 'new.db'
Run merjapp in the following fashion:
Code:
java.exe -jar merjapp.jar -old old.db -new new.db
You can also use the -simulation mode if you like, it will not create any output database, and you will be able to read the log created in the working directory.
If you want extra debug information you can use the -debug mode.
If everything went correctly and "Done!' is displayed, rename output.db (which is your merged database) to msgstore.db
Connect your new phone to your computer, open the Whatsapp/Databases directory on the internal SD card and backup its contents to some other location.
Copy msgstore.db created in the previous steps to this directory
Clear whatsapp's data from your new phone and force stop it.
Open whatsapp and when prompted, elect to restore from backup, and voila!
Download
Download merjapp v141201 (runnable jar file)

Backup
Backup

Just registered to say thank you. It works!
Official whatsapp method wasn't working for me: "unable to recover chat history". So your tool saved me. Thanks!

namnoops said:
If you ever lost your phone due to an accident, or just had to use a temporary phone for some reason...
And you're one of those who hates to lose history, even if you know you hardly look at it...
This tool is for you.
Pre-requisites:
Neither of your phones where your whatsapp is installed need be rooted.
You must enable USB debugging on both devices
You must have Android SDK, we will be using the Android Debug Bridge (ADB)
Have Android Backup Extractor ready, we will use it.
Instructions:
Connect the phone which holds your old database to your computer, and enable USB debugging.
Use ADB to make a backup of the whatsapp database
Code:
adb.exe backup -f whatsapp.ab com.whatsapp
Use 'Android Backup Extractor' to extract whatsapp.ab to whatsapp.tar
Open whatsapp.tar with 7zip (or any other compression utility) and extract the file called 'msgstore.db'
Rename the file to 'old.db'
Repeat the above steps for your new phone, but rename the file to 'new.db'
Make back-ups of both old.db and new.db, as merjapp will make changes in them
Run merjapp in the following fashion:
Code:
java.exe -jar merjapp.jar -old old.db -new new.db
You can also use the -simulation mode if you like, it will not change your databases and you will be able to read the log created in the working directory.
If you want extra debug information you can use the -debug mode.
If everything went correctly and "Done!' is displayed, rename old.db (which is your merged database now) to msgstore.db
Connect your new phone to your computer, open the Whatsapp/Databases directory on the internal SD card and move its contents to some other location
Copy msgstore.db created in the previous steps to this directory
Clear whatsapp's data from your new phone and force stop it.
Open whatsapp and when prompted, elect to restore from backup, and voila!
Download
Download merjapp v141005 (runnable jar file)
Click to expand...
Click to collapse
A pretty neat tool!
I was trying to merge two databases. It seemed that everything went okay and all with the "Done!" message. However, there seems to be no changes made two any of the database. Their filesizes remains the same for old.db and new.db.
I tried loaded the old.db anyway since you said that is the merged one. However, I am getting only the old one.
Please advise.

And you didn't use the '-simulation' flag by chance, right?
Can you attach the log file?

Hi,
I think I have done everything as instructed above. But the phone doesn't seem to recognize the new mgstore.db backup file.
I notice that the new file isn't crypt7 as the original mgstore.db file from the internal drive. Is that causing my problems? How do I fix it?
Greetz

clevernam said:
mgstore.db
Click to expand...
Click to collapse
Did you make a typo with the file like you did here? It should be msgstore.db, not mgstore.db.
No, it doesn't have to be encrypted in order for whatsapp to recognize it.

namnoops said:
Did you make a typo with the file like you did here? It should be msgstore.db, not mgstore.db.
No, it doesn't have to be encrypted in order for whatsapp to recognize it.
Click to expand...
Click to collapse
Nope, that's not it, just checked.
Do i have to put it into the msgstore.tar file? Where i extracted new and old from?
Greetz (thanks for helping btw., if this works, its a realy big help to me!!)

Nope, you just have to place msgstore.db inside the 'whatsapp' directory on your internal SD card (I'd make sure it's the only file there).
Then clear data on whatsapp, force close it, and run it.
Is that exactly what you're doing?

Multiple Databases
Can this app merge multiple databases...
Like if i want to merge 3-4 old databases into one? is it possible? if either one of these databases have same data, will that be duplicated?

It can merge more than one, but that's under the assumption they're mutually exclusive (in terms of messages - i.e., no message appears twice)
So if you used one phone (1), started with a clean whatsapp on a second phone (2), then another clean whatsapp on a third (3), and so on...
You'll merge (1) as 'old' and (2) as 'new', then use the output as 'old' and merge it with (3) as 'new', etc.

namnoops said:
Nope, you just have to place msgstore.db inside the 'whatsapp' directory on your internal SD card (I'd make sure it's the only file there).
Then clear data on whatsapp, force close it, and run it.
Is that exactly what you're doing?
Click to expand...
Click to collapse
Yes, thats exactly what i did. Any other idea what could be wrong?

I'm sorry - it should be under WhatsApp/Databases like the opening post says...

namnoops said:
I'm sorry - it should be under WhatsApp/Databases like the opening post says...
Click to expand...
Click to collapse
That's what i figured, because I was already thinking about all the other files with dates like msgstore-2014-10-12.1.db.crypt7 that i took out of the Database folder.

namnoops said:
I'm sorry - it should be under WhatsApp/Databases like the opening post says...
Click to expand...
Click to collapse
The output file, that I renamed to msgstore.db has "gear wheels" as an icon, but the msgstore file from the database of the phone has no icon at all. Is that somehow significant? Does that maybe lead you to my mistacke?

The fact the the output file has the 'gear wheel' icon just means Windows detects it as a database, I think it's quite meaningless...
The other files it didn't give this icon are *.db? Or are you referring to the encrypted databases? They encrypted ones probably won't have this icon.
It seems to me you're doing everything right:
Renaming the file to 'msgstore.db'
Put it in your internal SD card under WhatsApp/Databases
Making sure there's no other file there except this file
Force closing whatsapp, clearing data, opening the app...
So you're doing all this, and when whatsapp loads it initializes from scratch and doesn't tell you a backup has been found?
It just goes on to initialize an empty database as though you just installed whatsapp for the first time?

namnoops said:
The fact the the output file has the 'gear wheel' icon just means Windows detects it as a database, I think it's quite meaningless...
The other files it didn't give this icon are *.db? Or are you referring to the encrypted databases? They encrypted ones probably won't have this icon.
It seems to me you're doing everything right:
Renaming the file to 'msgstore.db'
Put it in your internal SD card under WhatsApp/Databases
Making sure there's no other file there except this file
Force closing whatsapp, clearing data, opening the app...
So you're doing all this, and when whatsapp loads it initializes from scratch and doesn't tell you a backup has been found?
It just goes on to initialize an empty database as though you just installed whatsapp for the first time?
Click to expand...
Click to collapse
Precisley. Nothing comes, when I reinstall whatsapp.
It is not like when I put the normal backup data back in the databse folder. Then whatsapp realises that there is a backup file in the internal memory and gives me the option to restore the history. Not so with the merged file.
Btw. I have no sd card. I connect the phone with usb. I figured that it is an unessencial diffrence? Am I wrong? My phone btw. is Motorola Moto G. If that helps
I'll check, if the old an new are mutually exclusive. I think in the progress I got a message on the new and old one. What would happen in that case? Would your program do the job, but then creat a bad "output" file?
If the only problem was, that I messed up the historys, I'm sorry, namnoops.

Are you using the latest version of whatsapp?

iclumyc Doctrine
namnoops said:
Are you using the latest version of whatsapp?
Click to expand...
Click to collapse
Well if I didn't then, now I do. And it still doesn't work

I checked if there are any intersecting messages... It turns out there weren't any.
@namnoops: Does the oldest message in the new history have to be more recent then any old message from the old history? I mean: Is it a problem for merjapp if the timelines intersect in any way, although there are no double messages?
Thanks for your help in advance

Related

Activesync restore

Today I lost all the data on my phone.. no problem I thought, I shall do a restore using my backup activesync makes every time i plug my phone in, so all is fine and dandy. When it gets about half way through the restoration, activesync crashes (always at the same point). It is during processing a file called fldr1001dd8.
This means I cannot fully restore my device - very annoying!!
Can anyone help with this... can I make it so it skips errors instead of crashing? Any help at all appreciated!! Device is a Blue Angel, using ActiveSync 4.1
You want to download a free utility called STGViewer - this utility allows you to examine the contents of the backup file activesync creates so you can identify which data you want restored. If there is a corrupt file then you can decide not to restore that particular one but retrieve everything else.
Thankyou so much, I will try that!!
OK I have found it, but I cant work out how to delete a file from the archive with it. All it seems able to do is 'copy' files out of the archive :-(
Any tips?
You cannot delete individual files from the .stg file but the program does allow you to restore selected folders and files. So you can restore Program Files folder all at once - if that works then restore My Documents folder and so on.
You may find that by restoring individually there may not be any corrupt files. But if there are, then you just select everything else except the corrupted file - you can use drag and highlight to speed things up. A little bit tedious but at least you can get all your files back from a bad .stg file.
BTW, the file you mentioned is in Pegasus Databases which are system files
Have you used the program yourself Ian? If so could you please help me with the restore folder button.. when I select a folder, then the restore folder option on the menu, nothing happens. This is very frustrating!
Also, when I extract the files from the pegasus database and put them on the phone, the pegasus folder shows in the phone's file manager (obviously, because I just put it there). How do I restore them to the (presumably hidden) folder, where they are meant to be?
I appreciate all help on this matter, all I need back are my contacts, appointments and message data etc, the rest I can start afresh with.
No I have not used this to restore an entire phone, only to retrieve individual files. It does sound like you will need to start afresh and just use STGViewer to recover personal files from My Documents etc. Most installed programs in Program Files will work fine if restored via STGViewer- there is often no need to actually use an installation program as many programs work as standalone folders.
If you have synced with your PC previously, all your contacts, notes and messages will be in Microsoft Outlook so you can use Activesync to restore these back onto your phone. (assuming you had opted to sync these items)
I would suggest in future that you use Xbackup in the Programs folder to regularly save your contacts/notes data into permanent Storage. I also from time to time make a copy of my .stg file so that I do not need to start anew if my current .stg file is corrupted. Good luck!

How do I return back to nodo after flashing the Mango Beta

I have a HTc Arrive that I flashed the Mango Beta on. That went fine. However, I'm trying to return it back to Nodo. I used this method update to Mango: http://windowsphonehacker.com/articles/get_the_mango_update_now._without_being_a_developer.-06-30-11
I have a backup in the Premangostate folder that's saved on C drive. But Zune doesn't recognize it or at least Zune doesn't display anything about an update...
The instrictions also state that if I want to manually restore the phone back to update do this:
Copy your backup in C:\PreMangoState to %userprofile%\AppData\Local\Microsoft\Windows Phone Update
However..I cant find "%userprofile%\AppData\Local\Microsoft\Windows Phone Update"
Can somebody help me please
Make sure you have "show hidden files and folders" enabled in your file view options so you can find the \AppData\...
"%userprofile% is your username.
I'm assuming that the "Premangostate" folder contains the GUID associated with your phone so you would copy whatever is in "PreMangoState" to %userprofile%\AppData\...
ScottSUmmers said:
Make sure you have "show hidden files and folders" enabled in your file view options so you can find the /AppData/...
"%userprofile% is your username.
Click to expand...
Click to collapse
I'll try that..
I know "%userprofile%" is my username..lol..thanks though
ScottSUmmers said:
Make sure you have "show hidden files and folders" enabled in your file view options so you can find the \AppData\...
"%userprofile% is your username.
I'm assuming that the "Premangostate" folder contains the GUID associated with your phone so you would copy whatever is in "PreMangoState" to %userprofile%\AppData\...
Click to expand...
Click to collapse
I see the Application Data Folder..but I'm getting the message access denied. And I am the System Administrator
Isn't there a restore.bat file that came from the same place where the intial files came from? That article you linked has it. Don't you just, hit that, and it'll restore?
If that a fails, next question would be what version of Windows are you running? Because these files are stored in different places depending on what version of Windows you are on. Those directions look like they were designed for people on Windows 7.
prjkthack said:
Isn't there a restore.bat file that came from the same place where the intial files came from? That article you linked has it. Don't you just, hit that, and it'll restore?
If that a fails, next question would be what version of Windows are you running? Because these files are stored in different places depending on what version of Windows you are on. Those directions look like they were designed for people on Windows 7.
Click to expand...
Click to collapse
Yeah...it is a restore file....I ran that it did a bunch of commands and that was it. It didn't do anything after that.
I was able to get into the file I mentioned in my previous also. I placed the PreMangoState file into the : \AppData\Local\Microsoft\Windows Phone Update
Went into Zune like it stated, clicked update and the only message I get is your device is up to date.
plmiller0905 said:
I see the Application Data Folder..but I'm getting the message access denied. And I am the System Administrator
Click to expand...
Click to collapse
make sure Zune is closed. open task manager and ensure all instances of Zune are gone (if you have multi user - log off the other party).
if that doesn't help, right click on the folder. click on security tab, in group or user names click on your profile name and edit. make sure full control is checked, click OK.
if that doesn't help
right click on the folder, click on the security tab, click on advanced, click on Owner, edit and add your User profile name to it and make sure Administrators are listed as well. click OK, OK.
edit: ugh, one minute too late....
your Zune will tell you that it's up to date, but there should be a restore button at the bottom with the date of the premango listed. you need to click restore....
if you were able to copy the contents of the premango folder over make sure it's not nested in the one that's in there. If it's not, check the size of the premango folder and report here. some people reported a size of 4kb, which apparently doesn't contain a true restore point. The folder should contain a bunch of numbers/letters. in that folder are two folders Properties and RestorePoint. You need to copy both of these into the folder with the same numbers/letters under your user/appdata ....Windows Phone Update folder
I ran the restore.bat script again and this time It looked like it was going to work then it said no backup found....
but when I check my C drive I do have a PremangoState file there...what the hell...
plmiller0905 said:
Yeah...it is a restore file....I ran that it did a bunch of commands and that was it. It didn't do anything after that.
I was able to get into the file I mentioned in my previous also. I placed the PreMangoState file into the : \AppData\Local\Microsoft\Windows Phone Update
Went into Zune like it stated, clicked update and the only message I get is your device is up to date.
Click to expand...
Click to collapse
after you have copy and pasted everything, you should have a couple of folders inside the directory:
In: \AppData\Local\Microsoft\Windows Phone Update
\j4nf3de3 - malp38d3 -mdkaa532 - eidg5324\
\j4nf3de3 - malp38d3 -mdkaa532 - eidg5324\Properties\
\j4nf3de3 - malp38d3 -mdkaa532 - eidg5324\Properties\properties.xml
\j4nf3de3 - malp38d3 -mdkaa532 - eidg5324\RestorePoint\
\j4nf3de3 - malp38d3 -mdkaa532 - eidg5324\RestorePoint\[another folder with random characters]
\j4nf3de3 - malp38d3 -mdkaa532 - eidg5324\RestorePoint\[another folder with random characters]\Data
The j4nf3de3 - malp38d3 -mdkaa532 - eidg5324 will not be named the same for you, as that is a unique ID for your device, so it should be in a similar format.
But anyway, you should have those additional directories in the Windows Phone Update folder. Then close Zune (if its open), and open it again, and hopefully that works for you.
The file I copied from the PreMangoState fFolder and placed into my Windows Phone Update is labeled:
d26046bb - 94fa8529 - 2df72a60 - 5f45d48f
I click that I then have 2 sub folders labeled:
Properties
Restore pont
In the properties Folder there is just a Propertiesxml file
In the Restorepoint folder there's sub folder labeled:
1A5C280B-6CCF-4E62-8F3C-AAD8A680B0D1
Then another sub folder labeled:
Data
Then Data files that goes from data.0.dat all the way to data.149.dat followed by a Manifest.xml file
plmiller0905 said:
The file I copied from the PreMangoState fFolder and placed into my Windows Phone Update is labeled:
d26046bb - 94fa8529 - 2df72a60 - 5f45d48f
Click to expand...
Click to collapse
see my post above....You have all the info that you need. If Zune doesn't show a restore option once you copied the folder over, it may be 0 size files? What's the size of the premango folder? It will tell you that it's up to date no matter what, but you should see a restore option at the bottom. anyways, good luck.
The file I listed above: d26046bb - 94fa8529 - 2df72a60 - 5f45d48f is only 550mb. So I'm sure that that's not my backup. However, there's another file also.
This one is labeled: 96bb2c9b - ef06a0d8 - ed24056b - 3db8f227 and is 4.22GB.
Now when I run the restore.bat script, in the command window I get the question:
Overright Cremangostate\96bb2c9b - ef06a0d8 - ed24056b - 3db8f227\Properties\Properties.xml (Yes/No/)
Which one do I pick?
maybe run the backup bat in administrator mode?
what os do you have?
ahlMAR said:
maybe run the backup bat in administrator mode?
Click to expand...
Click to collapse
you mean restore.bat?
plmiller0905 said:
The file I listed above: d26046bb - 94fa8529 - 2df72a60 - 5f45d48f is only 550mb. So I'm sure that that's not my backup. However, there's another file also.
This one is labeled: 96bb2c9b - ef06a0d8 - ed24056b - 3db8f227 and is 4.22GB.
Now when I run the restore.bat script, in the command window I get the question:
Overright Cremangostate\96bb2c9b - ef06a0d8 - ed24056b - 3db8f227\Properties\Properties.xml (Yes/No/)
Which one do I pick?
Click to expand...
Click to collapse
make a copy (backup) of both folders into a different directory (temp) before you continue. Give them a meaningful filename extension (nodo, mango). Then let it overwrite (or copy it over yourself with my instructions earlier). - and yes run the bat with admin rights as ahlMAR suggested.
DO NOT overwrite the premango update! it looks like that's what the program wants to do?
derausgewanderte said:
make a copy (backup) of both folders into a different directory (temp) before you continue. Give them a meaningful filename extension (nodo, mango). Then let it overwrite (or copy it over yourself with my instructions earlier). - and yes run the bat with admin rights as ahlMAR suggested.
DO NOT overwrite the premango update! it looks like that's what the program wants to do?
Click to expand...
Click to collapse
Ok..giving it a shot....give me a sec
I did everything you said and ran the restore.bat file and got the message, "No Restore Point Found"
plmiller0905 said:
I did everything you said and ran the restore.bat file and got the message, "No Restore Point Found"
Click to expand...
Click to collapse
screw the restore.bat file. copy the contents of the original premango folder over to your Windows Phone Update folder! Take ownership of the Windows Phone Update folder with the instructions in my earlier post.
derausgewanderte said:
screw the restore.bat file. copy the contents of the original premango folder over to your Windows Phone Update folder! Take ownership of the Windows Phone Update folder with the instructions in my earlier post.
Click to expand...
Click to collapse
Trying it now...
Man..thanks so much for helping me with all this I hope I get it back to Nodo
derausgewanderte said:
screw the restore.bat file. copy the contents of the original premango folder over to your Windows Phone Update folder! Take ownership of the Windows Phone Update folder with the instructions in my earlier post.
Click to expand...
Click to collapse
Ok...I ran it through and its absolutely No restore Button. At the bottom of the screen is an OK button and a Cancel button. But other than that, that's it.

[Q] Writing a file back to a Marketplace apps Isolated Storage?

Hi All,
I've used Heathcliff's WP7RootTools 0.9 to extract a file from an installed apps IsolatedStorage. The app in question was installed from the Marketplace, but I want to modify some of the files it's saved to it's Isolated Storage.
I extracted the file I wanted to edit by using the Explorer utility in WP7RootTools to copy the file to the "My Documents" folder, and renamed the extension to docx. From there I could simply go into the Office Hub, where the file was now listed, and emailed the file to myself.
I have made the edits to the file, but now need to get the file back into the app's Isolated Storage. This is where I have now got a bit stuck
I've tried copying the file to SkyDrive, and using the Office Hub to download it from SkyDrive to my phone. The file downloaded and is cached on the phone somewhere, but the file location, according to Office is not "Phone". This is normal, as Skydrive downloaded documents are not saved to the "Phone" location until you open the document and do "Save as".
I cannot of course open the downloaded file, as it isn't really a .docx file. Files loacted in the "Phone" location show up in "My Documents" in the WP7RootTools explorer. SkyDrive downloaded documents I have no idea where they are located?
Can you guys help? Does anyone know the path to location of SkyDrive downloaded items on the phone. If so, then I can easily just use the WP7Roottools Explorer to copy the file back to the apps Isolated Storage.
Is there a better way to copy a non-Office file back onto the phone?
Regards,
Micro666
You could use one of these apps:
sh4d0w86 said:
i was going to suggest using WPV App Data Backup, but it seems i saved the Backups in the wrong location... (will fix in next release)
so,
you can use TouchXperience or WMDC Launcher.
Click to expand...
Click to collapse
I'm looking to do the exact same thing....
Options:
1. Do exactly what you've been doing, but save as .txt instead of .docx. The phone can still open this, even though its probably a binary file, and save it to the "Phone" location. Then you can copy it back and rename it.
2. Use an app that gives direct access to the phone's filesystem from the PC, like TouchXperience+WPDM, or Root Webserver (see my sig)+your favorite webbrowser.
3. Use any other way to get a file onto the phone, such as emailing it to yourself, using IsolatedStorageexplorer, or putting it in a XAP files and installing that file. Then move the file with WP7 Root Tools.
I recommend approach #2.
GoodDayToDie said:
Options:
1. Do exactly what you've been doing, but save as .txt instead of .docx. The phone can still open this, even though its probably a binary file, and save it to the "Phone" location. Then you can copy it back and rename it.
2. Use an app that gives direct access to the phone's filesystem from the PC, like TouchXperience+WPDM, or Root Webserver (see my sig)+your favorite webbrowser.
3. Use any other way to get a file onto the phone, such as emailing it to yourself, using IsolatedStorageexplorer, or putting it in a XAP files and installing that file. Then move the file with WP7 Root Tools.
I recommend approach #2.
Click to expand...
Click to collapse
I used TouchExperience.
1.On my Fully unlocked Device(I assume you can do this with root tools), I installed a file manager that gives full access to the device.
http://forum.xda-developers.com/showpost.php?p=24636416&postcount=23
2. I installed TouchEperience on my PC. After giving the WP7 app, Root tools rights, it should show most of the file system(on the PC) but, not all of it. So I created a new folder in \Windows (temp).
3. On the Phone, I hunted down the file I was looking for from Isolated Storage, I copied it to the \windows\temp folder.
4. Used the PC TouchExperience and browsed to \Windows\temp, there was my files, I copied them to my PC. USed the File Explorer to delete the files in my \temp folder(to make sure they were gone).
5. I edited the files, copied them back to \Windows\Temp on my device via TouchExperience on the PC. Then used the file explorer to copy them back to the Isolated Storage.
Note: The file explorer I posted a link to is GREAT, it can even edit files (basic text editor) in Isolated storage. I found a way to Cheat on a marketplace Xbox live game (didn't try others), right before the achivements, so they were really easy to get
I'm sure there is easier methods but, this worked for me...
Can I ask, what app did you try this on ?
Hope this helped...
FYI DavidinCT: Cheating XBL games is very risky. Microsoft often can detect it (for example, if you get one achievement that would have required getting another first) and they can and will permanently ban your Xbox Live account for doing so.
That all said... why didn't you just use WPDM (on the PC) to copy the file straight to the IsoStore of the app? So much easier...
GoodDayToDie said:
FYI DavidinCT: Cheating XBL games is very risky. Microsoft often can detect it (for example, if you get one achievement that would have required getting another first) and they can and will permanently ban your Xbox Live account for doing so.
That all said... why didn't you just use WPDM (on the PC) to copy the file straight to the IsoStore of the app? So much easier...
Click to expand...
Click to collapse
To be honest, I only did it with a game that had an error when I got so far, so the final achivements of the game. A Game with a Known issue but, no fix.
And I just really wanted to see if I COULD do it...
I used WPDM but, the PC version even with my phone fully unlocked (custom rom on my VZW HTC Trophy) and using Root tools 0.9 to give full to TouchExperince root, would not see all the folders and would not see the IsoStore. SO I had to copy the files to a folder that WMDM could see.
Personally, the new File Explorer above is awsome, it's even got a editor in it, I didn't even need to go through all that......

[GUIDE] Merge Multiple Whatsapp Backup File Into One (No Root Required)

I am not sure if I post at the right place but I would like to share this to everyone as I understand how hard it is to find a solution that works. With this guide, you will get to keep the original WhatsApp message information (such as thumbnail, link, emoticon, etc.) and work like it is a restore file that backup from itself.
There will be three main phase you need to perform. You can get all required file in the attachment. Make sure you backup your end result before jump into the next phase.
Phase A: Decrypt and obtain msgstore.db file
This is the easiest method I can find and NO ROOT is required to perform this. All you need is to follow the instruction below.
INSTRUCTIONS:
Extract "WhatsAppKeyExtract.zip" (from attachment) on your computer maintaining the directory structure.
Browse to the extracted folder and click on "WhatsAppKeyExtract.bat".
Enable USB Debugging on your device.
Connect your device via USB**, unlock your screen and wait for "Full backup" to appear.
Leave the password field blank and tap on "Back up my data".
The "extracted" folder will now contain your "whatsapp.key", "msgstore.db" and "wa.db".
**If you have never used USB Debugging before, you may also need to verify the fingerprint.
(Credited to TripCode for providing this application! Here is the link to original thread.)
For my case, I have three backup files that named msgstore.db.crypt, msgstore.db.crypt7 and msgstore.db.crypt8. Although I know there might be other easier method to achieve this, I choose to restore each file (by uninstall and install WhatsApp) and run the above method to get my decrypted file. Hence I can be sure that all decrypted file will come in the same structure (I will show you what this mean later) and prevent any error that may cause by that.
Phase B: Edit and prepare database for merge
This will be a bit tricky. But in general, you MUST make sure that you have no overlapping message history between your files.
INSTRUCTION:
Download SQLite Database Browser and install on your computer.
Open the database you want to edit.
Click on [Browse Data] tab.
In Table drop down menu, click on [messages] (You will see all your WhatsApp message here).
Use it like you are using Excel, select any row that is overlapping (EXCEPT the row with many [-1] value) and click on [Delete Record], then click on [Write Changes] (this means you have save the change to the database).
Keep doing this for your remaining file and close all windows of SQLite Database Browser when you are done.
(Thanks ztedd for posting his own method where I get inspired from. This is the link to his original post.)
For my case, the number of column of all my file when display in "messages" table is different (newer WhatsApp database file have more data type). This is the reason I restore and run backup again to make sure all my file have the same structure. Also, a quick tips to figure out which row is overlapping or duplicate is export the messages table to CSV file and open it with Excel. You will need to copy the first few column of each database and paste them together, then use the feature that come with Excel such as Filter and Remove Duplicate to identify which row number you need to remove from actual database file.
IMPORTANT - Never edit your database on excel and import it back to your original database. This will remove all thumbnail, link, emoticon and etc. and show you some weird message when you restore back to your device.
Phase C: Merge database file
This method only can merge two file at once. You may need to do this several time depending how many database you want to merge. I suggest you start from the oldest to newest.
INSTRUCTION:
Rename the older file to old.db.
Rename the newer file to new.db
Create a new folder called Merge and copy the file old.db, new.db and merjapp.jar into it.
Run Command Prompt on your computer (or click on Start Menu and search for cmd)
In Command Prompt, type each of the following separately and press Enter:
Code:
cd desktop
cd merge
You now should see [C:\Users\<UserName>\Desktop\Merge>] in cmd window.
Now type the following and press Enter:
Code:
java.exe -jar merjapp.jar -old old.db -new new.db
You should see a "Done!" is displayed and a new file named output.db will be created in the Merge folder.
If you have other database to merge, repeat the steps above by rename the output.db to old.db.
Once you are done, rename the output.db to msgstore.db and it is ready to restore into WhatsApp.
(Credited to namnoops for this merge application! This is the link to original thread.)
For my case, I have to run this steps twice to merge 3 databases. I get error the first time I run this because some messages is overlapping and this is the reason for Phase B to edit my database. Once I got my merged database, I renamed it to msgstore.db (without encrypt again) and have no problem restore back to my device. I also copy and paste all my backed up WhatsApp folder to my device (except the file in Database folder) for the picture in WhatsApp to work.
Disclaimer: I do not know any coding behind all these so if you have any questions I will try to answer but the best bet is to go back to the original thread.
Below is some other method that I found online but can't figure out how to do it. You may try it at your own risk.
Additional Method:
sch3m4's wforensic Method
Alternate sch3m4's wforensic Method
Reserve for later use.
Reserve for later use, again.
How could i restore the merged database file ?
Xperia000sola said:
How could i restore the merged database file ?
Click to expand...
Click to collapse
I think you should overwrite new merged DB uninstall whatsapp then reinstall it
Thank you! I' ve tried the method in the thread of the merge tool, but your procedure did the trick for me =)
i cannot use it
help us with video please
big fail after attemped retrieve msgstore.db
when tested edit under sqlitebrowser, save change then exit. copy backup the "msgstore.db" file to my device original place and set permission as before. run whatsapp then all my message on list has been gone. no idea wut happen. even though i copy back my original msgstore.db to same place. so **** and make me down becoz i forgot to backup the list b4 make this test.
i use whatsapp ver 2.12.367. and dun add or del row under sqlitebrowser, only retrieve some text on same row, but why i copy back the original msgstore.db also fail? lost all message
While it might not be a lot of fun, it's quite easy to merge those databases using this method
I have used the Android WhatCrypt-app to decrypt my databases on the smartphone, copied both unencrypted ones to my PC and then trimmed the newer one down.
After merging, the only problem was getting Whatsapp to accept my database - the first attempt resulted in Whatsapp deleting all my messages.
My solution was to "Clear Data" on Whatsapp and simply drop the newly created database in Whatsapp's folder inside /data.
It accepted the new file and created the missing files by itself.
Now I have finally got all those messages in my Whatsapp
Thank you very much!
Hey,
I have a problem : everytime I try to do the last step e.g. merge the old.db and new.db via cmd - i get the error message " -E- Database old.db cannot be found! " . I renamed the old database to "old.db" still it doesnt work? What I am doing wrong?
Is my old.db file corrupted? I can read it with Whatsapp Viewer tool.. So it seems to work.
And there shouldnt be any overlapping messages - I have an old database and a fresh new one without any old backups.
(my old phone broke and i just jused the new one for the incoming messages)
Help
Hi,
I just wanted to ask, I have the msgsstore.db.crypt8 File from my old whatsapp back on older device but I am unable to copy it to the database folder in my new device.
Help Please
Guys I have 2 backups, 1 crypt9 and 1 crypt12. I decrypted and merged both succesfully but when I try to restore my messages through Whatsapp it tells me "Cannor restore your messagges......." . What can be the problem? Whatsappviewer open without problems outout.db, so I think it is not corrupted. There may be some overlapping msgs? How can I notice them? I whatched the table column received_timestamp and I didn't see any equal row. However the column timestamp has multiple equal column, can be this my problem?
Thank in advance
Now I'm on phase B, and with the DB Browser for SQLite, I opened (tab Browse Data) the msgstore file in the "extracted" folder and then selected messages In Table drop down menu.
I didn't not understand what to do next.
DLz88 said:
Now I'm on phase B, and with the DB Browser for SQLite, I opened (tab Browse Data) the msgstore file in the "extracted" folder and then selected messages In Table drop down menu.
I didn't not understand what to do next.
Click to expand...
Click to collapse
You would need to delete the records you do not want and then save the changes. In any case, what is the end result you are trying to achieve? Do you wish to import the merged database back to WhatsApp? Are the databases from separate accounts? If you intend to write back msgstore.db to /data/data/com.whatsapp/databases? How are you going to do that without root? If you do intend to use your merged database with WhatsApp then you may run into difficulties. Things have changed a lot since this guide was written.
I have previous crypted (crypt8) backup files from whatsapp database (same account) and I want to merge those old messages with others whatsapp messages I have on my LG G5. Basically my galaxy s4 died, I managed to rescue the whatsapp database and now I want those messages in my new LG G5 (no backup on whatsapp servers because it was setted off by mistake). The folder is inside the main storage/WhatsApp/Database Also, I want all the records and excel told me that there are not any duplicates values.
Don't work on Nexus 5X, show message like strong AES encryption. :'(
Guys, I have FINALLY found a way to merge two differten WhatsApp backup files. I'll post the guide asap (have to translate it). Is different from the one on the first page for the first two parts.
How to merge two different WhatsApp backup files:
We have two different WhatsApp backup file (doesn't matter if encrypted by different methods, for example, I had a crypt9 file and one crypt8) and we want to combine them into one so we can read them with WhatsApp.
Requirements: OS: Windows Vista, Windows 7 or Windows 8
Programs you need:
1) WhatsApp Xtract: http://forum.xda-developers.com/showthread.php?t=2770982
2) SQLite Database Browser: https://github.com/sqlitebrowser/sql....2.0-win32.exe
3) merjapp (merjapp.jar) https://github.com/namnoops/merjapp/releases
4) JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
5) Java: https://www.java.com/en/download/
6) ADB (Android Debug Bridge) Drivers - If not installed: http://developer.android.com/sdk/index.html
Enable USB Debugg: Settings \ Developer options \ USB debugging (to activate them go to Settings-> About phone-> Software Information-> click many times on the Build number).
Before proceeding further, I suggest to temporarily remove all security protocols such as pin, lock screen with a sequence or other method and scanning fingerprints. In order to avoid the forced backup password.
I also suggest to make the extension of the files, visible (on windows, go to Tools-> Folder Options-> View-> uncheck "Hide extensions for known files").
First phase: decrypt
Extract the "WhatsAppKeyExtract.zip" program in a PC folder, making sure to maintain the folder structure.
a) Start "WhatsAppKeyExtract.bat"
b) Once started, connect your phone via USB, unlock the screen.
c) Wait until the screen that tells you to back up your data appears.
d) Leave the password field blank and click "Back up my data".
e) When finished, inside the "extracted" folder (located inside the WhatsAppKeyExtractor folder) you will find the files "whatsapp.key", "msgstore.db" and "wa.db". (That's if the latest versions of whatsapp).
At this point I recommend to save these files in a folder, calling it "new backup."
Now we must do the same process with the old backup, then:
Uninstall Whatsapp.
Remove all backups from the folder Whatsapp\databases (inside the phone).
Put back in the old backup file ( "msgstore").
Reinstall whatsapp, and let it reopen old messages (restore backup). When done, remove the connection data from the phone (both wifi, and UMTS).
Redo the same procedure as before, from point a) to e).
Save these new files "msgstore.db" and "wa.db" in a folder, this time calling it "old backup."
The first part is finished.
Second phase: organizing the chat
Before you start, create backup copies of previously decrypted file (you never know).
Open SQLiteBrowsers, position yourself in BrowseData tab and select Open Database. Choose the old backup file msgstore.db (that previously we have decrypted).
Click the lower Tab, select "messages".
With the scroll menu, go down to the last message. Here, count the "_id" number of the last message, for example "65422"
Open the new backup file (the new msgstore.db we had decrypted) always with the SQLite Database Browser program. By the same process: open the inferior tab and select messages. Highlight entirely the first line that has the fields, for the most part, containing the value "-1", and delete the line with the Delete Record command.
Make a note now of the number of the first message, under "_id" for example "12"
Now go in the tab "Execute SQL" and write the following string: UPDATE messages Set_id = (65422 + 1 + _id - 12) (put the numbers that you had marked earlier, in this case 65422 and 12). Click ExecuteSQL ( "Play" button)
Close SQLiteBrowers.
End of the second phase.
Third phase: merge
Create a new folder on your desktop called "merge".
Rename the old backup file (the msgstore.db file that is inside the "old backup" folder) that we had decrypted, in old (so we have the file old.db).
Rename the new backup file (the msgstore.db file that is inside the "new backup" folder) that we had decrypted and on which we had executed the SQLiteBrowser string, in new (so we have the file new.db).
Copy and paste the two files in the directory "merge".
Copy merjapp (merjapp.jar) in the "merge" folder.
Now run the command prompt as an administrator.
Enter the following commands:
cd C: \ Users \ [username] (press "ENTER")
cd desktop (press "ENTER")
cd merge (press "ENTER")
java.exe -jar merjapp.jar-old old.db -new new.db (press "ENTER")
It must appear "Done!"
At this point in the "merge" folder there must be a file called output (output.db file)
Copy it in desktop and rename it msgstore (so we have the msgstore.db file).
Open the phone's internal memory, go into WhatsApp \ Database folder, and delete all the files that are in there.
Copy "msgstore" (the msgstore.db file that was named output) in the folder Whatsapp \ Database.
Uninstall and reinstall WhatsApp (obviously choosing to restore backups).
END
DLz88 said:
Guys, I have FINALLY found a way to merge two differten WhatsApp backup files. I'll post the guide asap (have to translate it). Is different from the one on the first page for the first two parts.
Click to expand...
Click to collapse
Many thanks for finding the time to post your updated working method. I'm sure your contribution will come in handy for many users.
Hi. With this tutorial can I merge 2 backups from different numbers? Basically I would like to move the conversations from my second number to the first number I have.
Thanks.
foxmolder1985 said:
Hi. With this tutorial can I merge 2 backups from different numbers? Basically I would like to move the conversations from my second number to the first number I have.
Thanks.
Click to expand...
Click to collapse
I don't know if my guide can works with backups from two different numbers. You can always try it and let us know

[GUIDE] Extract and Restore Contacts, SMS, Call logs from nandroid backups(TWRP)

So yesterday My phone, Sony Xperia S, decided to go into bootloop and not boot at all, no matter what I did. Tried flashing stock PRF, stock firmware, some stock based firmware, but it would get stuck in bootloop. The reason for this being I was not formatting the data partition, which I needed to preserve since it had all My sms, contacts, call logs and other app data. Luckily, I had a working recovery(TWRP) and was able to take a backup. Then using I was able to recover My contacts, sms, call logs and app data. After a lot of Google searches, I was finally able to work it out. The process is as follows:
Needed software:
Code:
yaffs-mmssmsdb-calls-extractor.zip from [URL="http://forum.xda-developers.com/showthread.php?t=1585957"]here[/URL].
Firefox Browser
Firefox addon of SQLite manager : [URL="https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager"]link[/URL].
Excel macro to convert .db contacts to .csv : [URL="http://thydzik.com/downloads/convert-contacts2.db-data-to-vcard-vcf.xlsm"]link[/URL].
Software for csv to vcard conversion (Windows) : [URL="http://www.csvtovcard.com/"]link[/URL].
CSV to vcard conversion (online) : [URL="http://labs.brotherli.ch/vcfconvert/"]link[/URL].
SMS Backup & Restore android app : [URL="https://play.google.com/store/apps/details?id=com.riteshsahu.SMSBackupRestore"]link[/URL].
Call Log Backup and Restore app : [URL="https://play.google.com/store/apps/details?id=com.riteshsahu.CallLogBackupRestore"]link[/URL].
The procedure is a lot crude as of yet, I would update as more universal and convenient options are found.
I know there is Titanium backup app which can restore contact, sms etc from nandroid backups, but You need a paid version of the app.
First we need to extract the data partition of nandroid
Rename the data.ext4.win to data.ext4.tar.gz . If Your files are like data.ext4.win000, data.ext4.win001, then rename each of them to data.ext4.tar.gz in separate folders.
On windows, now You can directly extract them using WinRaR or 7zip application, although You don’t need to extract it entirely.
On linux, You can do so using the following command. It is recommended to store the file in a separate folder as the file gets extracted directly.
Code:
tar –xf data.ext4.tar.gz
Now we need to find two files contacts2.db and mmssms.db . The contacts2.db files is for contacts as well as the call logs and the mmssms.db is for messages. The contacts2.db is constant across most ROM’s and OEM firmware apps. The mmssms.db file may vary as per app and ROM’s. So what You need to do is look for a .db file inside the SMS app You have been using with the firmware/ROM.
We will restore the SMS and Call logs first.
Currently it is limited to Windows OS only.
Extract the contents of yaffs-mmssmsdb-calls-extractor.zip to a folder.
Copy the mmssms.db file and contacts2.db file to the above folder.
Now open a command prompt at location of the above folder. This can be done by opening the folder, right clicking using shift key pressed in blank space. You get the “Open command window here” option.
In it type:
Code:
extract -s mmssms.db
It will ask You to enter a name for the output .xml file, You can press enter to let it give a default name. This will convert Your sms to a .xml file .
Then type:
Code:
extract –c contacts2.db
It will also ask You to enter a name for the output .xml file, You can press enter to let it give a default name. This will convert Your call logs to a .xml file .
Copy both of these files to Your newly formatted phone and then use the two before mentioned apps (Call Log backup& Restore and SMS Backup & Restore) to restore Your SMS and call logs.
Now retrieving contacts. It is a bit lengthy, but simple process.
Start firefox browser. In it, after You have installed the addon do following to enable the addon
Go to options (3 horizontal lines).
Select “Customize” and drag the “SQLite Manager” to the blue bordered box.
Now open options and select SQLite Manager. In it select Database>Connect Database. In the opened dialog box, select All Files(*.*). Then select Your contacts2.db .
From the left side tree structure in the SQLite Manager window, right click on “data” and select “Export Table”.
Now in right side part of the window, You will get CSV tab and SQL tab. Under CSV tab, simply press OK button without changing any other options.
It will ask You to save Your .csv file. Save it.
Now if You try to open this file directly, You will notice that file is not properly arranged.
To arrange it properly, open the convert-contacts2.db-data-to-vcard-vcf.xlsm file. If You don’t know how to enable Macros don the following:
It will show You a warning “Security Warning Macros have been disabled. Options..”
Press the Options button. Select “Enable this content” and press ok.
Now Press the office button present at left top corner. In it select “Excel Options”.
Select Customize tab from left side. Then from “Choose commands from:” drop down menu, select Macros.
Now add convertDatatoContacts and writeContactstovCard to right pane from left pane by selecting them and pressing add. Press OK button.
Now as You can see two white square icons have been added at top right corner next to save undo redo options.
Select the first white square icon. Select “Enable Macros” button. Now select Your .csv file in the opened dialog box.
Now the file must have opened in a separate excel. The format should be 4 rows with they being First Name, Last Name, Phone 1 and Phone 2.
Then select Save As>Excel Workbook>Save Type as CSV(Comma delimited).csv . Press ok and yes on the two warnings generated.
At the left bottom, right click on “contacts” sheet and press delete. Save and close the file.
Run CSV to vCard software and open the above saved .csv file. Here You can save all contacts as single vCard file or separate files.
In the “Properties” section on the window, in front of “Phone 1” and “Phone 2” select “Mobile Phone” from options. Press “Convert” button.
Alternative to above two steps, You can also convert .csv to vcard using the website.
Now a .vcf file will be created where the .csv file was stored.
Now simply copy the .vcf file to phone and import using the phone contacts app!
Done!
Credits and sources:
@abbot2
[TOOL] yaffs extractor, mmssms.db & contacts2.db converter
http://thydzik.com/export-android-contacts-contacts2-db-to-vcard-vcf-on-windows/
Reserved.
Awesome concept
Thanks for posting this! Im working on a sprint S4 that is bootlooping. ive extracted all data and am attempting to recover contacts with your method. I am getting an error with the yaffs extract.exe that im hoping you could give me some direction on.
**EDIT**
I was never successful using yaffs (dependency issue perhaps) but i downloaded firefox and was able to extract everything with the sqlite extension. THANK YOU!!!! This tool is one of those things you dont need often, but when you do it's a godsend!
when i issue the contacts extraction command i get this output
C:\Users\PartSwap\Desktop\DB_xtract>extract -c contacts2.db
Read 0 calls
Failed to extract calls: list index out of range
contacts2.db is present in the yaffs folder.
Any ideas/suggestions would be greatly appreciated!
This doesn't work anymore, just puts 0 in all of the phone number fields, you can even see the numbers before hand, just jumbled up, so this script needs to be updated.
Stillworks July 2020
This worked in July 2020 to restore SMS messages (I didn't need contacts). I tried to restore selectively from a full OrangeFox (OF) NANDroid backup (a full restore didn't work, encryption/password issues) with Titanium Backup (TB), but this didn't work (maybe I simply didn't know what to restore?). I tried the old Nandroid Manager's facility to restore SMS from a NANDdroid backup, but it hung.
I then successfully extracted mmssms.db as described here and further extracted the xml file with the yaff extractor. TB's "Restore data from XML" hung, but SMS Backup & Restore worked fine.
Xiaomi Redmi Note 7 (lavender), all software current as of July 2020: xiaomi.eu 20-07-23 weekly ROM, TB 8.4.0.2, others downloaded today. A useful way to find the SMS file if it has a different name than mmssms.db: after extracting from the tar.gz, search the extracted files for a string that only appears in your SMS (I used "bekonscot").
Incidentally, a note on Titanium Backup, which can restore either from its own files or a NANDroid backup: the directory for the NANDroid file is hard-wired to the directories used by TWRP and CWM. I use the current OrangeFox instead of TWRP, and it uses a different directory. But the OF backup is compatible with TWRP; moving it to /storage/emulated/0/TWRP/BACKUPS/ works.
HTH
I used a Note 4 (Android 6) full nandroid to Note9 (Android 10). For contacts I just copied the .db to the new location (the directories where .db are located might not be the same) and rebooted - it worked (on rooted), but this will remove any contacts already made, replacing them with the backup.
SMS and Call logs were restored as described, but I used a newer version of the app (which combines both SMS and logs restoration), searched the backup archives with ZArchiver, and I ran the python2 version of the converter (https://github.com/abbot/android-restore-tools) on TermuxArch (meaning that, unlike the Windows version in the tutorial, this should work on any OS supporting python2, allowing me to do all steps on my phone).
Also, in the directories where. db files are located there are big .db-wal files, too, which might contain some data that aren't in the .db yet, so you might need to VACUUM with sqlite3 (https://stackoverflow.com/questions...f-sqlite-3-7-wal-file-into-main-database-file). I did it on TermuxArch as well, but the size of the db didn't change much, while the wal disappeared, so I don't know if that did anything.
P.S. Sqlite3 wouldn't open db at all just on Termux for some reason, opened on TermuxArch. Python2 also exists for Termux, didn't try but should work.

Categories

Resources