Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Merging multiple backups together #80

Open
anaxonda opened this issue Jan 16, 2024 · 7 comments
Open

[FEATURE] Merging multiple backups together #80

anaxonda opened this issue Jan 16, 2024 · 7 comments
Labels
android Android exclusive issue enhancement New feature or request

Comments

@anaxonda
Copy link

anaxonda commented Jan 16, 2024

Is your feature request related to a problem? Please describe.
I have whatsapp backups from the same phone number, and from different phones and time periods.

Describe the solution you'd like
It would be great to merge them together to view all chat continuously.

Additional context
I'm inspired to ask this by https://github.com/bepaald/signalbackup-tools that has this capability for Signal backups. In that case the databases are merged before html export. I guess that is a bit tricker (although very useful), but perhaps also the outputted html files can be merged if they match the same contact/conversation?

@KnugiHK KnugiHK added the enhancement New feature or request label Feb 1, 2024
@deyloTT
Copy link

deyloTT commented Apr 19, 2024

Is your feature request related to a problem? Please describe. I have whatsapp backups from the same phone number, and from different phones and time periods.

Describe the solution you'd like It would be great to merge them together to view all chat continuously.

Additional context I'm inspired to ask this by https://github.com/bepaald/signalbackup-tools that has this capability for Signal backups. In that case the databases are merged before html export. I guess that is a bit tricker (although very useful), but perhaps also the outputted html files can be merged if they match the same contact/conversation?

Hey I am also looking for a similar solution. Have you found a way as yet?

@KnugiHK
Copy link
Owner

KnugiHK commented Apr 26, 2024

Since multiple users request this feature, I will give a quick response here.

The ability to merge backups seems to me that it is more suitable to be a separate project. However, I'm not entirely closing the door on the idea. There's a chance I might reconsider and incorporate it into the exporter or implement it in a new project in the future. As a result, I'll keep this issue open until further notice.

@fschuh
Copy link

fschuh commented Jun 17, 2024

I'm also looking for a similar functionality.
This can be useful not only for merging backups across different devices, but also if you want to delete some Whatsapp media to free up space on your device and still want to preserve a full backup of all the chats, including any deleted messages. Deleting media causes messages to be deleted from the device chats but I would like to keep them in my chat backups indefinitely.

Being able to merge an older backup that still has all the media with a newer backup that no longer has them would be extremely useful. Merging would have it behave sort of like an incremental backup, i.e. newer messages would be added to an existing backup.

This way we could freely delete media to keep the Whatsapp database small on our phones, and still be able to have a full incremental backup containing everything including deleted messages.

@KnugiHK KnugiHK added the android Android exclusive issue label Sep 9, 2024
@KnugiHK
Copy link
Owner

KnugiHK commented Jan 14, 2025

I just came across natario1/whatsapp-database-merger. You may want to take a look if you have yet to.

@code-consensus
Copy link

code-consensus commented Feb 7, 2025

I just came across natario1/whatsapp-database-merger. You may want to take a look if you have yet to.

It seems that the database changes are significant since the last code update, such that it no longer works, as noted by a commenter in issue #5 over on that project.

There was also a WhatsApp_DB_Merger project as well, though that one also was for the old database format and also apparently no longer works.

@code-consensus
Copy link

code-consensus commented Feb 7, 2025

There is an extensive discussion on merging databases over in El Davoo's Whatsapp Crypt Tools topic #118, which I found quite informative. It includes someone that was actually successful in doing it, so you can learn about it at that post. Unfortunately, as you can see there, it is rather complicated.

The issue is (at least in the newer databases that I am familiar with), the program assigns a variety of jid_row_id's to the same number ([email protected]), as well as a unique chat_row_id. So across two different databases, for each phone number you will have completely different jid_row_id's and chat_row_id. All of those will need to be changed, across dozens of different tables that make use of those identifiers. Then, the message_row_id in message is not used just in message, but dozens of other tables that will have to all be changed so as not to break the references.

According to the aforementioned discussion, it can definitely be done, but @KnugiHK is probably right to suggested it is suited for a standalone project, as it is going to be a substantial undertaking. It would be extremely useful though!

@KnugiHK
Copy link
Owner

KnugiHK commented Feb 9, 2025

I just came across natario1/whatsapp-database-merger. You may want to take a look if you have yet to.

It seems that the database changes are significant since the last code update, such that it no longer works, as noted by a commenter in issue #5 over on that project.

There was also a WhatsApp_DB_Merger project as well, though that one also was for the old database format and also apparently no longer works.

I wouldn't be surprised if they no longer work. The biggest challenge in maintaining WhatsApp-related tools is the frequent changes to WhatsApp's internals and, of course, the lack of official development documentation (which is likely only available in their office).

I'm also thinking about how we could leverage LLMs to make things easier. Open to any discussions on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Android exclusive issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants