WhatsApp-Chat-Exporter
WhatsApp-Chat-Exporter copied to clipboard
Android 12: Export: wa.db - Contacts are not exported.
I have a OnePlus Android 12 Phone.
Using WhatsApp-Key-DB-Extractor
I can successfully extract the whatsapp databases. My whatsapp backups are not password protected.
However, after explorer the wa.db
with DB Browser for SqlLite i see that the wa_contacts
table remains empty.
Other tables like wa_vnames
,wa_contact_storage_usage
,wa_biz_profiles
in this sqlite are populated
Also in Whatsapp on the device all contacts in the Whatsapp conversation have their correct names.
FWIW:
When i have to confirm the permission for the backup and press Enter afterwards, i can give the permissions, but i can't open the app because of the Your phone data is inaccurate. Adjust your clock and try again
error, - even though the system time is correct - that is caused by the older version of WhatsApp.
Whatsapp Chat Exporter:
wtsexporter -a
Processing contacts...(0)
Processing messages...(22625/22625)
Processing media...(4410/4410)
Processing vCards...(56/56)
Processing calls...(74)
Generating chats...(376/376)
WhatsApp directory already exists in output directory. Skipping...
Everything is done!
Extracted files:
Name Length LastWriteTime
---- ------ -------------
.placeholder 2 20:34:43
axolotl.db 299008 22:00:55
chatsettings.db 24576 21:29:43
msgstore.db 18329600 20:34:52
wa.db 417792 20:37:41
wa.db-shm 32768 20:42:08
wa.db-wal 0 20:42:08
whatsapp.cryptkey 158 21:29:41
WhatsAppKeyDBExtract output:
Please connect your Android device with USB Debugging enabled:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
WhatsApp 2.23.18.79 installed
Found legacy WhatsApp 2.11.431 in local folder
Backing up WhatsApp 2.23.18.79
6745 KB/s (52214668 bytes in 7.558s)
Backup complete
Removing WhatsApp 2.23.18.79 skipping data
Success
Removal complete
Installing legacy WhatsApp 2.11.431
3912 KB/s (18329558 bytes in 4.575s)
Success
Install complete
Paused. Open Whatsapp. Ok the Permissions Request. Press Enter to continue:
Now unlock your device and confirm the backup operation.
Please enter your backup password (leave blank for none) and press Enter:
apps/com.whatsapp/f/key
C:\Temp\WhatsApp\WhatsApp-Key-DB-Extractor\bin\tar.exe: apps/com.whatsapp/f/encrypted_backup.key: Not found in archive
C:\Temp\WhatsApp\WhatsApp-Key-DB-Extractor\bin\tar.exe: Error exit delayed from previous errors
apps/com.whatsapp/db/msgstore.db
apps/com.whatsapp/db/wa.db
apps/com.whatsapp/db/axolotl.db
apps/com.whatsapp/db/chatsettings.db
C:\Temp\WhatsApp\WhatsApp-Key-DB-Extractor\bin\tar.exe: apps/com.whatsapp/Avatars: Not found in archive
C:\Temp\WhatsApp\WhatsApp-Key-DB-Extractor\bin\tar.exe: Error exit delayed from previous errors
Extracting whatsapp.cryptkey ...
Extracting msgstore.db ...
Extracting wa.db ...
Extracting axolotl.db ...
Extracting chatsettings.db ...
Pushing cipher key to: /sdcard/WhatsApp/Databases/.nomedia
5 KB/s (158 bytes in 0.027s)
Cleaning up temporary files ...
Done
Restoring WhatsApp 2.23.18.79
4923 KB/s (52214668 bytes in 10.355s)
Success
Restore complete
Removing WhatsApp 2.23.18.79 temporary apk
Operation complete
Hi. Would you be able to find where the contact names came from?
When i have to confirm the permission for the backup and press Enter afterwards, i can give the permissions, but i can't open the app because of the Your phone data is inaccurate. Adjust your clock and try again error, - even though the system time is correct - that is caused by the older version of WhatsApp.
This is normal.
However, after explorer the wa.db with DB Browser for SqlLite i see that the wa_contacts table remains empty. Other tables like wa_vnames,wa_contact_storage_usage,wa_biz_profiles in this sqlite are populated
Also in Whatsapp on the device all contacts in the Whatsapp conversation have their correct names.
I can reproduce the problem. But further investigations are needed.
Hi. Would you be able to find where the contact names came from?
The wa.db
contains a table system_contacts_version_table
with a id
and version
column. In my database this table contains about 2000 rows. It might have something to do with it.
The contacts app on my Android, synced with Gmail contacts, contains all contacts used in the WhatsApp conversations.
When i have to confirm the permission for the backup and press Enter afterwards, i can give the permissions, but i can't open the app because of the Your phone data is inaccurate. Adjust your clock and try again error, - even though the system time is correct - that is caused by the older version of WhatsApp.
This is normal.
However, after explorer the wa.db with DB Browser for SqlLite i see that the wa_contacts table remains empty. Other tables like wa_vnames,wa_contact_storage_usage,wa_biz_profiles in this sqlite are populated Also in Whatsapp on the device all contacts in the Whatsapp conversation have their correct names.
I can reproduce the problem. But further investigations are needed.
I've tried several ways of trying to force whatsapp to refresh the contact list. But none of those options caused the contacts table to get populated.
So i took another approach. I downloaded all contacts from Gmail in .vcf
format.
I've found a nice Powershell script to convert .vcf
on Github ConvertFrom-Vcf. I had to tweak it a little bit to work for the Gmail format.
After that I wrote a Powershell script to sanitize the phonenumbers and replace all occurences with the actual contactname in the generated .html
files, and to rename the file to the contactname.
No sure if WhatsApp changed the database structure again. Any more people encounter this issue?
In the meantime I have a script (Github gist) to fix the problem using exported Gmail .vcf contacts to replace contactnames after running the Whatsapp Chat Exporter.
Weird. I just did a new export from WhatsApp 2.23.25.3. The wa_contacts
table was populated.
I can confirm same behavior reported by the op happens here with a decrypted wa.db.crypt15 : only populated tables seems to be wa_trusted_contacts and wa_trusted_contacts_send. whatsapp reports version 2.24.3.81.
The issue also happens here with an export from version 2.24.6.10
.
Hi, I also see the issue on WhatsApp 2.24.8.85 on Android: the wa.db
is not populated with any contact data.
Using a WhatsApp database I exported a few years ago (mid 2021), I am experiencing the same issue. Looking at the wa.db
file, I can't find any table indicating actual contact names. wa_contact_storage_usage
does contain a plausible number of lines, though (but no names).
Hi there, I think I have figured out what is going on.
I tested this on a number of WhatsApp versions dating from 2022 to the latest version of 2024 (v2.22.xx, 2.23.xx, 2.24.xx).
The issue is that WhatsApp itself does not fully backup wa.db. That is, the "original" unencrypted wa.db found in the WhatsApp data folder (/data/data/com.whatsapp/databases/ if one has root access) is not the file that gets encrypted to /sdcard/Android/media/com.whatsapp/WhatsApp/Backup/wa.db.crypt15 (or wa.db.crypt14).
Whereas the original unencrypted wa.db file will have the wa_contacts table populated, the backup wa.db.crypt15 will not. The same goes for several other tables too, e.g. wa_address_book, wa_vnames, wa_group_admin_settings, etc. -- they are all populated in /data/data/com.whatsapp/databases/wa.db, but upon backup they are all blank within wa.db.crypt15.
Perhaps WhatsApp doesn't backup the contact address book so that a new installation of WhatsApp will sync with the new phone's address book rather than potentially create conflicts.
In any case, the end result is that there is sadly nothing that @KnugiHK can do about this issue, as the underlying information is not backed up by WhatsApp itself, so the information is inherently missing in the wa.db.crypt15 file.
A workaround to this would be to export your contact details to a CSV file from your own contacts program (e.g. Outlook). Then with the decrypted wa.db.crypt15 backup file, you can import that data into the wa_contacts table using a program like DB Browser for SQLite). The issue is that you'll need to convert your contact data into the format that the wa_contacts table would expect (e.g. the phone number (555) 555-6666 would be transformed to [email protected]
).
Hi there, I think I have figured out what is going on.
I tested this on a number of WhatsApp versions dating from 2022 to the latest version of 2024 (v2.22.xx, 2.23.xx, 2.24.xx).
The issue is that WhatsApp itself does not fully backup wa.db. That is, the "original" unencrypted wa.db found in the WhatsApp data folder (/data/data/com.whatsapp/databases/ if one has root access) is not the file that gets encrypted to /sdcard/Android/media/com.whatsapp/WhatsApp/Backup/wa.db.crypt15 (or wa.db.crypt14).
Whereas the original unencrypted wa.db file will have the wa_contacts table populated, the backup wa.db.crypt15 will not. The same goes for several other tables too, e.g. wa_address_book, wa_vnames, wa_group_admin_settings, etc. -- they are all populated in /data/data/com.whatsapp/databases/wa.db, but upon backup they are all blank within wa.db.crypt15.
Perhaps WhatsApp doesn't backup the contact address book so that a new installation of WhatsApp will sync with the new phone's address book rather than potentially create conflicts.
In any case, the end result is that there is sadly nothing that @KnugiHK can do about this issue, as the underlying information is not backed up by WhatsApp itself, so the information is inherently missing in the wa.db.crypt15 file.
A workaround to this would be to export your contact details to a CSV file from your own contacts program (e.g. Outlook). Then with the decrypted wa.db.crypt15 backup file, you can import that data into the wa_contacts table using a program like DB Browser for SQLite). The issue is that you'll need to convert your contact data into the format that the wa_contacts table would expect (e.g. the phone number (555) 555-6666 would be transformed to
[email protected]
).
Hey! Thanks for your research! Another option could be importing contacts from Google Contacts, which was implemented in #106 and will be available in the next release.
Unfortunately, I don't have access to a rooted Android phone at the moment, so I can't investigate the issue further. However, based on your research, it seems that if the database is extracted directly with root permissions, this issue doesn't occur.