-
Notifications
You must be signed in to change notification settings - Fork 88
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
No such table: messages (Edit: Support for WhatsApp databases with "message" table) #9
Comments
What is the WhatsApp version and which platform (Android/iOS) are you using? |
I'm using Android. |
Are both versions and environments result in same database schema? |
Yes, they both resulted in the same database schema |
Interesting. I will try to reproduce it with 2.22.3.77 on emulator. |
I tried to login WhatsApp with 2.22.3.77 on emulator. However, the database includes the "messages" table. Do you remember when you installed WhatsApp on the emulator for the first time (i.e. creation date of the database)? |
I installed WhatsApp on the emulator on the 9th of this month and then imported my chat history using the chat backup in WhatsApp. |
I checked some similar projects and suspect that "message" table is a legacy table for storing messages. On your phone, is the WhatsApp conversation restored from old backup after installation? |
I restored the WhatsApp conversations from Google Drive (doing weekly backups). |
As far as I observed, it is possible that "message" was used in the early years of WhatsApp. Could you check if new installation without backup will result the same situation? |
I'll give it a try later and report back. |
Sorry, it took a little bit longer until I had time to try it out. So I'm guessing my backup is just too old for it to work then? :( |
No problem!
I think so. |
Hey everyone! I just stumbled upon the same issue with WhatsApp version 2.22.7.73 on Android on two different devices using two different phone numbers without restoring any backup. I'll try to reinstall WhatsApp and try it again, but it seems like the database scheme is changing. The new messages table has the following schema: CREATE TABLE message (
_id INTEGER PRIMARY KEY AUTOINCREMENT,
chat_row_id INTEGER NOT NULL, from_me INTEGER NOT NULL,
key_id TEXT NOT NULL, sender_jid_row_id INTEGER,
status INTEGER, broadcast INTEGER,
recipient_count INTEGER, participant_hash TEXT,
origination_flags INTEGER, origin INTEGER,
timestamp INTEGER, received_timestamp INTEGER,
receipt_server_timestamp INTEGER,
message_type INTEGER, text_data TEXT,
starred INTEGER, lookup_tables INTEGER,
message_add_on_flags INTEGER, sort_id INTEGER NOT NULL DEFAULT 0
); Edit: Tried a second time, database scheme is still the same. Edit2: In WhatsApp version 2.21.21.17 both tables |
I can produce the same result on 2.22.7.73 and "messages" table no longer exist. @Takepy As I can reproduce your situation now, I will work on supporting "message" table. |
I am curious about how WhatsApp decides which table to store messages 🤨. Is "message" a legacy table? Or "messages" is the legacy one? |
I'm not certain, using the outdated WhatsApp version both tables exist, in the more recent version (downloaded from whatsapp.com yesterday) only the Edit: Just checked, in my current setup (outdated version) messages are only stored in the |
WhatsApp using "message" table spread different types of message to many other tables. Good chance for me to rewrite the project :) |
I had to cherry-pick the fix for #32 and then it worked perfectly. Thank you for making this tool! ➜ Whatsapp-Chat-Exporter git:(message_table)$ git cherry-pick 2ba5571
➜ Whatsapp-Chat-Exporter git:(message_table)$ pip install '.[android_backup]' |
Hello everyone! We are finally moving to the last step before releasing this update. I merged the logic for processing old and new schema in Feel free to try it, especially for those with databases with both |
Hey there! Not sure if it's related, but I was having the same issue related to this thread, downloaded both the commit and the dev branch versions and now I'm getting a different error:
Again, not sure if it's related, but what should I do in this case, please? |
@umjediqualquer |
Hiya there @KnugiHK, I ran |
@umjediqualquer I did a quick fix on it (b371587) in the dev branch. Would you please check if the fix works? |
Managed to make some progress, getting a different error message now:
|
Do you know if your msgstore.db use |
I'm assuming it's |
Attempt on fixing it is pushed (06a1d34). See if that works (the error may disappear but it is not a good fix IMO). |
The previous error has been fixed, but it threw a new error a few lines after:
Is there a way to extract only the chat without the media? It's weekend and I don't to keep bothering you with this haha |
There is no way to extract chat only. Maybe it is a good option to add.
That's fine. The bug has to be fixed anyway. And I reply only when I am available. As for the bug, I committed another attempt to fix it (7c0b90d). This time I modified my database to test the problem myself and it works for me. Also, maybe the file name should rely on the information inside the vcards instead of the message data (the current implementation). |
@KnugiHK it worked! Seems to have generated everything correctly and didn't throw any errors :D Thank you very much for your help, especially on a weekend! May I buy you a cup of coffee (or tea, it that's your cup, heh) as a token of gratitude? |
Glad that works for you too! And thanks for your report! The point for not releasing this update yet is to let everyone test it and spot problems. Also, I appreciate your offer to buy me a cup of coffee or tea, but it's not necessary. If you'd like to show your support, consider staring this repo instead. That meant a lot to me😆. Thanks again. |
Hi, I cloned the "message_table" branch and run the tool with this command: The messages are recovered correctly but i noticed that two identical "WhatsApp" folders are created. The two folders structure are: ./WhatsApp/ ./result/ |
@Signum21 Also, "message_table" branch is no longer maintained. Try dev branch instead. |
I switched to dev branch. |
vCards will be exported to ./WhatsApp/vCards and copied to the output directory by default. If you don't want two identical folders, try -c (--move-media) flag. |
The output treats deleted message as not supported message in the new schema. It is fixed in c7a01bb. |
Kindly do it, I am also getting same error : sqlite3.OperationalError: no such table: messages |
The support of the |
Support with new schema has been released in 0.9.0. I am closing this issue. Further problems should be reported on a dedicated issue. Thanks to everyone who contributed to the support of the new schema! |
When running the script I get following error message
My database doesn't contain the table
messages
, I only have one calledmessage
which contains the data but the schema of the table looks different from what it's supposed to look like.What could be the issue here?
The text was updated successfully, but these errors were encountered: