yashsingh1/xdaforums huggingface dataset:
[Android General] psychem:
Some additional instructions need to be added for clarity after the merged msgstore.db file has been created (POST STEP 3)

1. uninstall whatasapp

2. reinstall whatsapp

3. do not proceed with "agree and continue" installtion

4. go to /data/data/com.whatsapp under DEVICE option of ES file explorer after enabling root

5. "database" folder would be found at that location with proper permissions and 2 job queue files

6. now copy the msgstore.db only.

you need to copy back all the media files to the whatsapp folder too.

after this proceed with normal installation of whatsapp from step 3
[Android General] duncan.wick:
I have issues extracting the key on my nexus 5.

I'm using the latest Java (8 101), adb is installed. I don't think that I have a password set although I'm not entirely sure. where can I check? In the developer options the password is empty.

I'm getting a couple of errors:

Then it's just deleting all the tmp files and exiting and the extracted folder remains empty. I was considering rooting to get the key but I don't want to lose all my files.

Also I never get the Full backup prompt on my phone
[Android General] Jeferex:
For those having problems with WhatsappCryptKeyExtractor, download the new version from http://whatcrypt.com/ and test if it works.

I confirm it works with crypt12 files.
[Android General] gds06:
i want to transfer my chat history from windows phone 10 to android ....and merge with the old chat history of android that i had saved on my pc....plz help how do i convert wp10 backup to android
[Android General] mmsind:
closes abruptly

hi there, I'm facing a problem here.

After I connect my device to desktop and verify fingerprints it just after a couple of seconds ends itself abruptly, without showing any error code. Help me please. Device- Mi Pad, Platform- 4.4.4
[Android General] Elygor77:
I'm having the same problem...

It just says syntax error. Is there any solution for it? Tried with Samsung Galaxy S6 Edge.
[Android General] smartcartman:
I have the andriod whatsapp backup, is there a way to merge the backup to my current iphone ? I have been using the iphone for a year but I want to see the chat history
[Android General] paumlhp:
is there a rooted tutorial?
[Android General] kashifrazzaq20:
thanks for share

thanks for share this method i am looking for this trick
[Android General] hhgill90:
Is there any way to merge 384 db files into one?

Or is to be done with only the ones that are in the phone?
[Android General] laranja01:
tested and worked, many tanks
[Android General] goister:
I'm having trouble with WhatsAppKeyDBExtract on my new Google Pixel. It works on my Nexus 5 but not on the Pixel. Here's the output:

WhatsApp 2.17.17 installed

Found legacy WhatsApp 2.11.431 in local folder

Backing up WhatsApp 2.17.17
3843 KB/s (27902400 bytes in 7.089s)
Backup complete

Removing WhatsApp 2.17.17 skipping data
Success
Removal complete

Installing legacy WhatsApp 2.11.431
3873 KB/s (18329558 bytes in 4.621s)
Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
Install complete

Now unlock your device and confirm the backup operation.

Please enter your backup password (leave blank for none) and press Enter:

bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/f/key: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/db/msgstore.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/db/wa.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/db/axolotl.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors
bin\tar.exe: Record size = 2 blocks
bin\tar.exe: apps/com.whatsapp/db/chatsettings.db: Not found in archive
bin\tar.exe: Error exit delayed from previous errors

Cleaning up temporary files ...

Deleted file - C:\Users\user\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\whatsapp.ab
Deleted file - C:\Users\user\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\whatsapp.tar
Deleted file - C:\Users\user\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\waplen.txt
Deleted file - C:\Users\user\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\sdpath.txt
Deleted file - C:\Users\user\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\wapath.txt
Deleted file - C:\Users\user\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\wapver.txt
Deleted file - C:\Users\user\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\sdkver.txt

Done

Restoring WhatsApp 2.17.17
4248 KB/s (27902400 bytes in 6.413s)
Success

Restore complete

Removing WhatsApp 2.17.17 temporary apk
Deleted file - C:\Users\user\Downloads\WhatsApp-Key-DB-Extractor-master\tmp\base.apk

Operation complete

Press any key to continue . . .

The extracted folder is empty after this.
[Android General] Gray_k:
HELP (I get Syntax Error in DB Browser for SQL)

