WhatsApp ChatStorage.sqlite on iOS
WhatsApp on iOS: ChatStorage.sqlite in the app group container, backup domain, ZWAMESSAGE and ZWACHATSESSION, media paths, LIDs and Cocoa time.
- Location
- /private/var/mobile/Containers/Shared/AppGroup/<UUID>/ChatStorage.sqlite (group.net.whatsapp.WhatsApp.shared; backup: AppDomainGroup-group.net.whatsapp.WhatsApp.shared, fileID 7c7fba66680ef796b916b067077cc246adacf01d)
- Evidence area
- Proves
- WhatsApp conversations and groups stored on the device: message text, direction, sender JID, sent and delivered times, media and location attachments, and group membership
- Timestamps
- Cocoa time in seconds (ZMESSAGEDATE, ZSENTDATE, ZLASTMESSAGEDATE), UTC
- Acquisition
- Unencrypted backup is enough (AppDomainGroup-group.net.whatsapp.WhatsApp.shared). A full file system extraction adds the -wal file, freelist pages and media the backup skipped
- Retention
- Until the user deletes messages or chats, or disappearing messages expire them. WhatsApp's own iCloud backup is separate and not part of the device database
- Collection
- idevicebackup2, iMazing, Full file system extraction
Tools
Compare all toolsWhat it is
ChatStorage.sqlite is WhatsApp's main database on iOS, a Core Data SQLite store holding every conversation the device keeps locally: one-to-one chats, groups, broadcast lists, status updates and system messages. WhatsApp stores it in an app group container shared between the app and its extensions, not in the app's own data container.
Unlike Signal and Telegram, WhatsApp's database is plain SQLite and reaches a standard iTunes or Finder backup. That makes it one of the most accessible third-party messaging sources on an iPhone.
Where it lives
| Source | Path | Notes |
|---|---|---|
| Full file system | /private/var/mobile/Containers/Shared/AppGroup/<UUID>/ChatStorage.sqlite (+ -wal, -shm) | Group group.net.whatsapp.WhatsApp.shared; UUID differs per device |
| Media | .../AppGroup/<UUID>/Message/Media/<chat JID>/... | Paths referenced by ZWAMEDIAITEM.ZMEDIALOCALPATH |
| Contacts | .../AppGroup/<UUID>/ContactsV2.sqlite | WhatsApp's view of contacts |
| Identifier mapping | LID.sqlite or table ZWAPHONENUMBERLIDPAIR in ChatStorage | Maps LIDs to phone numbers, depending on version |
| Backup | AppDomainGroup-group.net.whatsapp.WhatsApp.shared, ChatStorage.sqlite | Stored as 7c/7c7fba66680ef796b916b067077cc246adacf01d |
Find the group UUID by searching for the group identifier in .com.apple.mobile_container_manager.metadata.plist files, or resolve backup paths through Manifest.db.
What it proves
- Messages sent and received with the other party's JID (
<number>@s.whatsapp.netor<id>@g.usfor groups), direction and times. - Group names, members and admin changes through system messages.
- Media, documents, voice notes, shared locations (latitude and longitude on the media item) and link previews.
- Starred, forwarded and deleted-for-everyone messages, as flags or placeholders.
It does not prove who typed the message: WhatsApp can run as a linked device on a computer or tablet, and messages sent from a companion appear too.
Key fields
| Table / column | Meaning |
|---|---|
ZWAMESSAGE.ZTEXT | Message text |
ZWAMESSAGE.ZISFROMME | 1 = sent by the device owner |
ZWAMESSAGE.ZFROMJID, ZTOJID | Sender and recipient JIDs |
ZWAMESSAGE.ZMESSAGEDATE, ZSENTDATE | Message times |
ZWAMESSAGE.ZMESSAGETYPE | Text, image, video, audio, contact, location, system... (values vary by version) |
ZWAMESSAGE.ZCHATSESSION, ZGROUPMEMBER, ZMEDIAITEM | Links to chat, group member and media |
ZWACHATSESSION.ZCONTACTJID, ZPARTNERNAME, ZSESSIONTYPE | Chat identity, name and type |
ZWACHATSESSION.ZARCHIVED, ZREMOVED | Archived or removed chats |
ZWAMEDIAITEM.ZMEDIALOCALPATH, ZMEDIAURL, ZLATITUDE, ZLONGITUDE | Media file, remote URL and location |
ZWAGROUPMEMBER.ZMEMBERJID, ZCONTACTNAME | Group participants |
Message type codes and several columns change with app versions. Check .schema ZWAMESSAGE and validate type codes with known test messages.
Timestamps
WhatsApp dates are Cocoa time in seconds, UTC.
SELECT datetime(m.ZMESSAGEDATE + 978307200, 'unixepoch') AS msg_utc,
s.ZPARTNERNAME AS chat, s.ZCONTACTJID,
m.ZISFROMME, m.ZFROMJID, m.ZMESSAGETYPE, m.ZTEXT,
mi.ZMEDIALOCALPATH, mi.ZLATITUDE, mi.ZLONGITUDE
FROM ZWAMESSAGE m
LEFT JOIN ZWACHATSESSION s ON m.ZCHATSESSION = s.Z_PK
LEFT JOIN ZWAMEDIAITEM mi ON mi.ZMESSAGE = m.Z_PK
ORDER BY m.ZMESSAGEDATE;
Retention
Messages remain until the user deletes them, clears or deletes the chat, or disappearing messages remove them after the chosen period. Deleted rows can survive in the WAL and freelist pages for a while. WhatsApp's chat backup to iCloud is a separate, end-to-end encryptable archive and is not the same as an iPhone backup.
Collection
- A standard backup is enough for the database and much of the media. Encrypted backups are still preferable for everything else they add.
- A full file system extraction adds the WAL and complete media folders. Copy the whole app group container.
- Note the WhatsApp version (from the app bundle's
Info.plistor installed apps) with the evidence.
Parsing
- Messaging Forensics reads
ChatStorage.sqlitein the browser and merges it with sms.db into one timeline. - iLEAPP parses messages, contacts and call logs from the container.
- MVT extracts links from WhatsApp messages to check them against spyware indicators, and resolves LIDs to phone numbers.
sqlite3with the query above for targeted review.
Investigator tips
- Newer WhatsApp versions identify some participants by LID instead of phone number. Resolve them through
ZWAPHONENUMBERLIDPAIRrather than reporting an opaque ID. - A "This message was deleted" placeholder proves a message existed. Look in the WAL and in interactionC.db for traces of it.
- Media referenced in the database but missing on disk may have been offloaded, never downloaded, or deleted. Say which.
- Resolve phone numbers with AddressBook and WhatsApp's own
ContactsV2.sqlite, since names shown in WhatsApp can differ from the system contacts.