yashsingh1/xdaforums huggingface dataset:
[Android General] Kettlebells:
If you had a WA back up that kept failing. Could you just do steps A & B for this?

Mine locks at 0200 each morning when doing local back up?
[Android General] Samir2298:
Does this method still work on latest whatsapp version on android 13?
[Android General] omeganitish:
Is this method working in 2022 ?
[Android General] omeganitish:
I tried bro , it's not working
[Android General] Samir2298:
Ohk. Have you found any method to merge?
[Android General] tanuj1234:
Will this process work now, 2023
[Android General] maahmoud.samir:
does it work with you ?
[Android General] waqashexatt:
Here I have an android Application Fouad Whatsapp that has exceptional features as compared to the official version. Can I use this Whatsapp to back up my files and media?
[Android General] paul_007000:
When I enter my own values in 'UPDATE messages Set_id = (65422 + 1 + _id - 12)' I get the response:

Execution finished with errors.

Result: UNIQUE constraint failed: message._id

At line 1:

UPDATE message SET _id = (34670 + 1 + _id - 2)

I realise I'm answering a 7 year old post but I wondered if anyone has any ideas on how to actually merge two decrypted whatsapp databases?
[Android General] KeTuRr74:
Hello guys, after unsuccessfull attempts to merge two database via all those tutorial i finally found a way to restore using this forensic tool.

GitHub - AvillaDaniel/AvillaForensics: Avilla Forensics 3.0

Avilla Forensics 3.0. Contribute to AvillaDaniel/AvillaForensics development by creating an account on GitHub.

github.com

I found this in another thread and thanks to the guy who shared the link and to the developper of this app.