UPDATE messages Set_id = (65422 + 1 + _id - 12)

the error message is (near "Set_id": syntax error:)

I don't know what's wrong

everything worked just fine

but the problem is here

---------- Post added at 11:32 PM ---------- Previous post was at 11:26 PM ----------

HELP (I get Syntax Error in DB Browser for SQL)

UPDATE messages Set_id = (65422 + 1 + _id - 12)

the error message is (near "Set_id": syntax error

I don't know what's wrong

everything worked just fine

but the problem is here
[Android General] Gray_k:
after the merge procedure it's not merging as it should be

after the merge procedure, it's not merging as it should be

when I retrieve it to WhatsApp the new conversations are there but the chats is empty

and the old one is fine

so what's wrong?
[Android General] ct8080:
Install_failed_version_downgrade

I am having the (INSTALL_FAILED_VERSION_DOWNGRADE) problem on a Nexus 5X. I'm on Android 7.1.2. Is it no longer possible to install the legacy version of whatsapp on 7.1.1 or higher?

Would really appreciate a fix for this as soon as possible as I have to send my replacement phone to Google.

Can anybody help?
[Android General] ct8080:
No one can help?
[Android General] JuanArg:
Gdfdggjhhhjhgkgzfgfxfggfffggliuiooi99uhhkkkjpoooihghvollhjjkllllkuhhhv zdighbjuiohouhjjiujijjkjuikkiuuuikpkkui8i9u
[Android General] gopinaidu77:
What ?
[Android General] JuanArg:
OH crap, that was my 2 yr old daughter
[Android General] gopinaidu77:
Lmao . What that cute doing out on xda:D:cool:
[Android General] PKLBTJF:
hi,

I tried to merge my old & new back up files, but it repeated show error message: "java.exe" is not recognised as an internal or external command, operable program or batch file.

I have few queries:

1. Is the step 2 is compulsory step? I have nothing would like to delete or edit on both of my old & new backup files (crypt12 file). Can i skip step 2 and direct merge the file at step 3?

2. My old & new back up files, originally named "msgstore.db.crypt12", so i need to delete & rename the file type name ".crytp12" become "old.db" and "new.db" only? Or i wrongly extract the file?

3. There is only 3 files will be saved in "Merge" folder, "old.db", "new.db" & "merjapp.jar", right?

4. I saw there is stated programmes needed included "java" and "JDK", as per mentioned in post #17. May i know when to use them? Is it save in "merge" folder as well?
[Android General] SkyTech74:
UPDATE messages Set _id = (65422 + 1 + _id - 12)

Try this one.
[Android General] DreamFlasher:
Thank you for this great manual!

I succesfully used this: https://github.com/EliteAndroidApps/WhatsApp-Key-DB-Extractor for database extraction even with crypt12. It's open source, so more trustworthy than whatcrypt

Step (2) is actually not necessary anymore, because merjapp takes care of increasing the indices now.

Merging works, DB Browser for SQLite shows messages correctly (from both backups).

Reinstall of whatsapp is also not necessary, deleting cache+data is sufficient.

The import of whatsapp correctly shows the date of the backup -- but then it only imports the old messages :( Does anybody have any idea what to do about it?
[Android General] panso77:
Hey all,

I figured out a solution to the problem of "UPDATE messages Set _id = (65422 + 1 + _id - 12)" not working.

It seems that the problem is that _id has to be unique (I either got the Syntax Error or the violation of the UNIQUE condition).

As I have no idea of SQL, I can only imagine that the problem is connected to the ordering of the updates (always smallest integer first) of the table with intermediate non-unique values.

So what I did is the following:

UPDATE messages Set _id = _id * -1

UPDATE messages Set _id = _id - 65422 -1

UPDATE messages Set _id = _id * -1

UPDATE messages Set _id = _id - 12

There has to be a better solution, which maybe someone who actually knows SQL can elaborate on. But as a workaround this does the trick.

Cheers

P.S.: Thanks to the OP for the nice tutorial :).
[Android General] GamezGuru:
I'm having the exact same issue on a Samsung S8, it fails to install the legacy whatsapp. Has anybody got this working on Android 7.0 or higher? I see DreamFlasher you didn't have this issue, is there something we're missing? Anybody managed this on an S8 yet?

cheers!
[Android General] m.a.r.k.i.94:
able to view msgs in whatsapp viewer but unable to restore

i have successfully merged 2 databases.heres what happened

1. whatsapp db got corrupted couldnt restore backups

2. repaired database after getting key using pycrypto

3.merged old database with new

4.still unable to restore db when installing whatsapp.restore gets stuck at 32%
[Android General] ymchazman:
Thanks and wanna know whether it works in the current. Anyway, will try it later.
[Android General] alptolga:
Hi,

Thanks I merged 2 db and finally renamed as msgstore.db. I coppied this file to android phone.

I uninstalled and installed whatsapp. but every time whatsapp connects google drive and download backup from google drive.

I couldn't manage to use merged db.

please help me
[Android General] tlew:
Will this merging include media files as well?

Should I just copy all media files into a the media folder, or how is it done?

Regarding the extractor, yes I got the same issue on my Xperia XZ that is running 8.0

But I was lucky still have my Xperia Z1, that has 5.0. So that part work. I hope the remaining steps will work as well. And I hope the media files will be included. That would make my day. I started this morning transferring whatsapp from Iphone to Android. And now the plan is to include a previous backup to get the full history.
[Android General] tlew:
The instructions by DLz88 in post 17 are still working, as long as your phone is not running on Android 7 or higher.

Phase 2 can (or actually should be skipped). Enough with phase 1 and 3. merjapp is handling the renumbering of the chats. However, that is if you don't have overlapping dates of your chats between your old and new backup. If dates are overlapping you might need to do some magic in SQlite browser. (For me that was not any issue though).

For phase 1 - decryption: Use a phone with Android 6 or less. 7 or 8 does not seem to work. The problem is when installing the legacy 2.11 which will not be allowed in Android 7 or higher. So look deep into your drawers, or buy an old Z1 compact (which is the phone I found in my drawer) :)

