Skip to Content

What is a WhatsApp database?

A WhatsApp database is a collection of files that WhatsApp uses to store all user data such as messages, media, contacts, settings, etc. It allows WhatsApp to read and write user data quickly and efficiently.

Where are WhatsApp databases located?

WhatsApp databases are located in the internal storage of Android devices at /sdcard/WhatsApp/Databases. For iOS devices, they are in var/mobile/Containers/Shared/AppGroup/{APP_ID}/ChatStorage.db. WhatsApp stores databases for each user with their phone numbers as names.

What information is stored in WhatsApp databases?

WhatsApp databases contain a wealth of information including:

  • User profiles and settings
  • Contact lists
  • Messages, media, files exchanged
  • Group information
  • Encryption keys
  • Media downloads
  • Cached data

List of WhatsApp databases

Here are the main WhatsApp databases:

Database Description
wa.db Contains registration info, contacts, preferences
msgstore.db Stores all messages, media, calls data
chatsettings.db Chat and notification settings
axolotl.db Encryption keys for end-to-end encryption
stickerpack.db User’s installed sticker packs data

Structure of WhatsApp msgstore.db

The msgstore.db database contains multiple tables to manage different types of data:

Table Purpose
messages Stores messages, date, type, status
chat_list Chat metadata like names, statuses
groups Group participants, name, icons
group_participants Mapping of group IDs and participants
media_v2 Metadata of media like images, videos
media_downloads Info about media downloads in progress

What tools are used to view WhatsApp databases?

There are several tools available to view, analyze, and extract data from WhatsApp databases:

  • SQLite browsers – Allow browsing data and exporting tables as CSV
  • MyJad – WhatsApp backup extractor for Windows
  • Crypt12 – Decrypts encrypted WhatsApp backups for iOS & Android
  • WhatsApp Viewer – Parses WhatsApp database files and exports data
  • FoneLab – Extracts WhatsApp data from Android and iOS devices

Are WhatsApp databases encrypted?

WhatsApp uses end-to-end encryption for messages, which means messages are encrypted on the sender’s device and decrypted on the recipient’s device only. However, WhatsApp databases themselves are not encrypted and stored as plaintext on the device.

The encryption keys used for end-to-end encryption are stored in the axolotl.db database. Only this database is encrypted using a user-specific key derived from the phone number.

Can WhatsApp databases be transferred between devices?

Yes, WhatsApp has a built-in feature to transfer chat history and data between iOS and Android devices. This migrates the crypt12 encrypted backup from one device to another via manual transfer, iCloud Drive or Google Drive.

Third party tools like Mobile Trans are also available to transfer WhatsApp data between different mobile operating systems.

Are deleted WhatsApp messages removed from the database?

When a WhatsApp message is deleted by a user, it is not immediately removed from the databases. Instead, the message is simply marked as deleted in the messages table.

Even after a long time, traces of deleted messages may still exist in the database until that data is overwritten by new data.

However, if the user deletes the chat history entirely, then the messages are permanently deleted.

Can I backup my WhatsApp database?

Yes, it is recommended to regularly take backups of your WhatsApp databases, especially msgstore.db and chatsettings.db which contain your valuable chat history and preferences.

On Android, you can simply copy these files from the WhatsApp/Database folder to any other storage. For iOS devices, you need to use a jailbreak to access the restricted filesystem and database.

You can also use tools like iExplorer and iBackup Extractor to download backups from iCloud Drive to your computer.

Conclusion

To summarize, WhatsApp databases are structured SQLite databases used by the app to store all user data locally on the device. These unencrypted databases can be viewed and analyzed to extract chat history using various forensics tools. Users should regularly backup WhatsApp databases to preserve their data.