I successfully merged two database using the Whatsapp merger using command line as described in the readme but there is some display bugs (some message are in the wrong order (only by date) or another issue i faced is some messages are recognized with a media but it is not and will cause a bootloop crash of Whatsapp
[Android General] chrisjs19:
As you say, big thanks to Avilla Daniel but also to you KeTuRr74 for posting here - I doubt I would have found it otherwise. I need to have a read and see if I think I can follow the trail but is root needed to write the merged database into the WA store on the target phone?

Has anybody reading this successfully used any of the PC (or MAC) tools now out there which claim to be able to merge backups?
[Android General] KeTuRr74:
I used my computer do to the merging task and used 2 unencrypted databases on non rooted phone because i was using WhatsAero backup (it's backup WhatsApp files unencrypted, probably same as FouadWhatsapp or others)

The tool is also easy to use, installed on a Windows 10 VM and did the merging task as described via cmd.If needed i should be able to make a tutorial
[Android General] chrisjs19:
I spent a couple of hours today without success using the Avilla forensics tool - I suspect the install isnt right for some reason I cant identify yet. I did find another XDA thread with links to a more recent Github fork of the WhatsApp key extractor - https://xdaforums.com/t/recovering-whatsapp-messages-from-android-without-root-writeup.4364621/

I think it would be very kind and helpful if you would share a tutorial about the steps you took.
[Android General] chrisjs19:
I followed the instructions in the other thread which requires a little editing of the included power shell script and ran it on my phone; the process completed successfully. Unfortunately I didnt get the encryption key but I think that was my bad - I had fired up WA on my phone after I repaired the hardware and I now think it wiped the key. I guess the thing to do is make sure to have a copy of the encryption key before something bad happens to your phone! Does anybody know if any of the WA mod apps provide a method for backing up the encryption key, or just storing it somewhere accessible in the device?
[Android General] KeTuRr74:
I will try to make a tutorial when i get the time
[Android General] 777RT:
Does anyone know if the methods posted here of merging 2 diferent Whatsapp databases work with Whatsapp Business database files?

I am afraid of following the step by step guides posted here just to find out that i have wasted my time and possibly losing the data contained in those files.
[Android General] smaz2kool:
Friends I need help with merging urgently. I had a weird issue when migrating WhatsApp temporarily from one android phone to another. My original phone has 17 GB WhatsApp size being backed up on google Drive. The temporary phone that I moved to only had limited space due to which the media files got left out. When I transferred chats back to original phone from temporary phone, I lost all media in the chats. So I got back to the temporary phone and copied each media file to subfolders and now I can see media in it. The temporary and permanent phones now have lapses in chats which are extremely important to me. I want to copy about 14 days of lapsed WhatsApp data from one backup and merge it to the one where I've 5 years - 14 days of data.

I've msg store files of both phones and all media is available in the phones.

Please advise the steps. I'm not super technical but can grasp quickly if needed.

I'd really appreciate as some of the data is of high sentimental value to me of my late father. I loose the context if the media is there without the chats.

Please guide 😭. Both backups have crypt 14 extension
[Android General] smaz2kool:
Hi, can you pls create a tutorial including the decryption steps. I really need help
[Android General] dhirajG123:
Hi can someone please help me as whenever i run the .bat file after everything is done, there is nothing that appears in the extracted folder and there is only a .placeholder file, how should i proceed i have done everything as in the steps. I have a dual whatsapp apps on my single phone and i want to merge the chats in one. everytime i run the .bat file it uninstalls the app from my phone, i have android version 9. Some screen shots for reference:
[Android General] NaJeEb303:
Dear please make the tutorial, that'd be a great favor.
[Android General] Marvolo1590:
Hi guys,

I have a technical question concerning this topic:

how important is having the key?

I have several encrypted database files between 2013 and 2015 on my computer by simply copy / pasting the WhatsApp folder from my then-phone to my computer.

Problem 1: my phone was never rooted when I copied the WhatsApp folder several times within these 2 years. Thus, I haven't copied the key files with the backup. I only have the media files and the chat databases but NO key.

Problem 2: the phone number that was used back then to create the backups between 2013 and 2015 does no longer exist, that is, it DOES exist, but it now belongs to a foreigner as my phone carrier recycled it and gave it to someone else.

I have tried retrieving the backup by simply copying the WhatsApp folder onto an empty android phone and signed in with a different phone number. But WhatsApp doesn't seem to find the backup, even though I put it right into the usual "WhatsApp" folder. I guess it's because I'm using a different number and not the one that was used for these backups.

So, without the key files and the right phone number - is there anything else I could possibly do to get these chats back or are they now lost forever even though I have them on my PC as encrypted files?

I'm not sure if I could suceed by contacting the owner of my then-phone number and asking them if I could have the number back by reassigning it to me. That way, I would at least have the old number again and could then probably suceed in restoring those backup files and generating a new key...

Is that the only possible way that's left now?
[Android General] geniusjazz:
Hi, I have a similar merge question, but I am hoping there might be some simpler way in my situation.

I have two Android phones. The new one has all chat history till today but for some old conversation, it's missing some media files (Whatsapp says download failed, please ask sender to resend). The old phone has chat history until a month ago, with all the media files available.

I tried to directly move the media files into Android/media/com.whatsapp folder, it doesn't seem to work.

Wondering if it's possible to merge the media files into the new phone without having to actually merge the two dbs?

Thanks for helping!
[Android General] Marvolo1590:
This is a quite simple endeavour - if only my problem was so simple lol.

So, to get it right: on your old phone, there's everything correct, chats as well as media, they're all there?

How did you transfer to your new phone? Did you just copy the databases and the media folder over the new phone? On your old phone, WhatsApp usage stopped a month ago and since then you've continued using the chats on your new phone?

Normally, what should work is that you copy the entire media folder from the old phone onto the new phone IN THE SAME DIRECTORY. This is important. For newer android phones, the WhatsApp directory is no longer at \WhatsApp but now is at \Android\media\com.whatsapp\Whatsapp

Usually, copying between phones (and computers) can be difficult, especially with newer phones. I had great difficulties copying the entire media folder from an old phone to a new one using my computer as layover.

It might be better to use software to do so and very important: check and compare each folder with regard to size and content. So on your old phone, check every folder within the Media folder by right clicking on it -> Properties and see how many folders and files it contains.

Then compare this to the respective folders on the new phone and make sure it's identical.

Another option would be to copy all the new media files that have been created since you've been using the new phone and copy them into the old media folder on your old phone, thus making sure that all the new media that was created since you stopped using the old account on the old phone is up-to-date with today.

Then make a backup of WhatsApp (Chat Backup) on your new phone with your new account, save the msgstore.db on your computer, uninstall WhatsApp and delete everything that has to do with it on your new phone and re-install it. Put the msgstore.dbs that you saved on your computer after creating the Chat backup back onto the new phone in the right directory (WhatsApp --> Databases) and then copy the media folder from your OLD phone (which is now containing all the old AND the new files from your new phone) on the new phone in the right directory. Check again if every folder has the same size and same amount of files in it, so that not a single file is missing.

Then login / register in WhatsApp with your phone number and it should find the Chat backup you made before uninstalling it and you can restore it. And the media files should all be there since you copied the old folder containing the old files and the new files.

If you're using or have been using Google Drive Backup, you should deactivate this for this operation. It's very likely Google Drive has already created backups that do not contain the missing media files from the old media folder and when you try to reinstall WhatsApp it will automatically take the faulty backup from Google Drive again.
[Android General] geniusjazz:
Thank you so much for the detailed response!!!

Maybe I should have explained my situation better. When I moved from my old phone to new phone a month ago, I used Google Drive backup and restore.

Everything worked out fine only that I later realize, somehow some old conversation had media showing as "download failed". I logged in on my old phone, found out that it was also the case here. Luckily, I had an old copy of the Android/media/com.whatsapp folder on my laptop, so I was able to copy&paste those missing media files back into my old phone. After that, it no longer shows as "download failed" on my old phone!

However, when I try to do the same copy&paste to my new phone, I realize that the media file naming is different. In old phone, the media files are generally named like IMG-YYYYMMDD-WA00000. However, in new phone, the same media file is now prefixed with a random number, like 1937204729-IMG-YYYYMMDD-WA00000. I believe this is probably why copying those missing media files into my new phone didn't work.

Do you think your method could still apply in this case? For example, you mentioned about copying the new media files back into old phone -- but with the difference file naming schema, I am not sure if the media files were also being referenced differently in the msgstore.db?

Thanks again for the help!!!
[Android General] Marvolo1590:
@geniusjazz

If you transfered the old account to the new phone via Google Drive Backup, I find it weird that Google Drive restoration renames the media files. It never did for me.

Does ALL of your media files on the new phone have this weird name pattern with this integer prefix?

And on the old phone they dont?

So, by the time you moved to the new phone, some media files were already missing on your old phone, that's why Google Drive backup didn't copy them to the new phone. The question is, why did it rename the media files...

If all of your WA files on the phone have a similar name, then copying the old missing files (which don't have the same name structure) to the new phone probably won't work.

You could try and copy the entire old media folder from the own phone to the new phone (save the one on the new phone in a different place so that you don't lose it) and see if WA accepts the old media files. But probably it won't as it doesn't accept the missing old files that you copied onto the new phone.

If you know how to decrypt your database, you can have a look at the media_refs table and see if there are differences in naming between the old database and the new one. But I don't know if you could simply rename the entries in the database. I've never tried it and I don't know if that would work.

Maybe, if you can find out the structure behind that weird integer prefix, then you could rename the old missing files accordingly and hope that the new WA will now accept it. There should be a logic behind it, I can't believe it's just a random number.
[Android General] geniusjazz:
Yes, all of the media files in new phone do have that random number prefix. I agree that it's likely not random number, but I think it might be some hash which is almost impossible to figure out the logic...

Interestingly, the new media files that I received after moving to new phone does NOT have that prefix... So could it be possible that if I copy the new media files and the new msgstore.db back to my old phone, this could work?

I guess worst case, I can just keep a copy of everything in my old phone, and later move them back?
[Android General] Marvolo1590:
You can try, but I doubt it. Because the new msgstore.db will have the references for the prefixed old media files, otherwise it couldn't display them.

So if you copy the NEW msgstore back on the old phone, the old media files there will probably not be recognized because the new msgstore.db references them with the prefixed name.

I still don't know why Google Drive backup/restore would do this, it never did that for me and my files and I did countless backups and restorations with Google Drive, but not anymore. Manual backup and copy/paste is the best way, I guess. Then something like this can't happen.

I guess at this point you have to decide what's more important to you: keeping the newer chats of the last 4 weeks (but missing older media files), or keeping the old chats and media files intact and return back to the old backup from 4 weeks ago and disregard the new chats.

But you could try and see what the old phoen and account does with the new msgstore.db and if the old media files will still be recognized, but I doubt it. If that was the case, then copying the missing old files on your new phone would have worked.

I'm sure there is a way to fix that problem right inside the database, but I have never done it and don't exactly know how to do it.

I would take a look at the messages_refs table and see what name pattern the entries of the new database have compared to the old one. The prefix pattern should be visible in the new database, I guess.

So... Apparently your problem is not so simple as I thought in the beginning.
[Android General] geniusjazz:
Thank you so much for your help!

Do you think by looking into the messages_refs table in new phone, I would be able to see the full media name (with prefix) for those missing media files. Then I could potentially change my old media files to that new name and copy to my new phone?

I guess, if I could figure out the merging procedure (which is similar to your question) that could potentially solve my problem as well?
[Android General] Marvolo1590:
The media_refs table looks like this. But I haven't worked it out yet.

There are entries that don't seem to correspond to any of my messages.

If you decide to go with the old backup from 4 weeks ago and you still want to take all the new messages, then you would have to merge the two databases, too, in a way, that everything of the old table stays the same except for the new additional messages of the new database.

But since it's not only messages, but also media_refs or WhatsApp call logs etc. you would have to consider these too and merge it with the old table.

But that's going to be a huge undertaking. Maybe you should rather try to get the missing media files back into the current WhatsApp, but I don't know how you must/should rename them for WA to accept them.
[Android General] geniusjazz:
Oh wow. This is amazing! So potentially my media table may have something like image/019294729_IMG_YYYYMMDD-WA00000.jpg then I would know how to rename my file accordingly!?

Can I let me know how you get this media table? Basically following the video that you shared earlier?
[Android General] Marvolo1590:
That's part of your database msgstore.crypt14. If you decrypt it (you need your keyfile for that), then you can open the decrypted msgstore.crypt14 file and one of MANY tables is the media_refs table that is shown here.

But: if you (just like me) have little to 0 knowledge about SQL, coding and all that stuff, then it's almost impossible to do something with this table. It's too complex for people who don't know anything about SQL and computer science.

I've been trying to find people who know this stuff that might be able to help me with my problem. I'd even offer to pay for their service. Maybe I'll even ask professional software engineers, if I can't find someone. But it's gonna be quite expensive probably if you don't / can't do it on your own.

As for the renaming: maybe it could work. But I don't know if that table shows the prefixes at all. And - like with me - sometimes there are entries that don't correspond with my chats or media files, so I'm not quite sure what this table actually depicts and what not. If you're unlucky, your missing files aren't listed in the table. Which could be - some of my media files aren't listed in that table either and still they're there in the chats. Who knows how this works.
[Android General] ShivaMCA:
Thanks for your information..

For more details,

Android Training in Chennai
[Android General] Ravid007:
Hi,

Are you sure about: 'UPDATE messages September _id = (65422 + 1 + _id - 12)' ?

Because I keep getting 'near "September": syntax error: '
[Android General] rm0:
Syntax error.

I am too getting same error..

Let us know if someone got any success on this.

Thanks.

---------- Post added at 03:36 PM ---------- Previous post was at 03:30 PM ----------

Hi all,

I am trying to merge two whatsapp uncrypted .db files but below is the error that i am getting.

So could someone please help me to resolve this error...

---------------------------------------------------------

java.sql.SQLException: [SQLITE_CONSTRAINT] Abort due to constraint violation (U

NIQUE constraint failed: messages.key_remote_jid, messages.key_from_me, messages.key_id)

at org.sqlite.core.DB.newSQLException(DB.java:890)

at org.sqlite.core.DB.newSQLException(DB.java:901)

at org.sqlite.core.DB.execute(DB.java:810)

at org.sqlite.core.CoreStatement.exec(CoreStatement.j ava:74)

at org.sqlite.jdbc3.JDBC3Statement.execute(JDBC3State ment.java:61)

at com.merjapp.SQLiteJDBC.executeUpdate(SQLiteJDBC.ja va:61)

at com.merjapp.Merge.executeUpdate(Merge.java:71)

at com.merjapp.Merge.copyMessages(Merge.java:187)

at com.merjapp.Merge.doMerge(Merge.java:127)

at com.merjapp.Merge.main(Merge.java:420)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoa der.main(JarRsrcLoader.java:58)

Done!

--------------------------------------------------

Thanks in Advance.
[Android General] Cirno5:
That shouldn't say "september" but "set"
[Android General] DLz88:
Ye, sorry for the wrong command and the late answer, but as Cirno said, is "set" not September. Sorry, sometimes things get confused when you try to copy, and paste long posts expecially if you are using a different language. XD

Inviato dal mio LG-H850 utilizzando Tapatalk
[Android General] Jason761:
I can't get past the Execute SQL part. Im getting this error

UNIQUE constraint failed: messages._id: UPDATE messages set _id = (7864 + 1 + _id - 2)
[Android General] rohitreality:
Hello Sir. I have one 3-4 months old backup file and one 1 day old. So will this work ?
[Android General] :
Hi, I downloaded sqlitebrowser but whenever i try to add my whatsapp database file, its says invalid format. Please help!
[Android General] paumlhp:
Does that still work? Cause of that encryption thing and all. Don't want to try if it no longer works. Somebody?
[Android General] DLz88:
Have you followed all the previous steps correctly? Are you sure about the messages id you put in to the software?

Yes, should works, but make a backup copy to be sure ;)

Can you tell me what's the format of your backup files?

Follow the guide and lets us know if it works ;)

I have tested my guide (the one at page 2) merging crypt8 and crypt9 files and I have done the thest the day I posted the guide itself. You can try, but make sure to save a backup copy of ALL the whatsapp files inside your PC.
[Android General] Jason761:
Yeah I followed everything correctly.

Does the method work if I'm trying to merge it twice? Like I have 2 old files I wanna merge with the newest one.
[Android General] DLz88:
First merge the two older files together and then merge the file you obtain with the newest one. So you have to follow the guide from the beginning to the end, two times.

Inviato dal mio LG-H850 utilizzando Tapatalk
[Android General] m4t7e0:
Crypt12 is also compatible???
[Android General] DLz88:
Don't know. Should works but i have never tested with crypt12.

Inviato dal mio LG-H850 utilizzando Tapatalk
[Android General] psychem:
i have created the merged db file but i cant get whatsapp to detect it. i even deleted whatsapp folder in internal memory and sd card and whatsapp is still working?!!! the /data/com.whatsapp location doesnt exist on either internal memory or external card. weird situation. i have enabled root explorer in ES file explorer and still this problem is there.

maybe because of formatting internal memory often using twrp for installing custom roms?
[Android General] DLz88:
Could be. The guide is created and tested on stock room. Is also weird that you don't have the location you need. If is it possible, test it in a stock smartphone if it works then you are doing everything fine and the problem is in your phone.

Inviato dal mio LG-H850 utilizzando Tapatalk