In phase 3 the correct command line is java.exe -jar merjapp.jar -old old.db -new new.db

(it was missing a space after merjapp.jar)

Afterwards you might need to have a rooted phone and follow the instructions in post 37

Or, if you have an old phone like me, just do a factory reset (do it as clean as you can. I used Xperia Companion on my PC which makes it totally clean installation).

For Media, just copy the two media folders that you have into a new folder. If it asks for replacing files, then just check what files it is (normally it is the .nomedia files).

Oh, and just so you know. The new version of whatsapp does not allow you to backup from a local storage on your phone. You need an older version of whatsapp for that. Here is a link to 2.17.422 that will work.
[Android General] yorab:
Whatsapp Doesn't Recognize db File

Does anybody still read this thread?

I'm all good until the very last step--reinstalling WhatsApp. My merged database is good because I can read it with WhatsApp Viewer. The merged database includes old chats plus recent chats--exactly what I was aiming for. I've named the merged database file as msgstore.db and I've copied it to my phone's WhatsApp>Databases folder. I previously removed all other files within the Databases folder, so the newly merged file is the only one in there. When I reinstall WhatsApp, all my previous chat group names are there, but no data inside the chats. Does the database need to be converted to a .crypt12 file?
[Android General] yorab:
Ok, I missed the last paragraph in #66 the first time around. I subsequently installed the previous version of WhatsApp from that link in #66 and now WhatsApp will accept the merged database from my local folder. I can confirm that this overall method of merging 2 databases works on a Xiaomi Mi 4 as of March 7, 2018. :good:
[Android General] bluri:
Is this possible anymore?

Have Oneplus 3 & Sony Z5 Compact where I have vital whatsapp-info in both.. Bought Oneplus 6 and would like to merge both backups to new phone..
[Android General] XP Mai:
I'm getting a new Note8, and I'll transfer WhatsApp messages from my existing phone (iPhone 6S) to Android with a 3rd party app. I still have my old WhatApp history from my predecessor Galaxy S4 (>3 years ago) and I want to merge it into my Note 8 as well.

This involves different Android versions and WhatsApp versions (significant differences, including encryption). Will this be viable for me?
[Android General] Kelvin-Note2:
All:

I feel that I am VERY close to solving this, but I am needing a fresh set of eyes from someone that can assist, please. As like everyone else, I am attempting to merge 2 separate Whatsapp dbs. I have the new db, and scrubbed the old db using a SQL script to remove exists chats and renumbered the _ids so that it follows sequential order of the new db _id to avoid overlap. The way I am understanding this merge process would be akin to an INSERT SQL command, where we are just appending to the new db. I am at the MERGE process and I am encountering a JAVA error. Initially the error was because I had a old version. I updated to the latest JAVA version, which cleared up the first error, but now, I am getting the attached error. Can someone provide a solution, please? Be Blessed
[Android General] jult:
I would like to know as well. I have about 5 separate WA instances, some very old (from the earliest versions of WA) that I would like to merge into 1 large complete one. Or perhaps convert to html output including media.

Isn't it strange they (WA) don't provide a tool for this yet? I bet there's big money in that, and for WA it would be a piece of cake to develop. If they'd offer a tool, I'd easily pay a 1 time fee to be able to successfully merge old and new WA data.
[Android General] smileede:
I'm having trouble merging the new and old db. A java error is thrown:

C:\Users\JK\Desktop\merge>java.exe -jar merjapp.jar -old old.db -new new.db
Exception in thread "main" java.lang.SecurityException: Prohibited package name:
java.sql
at java.base/java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)

at java.base/java.net.URLClassLoader.defineClass(Unknown Source)
at java.base/java.net.URLClassLoader.access$100(Unknown Source)
at java.base/java.net.URLClassLoader$1.run(Unknown Source)
at java.base/java.net.URLClassLoader$1.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:56)

C:\Users\JK\Desktop\merge>java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

any ideas how to solve this problem?
[Android General] kaartiikoffl:
WhatsApp wont read backup file

Hi, I managed to do everything. But, WhatsApp won't read my new merged backup file after reinstalling it. Help on this pls.. thx
[Android General] rrger:
Same here! Managed to merge my two files but tried to copy them in /internal storage/Whatsapp/Databases but Whatsapp doesnt recognize it.

According to post nr. 37 ( https://xdaforums.com/showpost.php?p=67802006&postcount=37 it has to be copied somewhere else but needs to be rooted?

Is there any way to restore the merged file without rooting my phone?
[Android General] Jacte:
Same problem here. I think the databases we created don't compatible with the new versions of WhatsApp. But it's impossible to use older versions of WhatsApp because it tells you to update. What can we do now? I need my old chats from my broken phone. :(

Edit: I've spent my night on this and I think we need to encrypt the databases we created again in crypt12 format. WhatsApp only recognizes those files. But tried to reinstall/install WhatsApp so many times and it doesn't send me a SMS code or phone call for several hours. Now I think it's time to take a break. That's what I tried so far:

1- Tried WhatCrypt tool to encrypt the database but it didn't work (it gives a .crypt file and changing its name to .crypt12 doesn't work). I think we need to encrypt with the keys but how?

2- Tried to change phones time to use an older version WhatsApp but it told me to update again.

3- Tried APK Editor to edit the .apk of old version of WhatsApp but again, it forced me to update.

I need help on this.
[Android General] iCstyle:
I ran into same problem and found a solution using YoWhatsApp. It has an internal App-Data backup, then you can inject modified msgstore.db and restore backup. All without root. This way you can also experiment without the need to verify always your number.
[Android General] Jacte:
Do I have to use this app always or just one time to get my backups?
[Android General] iCstyle:
No, after you're finished you can make a regular Whatsapp Backup (which generates a crypt12 file) and restore it in normal Whatsapp version. Just use the regular YoWhatsApp version (com.whatsapp package, not the ones for 2nd and 3rd number), this one uses the same paths as regular WhatsApp version so you don't have to fiddle around with the folders and files.
[Android General] Jacte:
Thanks a lot. Is this app safe?
[Android General] iCstyle:
I'm using it since 1 year without problems. Just download it from official site (1st link in google).
[Android General] Jacte:
Thanks again. I'll try it soon.
[Android General] mdd726:
How to Extract WhatsApp Media Files from Google Drive

How to Extract WhatsApp Media Files from Google Drive

Just saving YouTube link =QagLmNuh8Q0
[Android General] vie2004:
I tried WhatsApp as well as YoWhatsApp and neither will load the newly created "msgstore.db" file.

Anyone with an idea on how to get the merged database to be recognized by WhatsApp?

Thanks in advance!
[Android General] alisj99:
same here, I think in YoWhatsapp you need to create a backup (as titanium backup) then replace the msgstore.db in the created folder with the one you created.

then restore. I myself failed but I didn't try enough till I got in the verification issues.

I will try again after sometime
[Android General] Ntress:
Hi, can you help me?

I have 2 backup files to merge and I tried that .bat file in the first post and it did nothing

While I tried to open the crypht12 file in SQL DB it asked for password and it doesn't accept my 2fa password..

what should i do ?
[Android General] Nite.Achilles:
Hi has anyone tried restoring their msgstore.db (unercypted) successfully?
[Android General] Tech Insta:
superb! is this safe ??
[Android General] Nite.Achilles:
Hi

I tried to put the db inside the data/data/com.whatsapp....

Whatsapp sees the backup but when it tries to restore it

It goes all the way to 25% before failing and says it can't restore from that

How do I fix this?
[Android General] iCstyle:
You can't restore unencrypted msgstore.db with "official" WhatsApp Backup/Restore process (since about 1-2 years or so). You have to inject msgstore.db to WhatsApp-data-folder (with root for example), or if you can't/don't want to root, use YoWhatsApp and use it's own implemented restore process (found under YoMods). This way you can also extract your key, which is the only method without root (AFAIK).
[Android General] gh-thomas:
I just merged two unencrypted databases successful, but the “new” one doesn’t show quotes and thumbnails now. And I’m not sure about the emojis.

This is because the WhatsApp database style changed and merjapp is outdated.

The sch3m4's wforensic Method worked even worse, as there were all conversations from new contacts from the latest .db missing.

It's a pity that there is information missing in the merged database.

I haven’t found a complete merge solution in 2019.
[Android General] Amitdhanuka:
Yes

But i have no idea who can I merge two & three whatsapp backup file in my new device

Pls help me

I will pay charges for it

Amit dhanuka

Fatehapur shekawati

Sikar rajasthan

India

Mobile:-9571137171

Mail id:-amitdhanuka1992@gmail.com
[Android General] gh-thomas:
Yes, it works.

You need root and your unencrypted msgstore.db file. And you perform everything in flight mode.

With an encrypted msgstore.db.crypt12 it’s easy. You just put it in whatsapp/databases on your storage and restore the backup with WhatsApp.

Your unencrypted msgstore.db should be also placed in that folder for a successful restore.

In that case you need a functional WhatsApp installation. (could also be an old Titanium backup)

Then you force stop WhatsApp and copy the unencrypted msgstore.db from whatsapp/databases to data/data/com.whatsapp/databases. (you can replace the msgstore.db there) The file should be in both folders now.

Now start WhasApp and let the app restore all your messages. It could take some time or stuck at 25% for a while.

In the end you have your unencrypted msgstore.db restored and can create an encrypted backup through WhatsApp again.

I hope it also works for you.
[Android General] Harshad.Dike:
I was successfully able to do all the above steps and restore my merge whatsapp backup via YoWhatsApp. But, I noticed an issue with the merged msgstore.db file. After restoring the chats, they were not organized properly. Chats from different people and groups were merged randomly. For instance; replies to messages in group 'A' were showing in chat of person 'B and so on'.

Maybe this can be a sync issue or an indexing issue. I can see media files have been carried forward correctly and time stamps on the older chats (old backup) are correct but then there are no time stamps on new chats (new backup)

I checked the _id in chats and there are no overlapping ID's on anyone.

Is there a way to fix these chats or the backup file by any kind of tool.
[Android General] sheikh780:
Help

Dear All,

Kindly help me to do the same.

I am facing issue with the SQL command,everytime it shows Syntax error.

Anyone here can merge two databases for me.

FYI : Both databases are encypted by DBCRYPT12 encryption.
[Android General] sheikh780:
Hello All,

I am facing issue with the SQL command in SQlite DB browser.

Anyone who can help in sorting out this issue.

For ready reference,databases i am trying to merge are both having crypt12 encryption.Old one isn't having 'Revoked' and 'Revoked messages' column in database.

Suggestions awaitef from anyone who had done this successfully earlier.