Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

How Do You Recover Deleted SQLite Records?

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.

Illustration for the cybersecurity term Deleted SQLite Records
Home / Blog / Cybersecurity Terms / How Do You Recover Deleted SQLite Records?
17 November 2026

How Do You Recover Deleted SQLite Records?

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.

Why the Data Survives

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.

The Write-Ahead Log Changes Everything

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.

How Recovery Works in Practice

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.

What Destroys the Evidence

Reporting the Result

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.

FAQ – Frequently Asked Questions

Are Deleted SQLite Rows Always Recoverable?

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.

Do I Need the WAL File?

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.

Which Tool Should I Use?

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.

Can an Application Prevent Recovery Deliberately?

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.

Related Terms

You May Be Interested In These

What Are Token Introspection and Revocation?

Cybersecurity Terms

17 November 2026

What Are Token Introspection and Revocation?

Read More
What Is Aircrack-ng?

Cybersecurity Terms

17 November 2026

What Is Aircrack-ng?

Read More
What Is the USB Rubber Ducky?

Cybersecurity Terms

17 November 2026

What Is the USB Rubber Ducky?

Read More