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
WhatsApp Import #1014
Comments
On Android, WhatsApp supports writing a database backup to the shared storage. The backup contains all messages in an sqlite file "encrypted" by an AES key which is hardcoded into the application... This is of course ridiculous from a security point of view (not unlike using the same RC4 keystream in both directions), but including that key in TextSecure might cause legal problems for this project. |
I agree, that could cause problems. Too bad they encrypt it since the encryption is useless. WhatsApp supports sending a chat via mail. It would be some extra steps, but maybe import that mail somehow? |
I don't think we can do this. |
I thik we can do slightly different approach. It looks like this
e.g.:
Using this approach we should be able to easily migrate chats. |
Doing it this way would lead to a loss of the included media, but the feature would help a lot of people to get rid of whatsapp and in the end it is better than nothing. |
A lot has changed since 2014: Backups are now encrypted with a per-account key that's supplied by WhatsApp servers after recovering an account as far as I know On the other hand, there is now GDPR and other legal provisions for the right to export your own data in some form in many countries. I don't know how applicable this is to client-side data, though. Maybe it helps that at least in Germany, chat to HTML export is no longer available (for patent reasons), so potentially WhatsApp could be required to offer another, maybe more machine-readable export format? |
At least for me and I am living in Austria, WhatsApp has a export feature which gives you a plain .txt file which is formatted like a log file. The format is like: |
This feature is unavailable in Germany due to patent concerns:
https://www.teltarif.de/whatsapp-chat-exportieren-iphone/news/79156.html
(article in German)
|
Ok, pretty weird. At least here in Austria (and I suppose in Switzerland too?) this feature is still available. Anyway, as you already state (according to the GDPR) somehow WhatsApp must supplier you with the data they store about you and this is clearly the case with your whole chat history. Edit: The article also states that this is only the case in Germany due to "national regulations" |
I created community feature request |
I would strongly upvote for this feature. I used whatsapp exclusively for everything and would like to switch to signal. But wanna shift all my msgs and groups to the new platform too. Its not just me, everyone who is planning to migrate to signal will be pleased to have this. If you enable this, you can assure that signal would surpass WhatsApp in usage. |
That would be amazing. It's one of the reasons which prevents me to switch completely to Signal. |
Does WhatApp permanently keep any message data on their servers, or are messages removed once downloaded by the client(s) (remember that chat backups are performed via Google Drive/iCloud, not through some WhatApp-operated service)? If so, I'm not sure whether GDPR applies in the usual fashion. (I'm on the same page with all of you: There should be a way to export full chat data.) |
@doersino Quoting their privacy policy:
|
At least on iOS it is possible to extract WhatsApp Chats with media. There is a Software called iMazing and it can extract WhatsApp Chats to CSV, Excel, TXT, PDF including:
|
This is interesting. If you consider their web application, it should be retrieving the data from their web servers right? Plz let me know if I am wrong. So there should be some kind of msg storage available in their servers. Even we can go to old message history as far as it allows. |
Web app retrieves messages from the phone, not the servers. At least in theory. |
Okay, found the issue in HN, I tried to do something similar a while ago, my idea was to offer something like a SAAS CRM using Whatsapp, due to it's huge user base. https://github.com/giovanialtelino/WhatsappMonitor But it's pretty much impossible to officialy backup all your stuff, groups and chats are limited to 40k messages, more than that it will be lost. The main issue is lost message, and the need to backup every single chat, I personally have more than 100 chats, so a lot would be lost... |
So if I am correct, Whatsapp stores a key for your data, which itself is in the iCloud or Google Drive. So according to the GDPR Whatsapp must supply the key to me if i asked them to, because it is data which is related to me, isn't it? |
I installed Whatsapp Business to have a autoresponder. I also completely disabled Notifications afterwards. So for a migration period everyone who writes me in whatsapp gets a small text where to find me. (Signal) |
Yeah but a tool to at least backup the most import stuff (and even if it is without media) is better than no tool at all. The problem with the date seems like the biggest issue to me, but this could be handled with a library too. |
WhatsApp Web is also not usable if your phone is powered off or have no wifi connection. |
I wonder, would a browser extension be a viable approach to exporting messages? I.e. open WhatsApp Web with your phone powered on, and let the extension scrape your data in a format you can import from Signal. |
So using one of the reverse-engineered WhatsApp Web libraries, like go-whatsapp (or my own whatscl) lets you create a pretty complete backup of all of your conversations + media. (whatsxmpp uses this to populate its database with your group chat history, so it does indeed work.) That could be one avenue to look down if anyone was interested in implementing this feature... |
Extracting data from WhatsApp is one part. |
If I do remember correctly then the key used to decrypt is found in WhatsApp app data directory and can be decrypted by an app, whose name I don't remember either |
Agreed. I think the most important part is being able to port conversation history and existing groups. |
Yes, the private key to decrypt the backup is located in the local (sandboxed) app directory. If the device in question is rooted, one can obtain it easily, and parse the chat database with project like [0]. One trick is to move/transfer WhatsApp temporarily to old rooted Android and extract the private key and the encrypted backups. If rooting is not an option, there is a method that involves spawning an android emulator (which is already "rooted"), install WhatsApp apk inside there, "transfer" the WhatsApp account temporarily, and then the private key can be extracted. |
I've been looking into this and have considered the following workflow:
I've gotten partway through step 3 (trying to acquire whatsapp key), but having seen the signal database schema from step 2, I'm not confident... |
I can't find a reliable way to do this on non-rooted Android devices. Aquiring the backup is not a problem, but how to retrieve the key for decryption? Edit: I guess the answer is something like mentioned above (#1014 (comment)), but it's quite an effort to set this up and get it working. The last time I tried this using https://github.com/MarcoG3/WhatsDump it didn't succeed. |
This can be confusing and maybe need a identifier in the txt file for the phone number of the other user |
How about semi manual step. We can use chat export to get unencrypted backup of chats and then convert it into signal backup. Alternatively there could be an import chat history option in Signal app (just like export in wahtsapp) so no third party app will be involved and this process could be done by non technical users. |
Yes this might be a problem but as long and names in WhatsApp and Signal matches it should work. We can add one confirmation step to allow user choose which contacts are in chat and match WhatsApp names with Signal IDs |
I am user of neither but would like to take this opportunity to remind everyone of the importance of making sure that you can export your data out of a platform or a piece of software BEFORE you import/create your data into/on it. PG West 2010: The Barrier to Exit - Scott McNealy on the #1 Reason for Choosing Open Source Software + signal-export |
Here's an idea. Maybe Syncthing (or perhaps a fork of Syncthing) could be the app between WhatsApp and Signal, doing a one-way sync of messages/media from WhatsApp to Signal. Syncthing has lots of great bells and whistles for securely sending data from one place to another. Including firewall punching. |
The date format depends on user's phone settings. In india it was dd-mm-yyyy, here in US, it is mm-dd-yyyy from my phone. |
Encryption on the messages looks might make this impossible. |
Yeah, but there should be tonns of libraries out which could handle this, or not? |
@reachjason The Chat Export feature gets around this without needing to decrypt chats.
@michi7801 At least in the UK (most likely everywhere), you can export WhatsApp chats with media. These get included like this:
Exported media includes images (as JPEG), videos (as MP4), audio (as OPUS). I haven't tested GIFs, or uploaded files, but I can presume they work, too. |
hey together because: so you should open a thread on the community forum (or any other forum) to discuss your ideas |
I created a working proof-of-concept fork that imports the msgstore.db into the Android Signal App. See (and potentially comment on this thread): |
According to Whatsapp FAQ
Shouldn't we then be able to obtain the unencrypted msgstore.db from a google drive backup? |
@nthacks Yes, but there's no easy way to access this Drive backup. A user would have to start a Google Takeout from Drive, as only WhatsApp itself can access this data. |
Personally I think the important next step is to actually get an unencrypted and complete copy of all the data in WhatsApp, create a guide, and push it out via social media before the dataset are merged with Facebook. We can figure out how to import later. |
I just found out, that the export feature of Whatsapp will soon be available in Germany. This would make an import feature even more important! |
@michi7801 You think a VPN would give me access to that feature, or would there be a separate version in Play Store? |
With the newest WhatsApp update 2.21.11.3, chat export is available in Germany! 🎉 Examples:
|
@tomxpcvx Could you please download the apk, and share it somewhere? I can't seem to actually get the apk even through VPN |
@expelledboy |
Telegram just got a feature to import Whatsapp chats https://telegram.org/blog/move-history/ |
Similar to SMS import it would be nice to have a WhatApp import. I (like others) used WhatApp and would like to keep my old chat history. I have no idea how to get the data from WhatsApp but there are many tools at the Play Store with such a feature, maybe one is open source, too.
The text was updated successfully, but these errors were encountered: