Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
A deleted SQLite row is usually still on disk, sitting in a freeblock, a free page, or the write-ahead log. Recovering it is a matter of parsing structures the database no longer references.

How Do You Recover Deleted SQLite Records?
SQLite is the most widely deployed database engine in the world, and almost every artefact a mobile or browser examiner touches is a SQLite file: chat histories, call logs, browsing history, location caches, application state. When a user deletes a message, the application issues a DELETE and the row disappears from query results. It very often does not disappear from the file.
A SQLite database is a sequence of fixed-size pages, usually 4,096 bytes. Rows live inside table b-tree leaf pages as records, each preceded by a header describing the serial type of every column. Deleting a row does not overwrite those bytes. Instead the page’s cell pointer array drops the entry and the space becomes a freeblock, linked into a chain within the page, available for reuse but untouched until something needs it. Delete enough rows to empty a page and the whole page is added to the database’s freelist, again without being wiped.
The practical consequence is that recovery is possible until the space is reused. On a chat application with heavy traffic that may be hours. On a configuration table that is rarely written, it can be years.
Most modern applications, including Chromium browsers and the majority of iOS and Android apps, run SQLite in write-ahead logging mode. Committed changes are appended to a -wal file and only folded back into the main database during a checkpoint. That means three things for an investigator. First, the main database file alone can be missing hours of the most recent activity. Second, the WAL holds older versions of pages, so a row that was deleted and checkpointed away may still exist in a superseded page image. Third, you must collect the -wal and -shm files alongside the database and hash all three, or your analysis is working from an incomplete artefact.
Older databases in rollback journal mode leave a -journal file with the same evidential value, holding the pre-change image of modified pages.
Tools parse the file structure directly rather than issuing SQL. They walk every page, read the cell pointer array, then examine the space the array does not reference: freeblocks, unallocated space between the pointer array and the first cell, free pages, and the WAL frames. Candidate records are reconstructed from the serial type header, and the column layout from the live schema is applied to label the fields.
The usual toolset includes sqlparse by Mari DeGrazia, undark, bring2lite, and the SQLite recovery modules inside Autopsy and the main commercial suites. Each handles edge cases differently, and it is normal for two tools to recover different subsets of the same file, so run more than one on anything that matters.
Recovered records need careful framing. A carved row has no timestamp of deletion, and fragmentary recovery can produce field values that are real but misaligned, which is how reports end up attributing a message to the wrong participant. State which structure each record came from, how complete it was, whether the column mapping was inferred, and what you could not recover. In UK proceedings the expert is expected to describe the range of reasonable interpretation, and “this fragment is consistent with a deleted message sent on or around this date” is often the honest limit of the finding.
Preserve the original file and work on a verified copy, as you would with any other exhibit under a documented chain of custody. At Privia Security, we recover deleted application data as part of our digital forensics services, most often in insider and fraud investigations where the deletion itself is the finding.
No. Recovery depends on whether the space has been reused and whether the application has vacuumed the database or enabled secure deletion. A busy messaging database may overwrite deleted content within hours, while a lightly used table can hold records for years. Always collect the write-ahead log and journal files as well, since they frequently contain versions the main file no longer holds.
Yes, whenever one is present. Write-ahead logging means committed transactions can sit outside the main database until a checkpoint, so a database copied on its own may omit the most recent activity entirely. The WAL also retains superseded page images that can contain rows deleted and checkpointed away. Collect the database, the -wal and the -shm files together.
Use more than one. Open-source parsers such as sqlparse, undark and bring2lite handle freeblocks, free pages and WAL frames differently, and commercial suites add application-specific schema knowledge. It is common for two tools to recover different subsets of the same file, so cross-check results and report the method that produced each record.
It can. Setting the secure_delete pragma causes SQLite to overwrite deleted content with zeroes, and running VACUUM rebuilds the file without free space. Several privacy-focused messaging applications do both. In those cases the remaining options are memory capture from a live device, backups taken before deletion, or data held by the service provider.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.