yashsingh1/xdaforums huggingface dataset:
[Android General] Tr4sHCr4fT:
Note that you will also have to rise the IDs of `message_quotes` and quoted_row in `messages` and remember to update the self-references there (quoteceptions)

Best define some ON UDPATE CASCADE foreign key contraints first or set triggers

:good:
[Android General] Gurkanwal Chauhan:
Hey guys, i tried to understand this thread but i couldn't. Maybe will concentrate more in free time.

However, here is my situation.

I have two devices OP6 and Galaxy A3. Primary is Op6. My brother needed it for tour. Gave him. Before going, backed up wa chats to google drive. Installed wa on a3 and restored chats from drive. Perfect.

But after he's gone, he needs my wa. He verifies again on the op6 without asking me (he had my wa number the whole time) . And here , in a3 chats weren't backed up to drive. So, now there are two different chat backups on both the devices which aren't combining even when backing up/ restoring from drive of same google account.

Please tell me how to solve this now. I need both chats combined on my OP6 again.
[Android General] m3n3chm0:
Hello, I've got a Xiaomi Mi A1 rooted so is this method working for rooted phones or not???
[Android General] sieger007:
I could manage to merge to an encrypted databases .

just give a brief two liner for my situation.

I had a situation where my db crypt files were not available and all I had wss the internal data msgstore.db located at

/data/data/com.WhatsApp/databases

the original file was 780mb I will just call it 780mb.db

when WhatsApp did a restore from Cloud something wrong happened and and I am missing about six months of data and the current

msgstore .db is just 380mb. call it 380mb

db

so the latest msgstore.db file is about 400 MB short and this maps to more than 6 months of chat history which is missing currently when WhatsApp messages are restored.

I followed the procedure to merge the two database files I have not followed any decrypting procedure because this is the un encrypted file

this included running the update on the New database files ( in sqllite database editor ) so the last message of the old one is in immediate precedence to messages in the new one.

new merged.db fiile was copied

to

/data/data/com.WhatsApp/databases

WhatsApp app was stopped and cache was flushed

on restarting it gave me a message there is a problem with your chat history don't worry we will restore it that is it refused to read the merged.db ( now.msgstore.db ) and it's simply renamed it as

now , msgstore.db. corrupt

now I repeated the same procedure in airplane mode and it it would read that file I could see my messages but WhatsApp would immediately crash

here is the crash information

it says database malformed image but I can open this database easily in my PC sqllite browser

I have tried this several times and I have on able to incorporate the data that is there in 780mb.db file to the current msgstore.db

any moolah on this ?
[Android General] SEETIW:
I have old.db, new.db and merjapp stored in a folder called Merge on the desktop. However, I get the following response:-

C:\Users\simon>cd desktop

C:\Users\simon\Desktop>cd merge

C:\Users\simon\Desktop\Merge>java.exe -jar merjapp.jar -old old.db -new new.db

-E- Database old.db cannot be found!

Anyone any idea why this is so?
[Android General] Chester89:
Whatsapp don't found merged db

Hi Guys,

I have finally got my merged db, than I renamed "msgstore.db", then I copied it in "/storage/emulated/0/WhatsApp/Databases/" but when I'm going to reinstall Whatsapp (Ver. 2.19.230) the app don't found any backup.

I think the problem is that my merged db is not encrypted in crypt12.

I read in previous messages to try to use Yowhatsapp, which should be able to restore an unencrypted db and then to create a crypt12 backup from it.

My phone is OnePlus X (not rooted), can anyone help me please?

Thanks.
[Android General] silver-knight:
Restoring deleted chats

I have a backup of a DB file containing chats I deleted a long time ago, memories I didn't want infront of me at the time, but now I wish to restore.

Apparently nothing really gets deleted as the messages are still included in the DB forever, but are not visible within the WhatsApp app.

I tried exploring the DB file with SQL but couldn't find anything to hint about what makes a message (or chat) visible or not.

Anyone has tips as to how to restore a chat I deleted?

(to clarify I decrypted the DB and have full access to it - so I'm passed that phase)
[Android General] 115irfan:
Hey I'm getting an error in command like -

"'java.exe' is not recognized as an internal or external command,

operable program or batch file."

Please tell me where I'm wrong?
[Android General] timenewroman:
You need to install Java first.
[Android General] borgqueenx:
Hello. I have restored a iphone backup to android and now see months later that it didnt import the media files.

So how can i import iphone whatsapp media files from the media folder into my current android? (so no replacing or new messages)

Thanks!
[Android General] Sourabh Gharde:
Can I merge backups from 2 different devices?

I used WhatsApp with the same no when I broke my old android and made a fresh start in a new device with the same number. I have repaired my old device and now I want to merge both backups.
[Android General] ykkfive:
i am facing this problem too since i used to have 2 devices running whatsapp with one single phone number. here's what i am going to do:

##### NOTE for dbs containing different msgs from different devices only (using 2 devices simultaneously with one phone number, eg device a in day time and device b at night at home), not for merging 2 old dbs (eg before 2018 and after 2018) into 1

# let db from device a be a.db, and b.db from device b

since they contains almost same group of people but with different ids , i have to do something to sync them first

aim: to merge 2 db into one with unique people and sort all merged records by date time (i have done a test before , sorted by date but without rewriting the msg id, thus making newer msgs appeared in between the old msgs )

- increment the people id,msg id, attchment id etc say by 30000 from b.db in all tables

- replace people ids from a.db for all tables ib b.db

- import msg records from a.db and b.db to a new c.db, just play it safe

- now i should have a table with all msgs from a.db and b.db in c.db

- sort all records in c.db by date time to rebuild all the records in sequesnce

- reapply a new msg id to all msg records according to the date time, and replace all old msg with these new ids, probably needs to subtract 30000 added above

i believe the above steps will do but worrying about the attachments etc, and there are many unused tables

what do you think?

edit sorry, may be this is not useful for you, i misread your message. what you need is something like a concat
[Android General] johnnydoughnut:
Quoted texts are wrong?

Managed to merge the 2 databases but noticed the chats where I quoted someone were wrong. The normal texts are okay it's just that the quoted message is like a message from about 2 years ago. Anyone know how to fix this?
[Android General] ykkfive:
incorrect java version

try 1.8x

---------- Post added at 03:03 ---------- Previous post was at 02:56 ----------

i had problems merging 2 dbs, so i read the sources and performed the steps manually. i found there are a few bugs, and seems that some tables, including chat_list were left untouched or not updated completely/properly (it's still in beta). may be that's why you have chats history/quoted msgs problems

ps i am trying to merge 2 dbs manually but facing some problems but i think i can handle them sooner or later. however my current solution is solely based on my dbs only and thus not a universal solution since there are too many tables involved and most of them are empty, at least for me. what i mean by it's not a universal solution because, eg if you have group charts but i don, then my solution wont work for you since i don have such entries in my db and therfore i have no way to trace them with my own db atm. also, for my dbs the entries are not in sequential order but are separated across the 2 dbs since i was using my phone at day time but my tablet at night . so you can imagine that one conversation may be stored in 2 dbs and i have to deal with that also
[Android General] d33pxd:
Is it possible to merge an older backup from my previous rooted android phone (key file is available) with a newer backup from my present android phone (key file also available). The phone number is the same.

And just out of interest: is the key file the same on different phones with the same number or depends the key file on the phone (or both?)
[Android General] selemine:
If i have the current whatsapp folder with a lot of msgstore*db.crypt12 and the MediaFolder and an outdated backup of the /data/data/ folder with the key file in it, would it work if i just copied the msg store. crypt12 and the media folder back to get a working up to date state of the conversations or are the files more interlinked with each other?
[Android General] sieger007:
Hi Wanted to know if this still works.

I tried it long ago with 2 UN encrypted msgstore.db files but the new file wasn't liked by WhatsApp. It gave me error. Malformed database error and whatsapp crashed.

Q - What makes whatsapp think a certain database is good vs malformed. Some kind of key needed ? and does it change from phone to phone ? Different ROM instance installs on the same phone ?

Any idea
[Android General] gramouk:
Hello,

Does this program even work on win10? When I run it nothing happens on my phone and the extracted folder stays empty even after the terminal work....

My phone is on LOS.

Might give it a try on ubuntu
[Android General] secondchild:
I saw another post where someone confirmed that this solved their problem. However, WhatsApp 2.17.422 no longer works (it gives the well known "adjust date and time" error that you can't move past). I also tried other WhatsApp versions with release dates prior to your post and had the same issue. So, are there any

other

options for restoring my merged database on an unrooted phone? It took ages to successfully extract the backup file from one of the phones due to various errors but I got there in the end and had a successful merge (all thanks to this forum). It would be a shame not to be able to use it.
[Android General] Fish_scale:
Could you share your experience with the rest of us?

I am just about thinking of merging two what's up databases.

And it seems like the tutorial from 2016 will not work without a million errors due to version changes.
[Android General] alexbit:
Hi!

NO experience till now... I've started follow the guide but I immediately got the above error... then all the rest of the process fail.

I've also post my question here: https://xdaforums.com/showthread.php?t=2770982&page=60#post82917051.

Hopeful to get any help. It's really very annoing that it's so hard to merge whatsaspp databases!

Please share any solutions... ;)
[Android General] Black Swift:
Hello!!

so ,my phone battery died, and i had to wait a couple of monts before i could get a new battery and fix it, meanwhile i started using a new cheaper phone, but unfortunately the backup didnt worked and i lost all my chats.

but today i went back to my old phone and found out all the chats are rigth there, didnt lose anyting, but dont have all the chats i had on my cheaper phone,

is there any way to restore the chats from the cheap phone to the old one whitout losing anyting? like merrging the backups or someting?

or simply by runing a restore of the google backup i get everyting witout losing anyting??
[Android General] tomalamix:
Hy everyone,

I've got a database with more or less 1 year old in my old phone, and now I'm trying to merge my on use DB with the old DB with the method presented in the 1st post but there are huge differences in the number of columns inside the DBs, the most recent have a lot more columns than the old one, and the process fails, the messages get all messed up.

Is there a way to merge this, adding the missing columns in the old file or something? thanks
[Android General] sieger007:
everyone is asking questions but noone's got answers

I don't know this method still works because WhatsApp has gone a long way

the database format may also have changed definitely and there may have been new features to add some kind of a signature so so you cannot manually change the content .... dunno just a few thoughts that come to mind

I am in the same situation wanted to to merge my databases it would be nice if someone would come up with a method where a current database format that is one that belongs to the latest version can be merged with something that is 2-3 years old.

long ago I did try but the merged database

was not recognised as a valid file bye WhatsApp and it would recreate New database file from downloading from Google drive or if I blocked internet access it will just create an empty message file and all your messages would go away

the 'stitched or merged' database file that you created after all l time and effort will be renamed as 'file.corrupt' by WhatsApp
[Android General] tomalamix:
Hy sieger007,

I understand that not seeing any answer may be frustrating but I believe that someone eventually will help us, don't be so demanding with people that doesn't have any kind of obligation to come here and answer to every question. Coming here from time to time to give some helpful tips is good enough and if it solves our issue it's great IMO.

BR
[Android General] tomalamix:
Hello everyone.

Im going to try to activate my old phone that have the old database there. Ill then update my whatsapp and hope that it sticks to the old DB and update it to the new format DB. After that I'll try to merge it with my most recent DB on my new phone, which have a few months of chats already. I'll use exactly the same version of whatsapp in both equipments.

Have anyone tried this before? How it was?

BR
[Android General] alexbit:
[MENTION=7231994]tomalamix[/MENTION] Have you try? Any update?
[Android General] tomalamix:
not yet, my old battery is dead, i want to replace it before i try
[Android General] sieger007:
hey yaa

[emoji550][emoji559]Good morning [emoji560][emoji550]

did ye'hv any luck gettin those things to merge ? pl post your experiences
[Android General] orlith:
Merging was successfull, but I never succeed importing the unencrypted db into whatsapp :(
[Android General] tomalamix:
hy there!

So, you've managed to use the same Whatsapp version and then merged, but aftward you couldn't get the DB recognized by the app ? Is that it?
[Android General] orlith:
Yep I'm not able import/restore it
[Android General] sieger007:
I did this with older version of WhatsApp couple of years before The new message Store DB file could easily be opened with SQL-lite - put ze file in

/data / data / com . WhatsApp / databases

and gave me the message " malformed database " ... attempted to create a new database file from backup ... and that was the end of the story never moved beyond that
[Android General] orlith:
I forget to mention that i use a non root device
[Android General] tomalamix:
Are you using the script available here at XDA to perform the merge or are you trying to do it manually counting the IDs and correcting them and so on ?
[Android General] orlith:
Hey Merge was done using jar file and using sql to update row id.

But Merging is not an issue. I got the final db file. It is just that no way exists to restore it from internal storage in whatsapp when the phone is not rooted :(
[Android General] sieger007:
both approaches available [emoji848]

after using jar approach why do we need to update SQL

I use the row ID manual approach

I think everyone's hitting the wall when msgstore.db isn't accepted by WhatsApp

... but [emoji845][emoji3480] ... we have to maybe mod WhatsApp to remove the component that checks it to get it accepted & generate a new one ... and then continue using the original WhatsApp ?
[Android General] tomalamix:
Can you try with an alternative Whatsapp App ? A modded one, those that accept multiple destinations for forward messages and so on, like the GBWhatsapp, or the Whatsapp Golden etc etc are just a few examples that it's worth a try to see if any of those accept your new DB. After its reconctructed with one of those alternative Apps just use the DB created by those and try again with the original Whatsapp App.

Let's see if it works...
[Android General] sieger007:
actually if I re collect ... I did try with those apps they have the same code as WhatsApp with those tweak modifications that they offer . There is a component in that app that checks whether the file conforms to some file signature logic or tallying with message size dunno

and actually e as soon as I place the file in WhatsApp data folder initially I could see all the missing messages for few seconds before the app crashed and thereafter it gave me the malformed database message . and if I collect I got that message in the the App log or system log . at the GUI end all it did was quit after 5 seconds and then on restart it would attempt to recreate new msgstore file from a backup and if I blocked internet access it would do nothing all my messages were gone.
[Android General] tomalamix:
Try with the GBWhatsApp, I've read somewhere that it eats well the reconstructed DB's. What app did you use at the time you've experienced that crashing problem?
[Android General] Rushikesh787:
Can you please give a video tutorial, if possible?
[Android General] tomalamix:
i don't have mt DB available at the moment to try this, and besides as you can see we've not reached a final solution for this.
[Android General] sieger007:
ignore the troll for doesn't know what he's saying

I'll try and give GB WhatsApp try my I challenge would be to get the current database to be opened in SQL lite browser I ran into some issues I remember unique key violation constraint something like that ... let's see where it leads

we may have to sneakin under the hood and identify the lagic that qualifies the file as valid
[Android General] tomalamix:
I've managed in the past to put GB WhatsApp to accept my reconstructed DB but the original databases were made in different whatsapp versions and so the columns were too different, all my messages were mixed up with strange code, messages swapped from one conversation to another, a complete mess, but the GB WhatsApp accepted it and I was able to see the messed up result. I had to erase everything because this is not what i wanted..lol

Lets see then, keep us posted!
[Android General] tomalamix:
I really don't know what happened but I've posted a message a few days ago trying to know if you got any luck with the GB Whatsapp, but the XDA is under heavy modifications and something stayed behind.

So, did you try it?
[Android General] eevonne:
Hi can someone help? i stuck on the "back up my data" on my phone
[Android General] tomalamix:
The backup is automatic, its from the day before, you really dont need to do anything except save to a safe place the backup file
[Android General] Mynameisbt:
I was trying to do merge 2 backsups recently. There were new backups from December 2020 and January 2021. My main phone is running Android 10 and I was unable to decrypt my message database initially because I an "java.lang.IllegalArgumentException: Don't know how to process version 5" error.

I was only able to decrypt the message db from an older phone running android 5.1 by restoreing a google drive backup on it.

I edited the SQLite db to add in the messages from my older backup but I am stuck because I am unable to get whatsapp to initialize with the unencrypted msgstore.db file when I put it in the /Whatsapp/databases folder
[Android General] tomalamix:
does it recognize that there is a DB in the folder and then gives you an error or it acts as the folder was empty?
[Android General] Mynameisbt:
It acts as if the folder is not there.

@tomalix in your post you said you got GBWhatsapp to recognize your unencrypted msgstore.db file. I tried running GBWhatsupp and when I try to restore I get a message about no backup being detected at /sdcard/GBWhatsapp. I tried to add my unencrypted msgstore.db to " /sdcard/GBWhatsapp" and " /sdcard/GBWhatsapp/Databases" but had no luck getting it to recognize mine. With GBWhatsapp where did you put the unencrypted msgstore.db file to get it recognized?
[Android General] czlucius:
Can I use this tool to merge 2 overlapping backups(around 2 years of messages are overlapping)
[Android General] :
Hello. The merging worked fine. When I open the msgstore.db file in WhatsApp Viewer everything is alright. But I can't open the file in WhatsApp. The file doesn't get recognized. So I read that some of you recomend using GBWhatsApp or YoWhatsApp. So I want to try that. But is there an official download to those apps? Because my phone is new, and I don't want malware installed on it. Thanks.
[Android General] sieger007:
I have +> 1 WhatsApp # on 1 fone &i I do so via these WhatsApp alternatives

WhatsApp prolly spies 2x more on your data than these If there's a serious malware ..... google scan warns you of malware app .things were just fine

Go head & try post your fb 👍 Good luck
[Android General] :
Yeah, but Facebook doesn't spy on my banking information. If I have a malware then it will read all my information and maybe also break my phone. If it's a ransomware. So I don't trust third-party WhatsApp apps. Is there another way I could do this?

But okay. I'll try it anyway. Where is a download link that will work? Like where can I find an APK that will restore my unencrypted backup?
[Android General] sieger007:
What I meant was Android has a built-in malware scan and if you' try install a malware app it will immediately warn you and there will be a red ❗ on that APK file .Having said that if you really feel uncomfortable here are your options

--- install clone app and run it through the clone app. Clone apps are full of ads but they do not have access to all your actual Android drives

You should be very well aware of the path within

/data /data/<clone app name>/<something else>/ <app being cloned name>/ <databases>/msgstore.db

That is where you will overwrite 👆🏻 file

--- get an Android emulator and put that app in Android emulator and do everything with 💯 peace of mind

For the first one obviously you need root.
[Android General] mberon:
Hi, has anyone been able to merge 2 Whatsapp backups? I've got an old Whatsapp backup, until June 2019, and the current Whatsapp backup, since June 2019 to yesterday, February 15th 2021.

I've read a lot of threads, but I don't know if it's possible to combine the 2 backups, and be able to read all messages in Whatsapp.. Thanks.