SQLite Corrupted? Stop Opening the App — Bring It In for an Initial Evaluation

SQLite is a special database: the entire database is a single file, no server needed. Phone apps, desktop bookkeeping software, browsers — many store data in it. That single file makes it convenient but fragile: power loss mid-write, a cloud sync caught halfway, or accidentally opening it in Notepad and saving can all break it. The good news: the single-file structure makes inspection relatively straightforward with no server to deal with, and fees are relatively modest. The bad news: when badly damaged, options are limited. Below: how to help yourself and when to bring it in.

1. What Is SQLite? Who Uses It?

  • SQLite is an embedded database — the entire database is one .db file, no server installation; the app reads and writes it directly.
  • Common in phone apps (bookkeeping, notes, fitness tracking), desktop single-machine software and browser internals — many Hong Kong SME industry programs work this way.
  • It usually has companion files: -journal (old-style journal) or -wal (write-ahead log), used during writes and auto-cleaned when the app closes normally.
  • Single file means backup is easy — copying the file is the backup. But it also means when it's broken there's nowhere else to cross-check.
  • Unlike MySQL/PostgreSQL, SQLite has no service, no user privileges, no network layer — failures are usually the file itself or storage issues.
  • Note the extension: .db, .sqlite and .sqlite3 are common, some apps use custom ones — unrecognized extension is fine, the file header tells the truth.
  • SQLite is open-source and free with no license fees, which is why many SME software vendors love it — meaning lots of Hong Kong industry software runs on it.

2. Common Failure Modes and Symptoms (Match the Message)

  • "database disk image is malformed" — the classic one: file structure damaged, app can't read it. The hallmark of SQLite trouble.
  • "file is not a database" — the file header is damaged, or the file was never a SQLite db (e.g. someone saved it from Notepad).
  • The .db file became 0 bytes — power loss mid-write, dead battery, or a cloud-sync mishap left an empty shell.
  • App crashes on open or throws errors, but the file still exists with size — usually structural damage, not total loss.
  • Cloud drive (Dropbox, OneDrive etc.) syncing the db file when trouble hit — a half-synced file is almost certainly broken; a common cause.
  • Accidentally opening the db in Notepad/Word and saving — text editors change encoding and line endings, instantly killing the SQLite file.
  • Data gone after phone OS or app update — sometimes the app moved the file elsewhere, sometimes it truly got corrupted; must distinguish.

3. First 10 Minutes After Failure: Do and Don't

  • Immediately copy the .db file (plus any -journal / -wal / -shm siblings) elsewhere — top priority.
  • Don't open the app again: each launch may attempt writes or checkpoints, worsening something still salvageable.
  • Never open the db in Notepad, Word or any text editor, let alone save — don't add damage to damage.
  • Don't delete -journal / -wal: they may still hold uncommitted data — important clues for recovery.
  • If it's a phone app, don't uninstall it yet: uninstalling usually wipes the db file along with it.
  • If the device is nearly dead, plug in the charger before doing anything: losing power mid-copy is another disaster.
  • Note which app and version, when it last worked, what happened before the failure (update? dead battery?) — very useful for diagnosis.

4. How We Inspect It at the Shop (Step by Step)

  • First, back up: fully copy your db file and companions; all attempts happen on the copy, the original is sealed.
  • Check file size: 0 bytes, a few KB, or normal size — size alone already says a lot.
  • Try opening with the sqlite3 command-line tool: can it open but not read, or not even open — two different levels.
  • Try .dump: export what's readable as SQL text — how much dumps out is how much is saved. The most honest test.
  • Try .recover (newer sqlite3 feature): designed to salvage what's possible from damaged files, more aggressive than .dump.
  • Check -journal / -wal for remaining data: sometimes the main file is broken but the journals still hold recent transactions.
  • Check the filesystem and storage device too: bad SD cards or old disks break SQLite as well — rule out underlying issues first.

5. Cases We Can Handle at the Shop

  • "database disk image is malformed" with normal file size: .dump / .recover often salvages most data, then we rebuild a fresh file.
  • Journals / WAL intact: restore uncommitted parts from the logs to fill gaps in the damaged main file.
  • App moved the file or changed path: find it, put it back — fixed without touching data.
  • Cloud sync broke it: the cloud copy is bad but the phone/PC still has an older intact local copy — use the local one.
  • Single table damaged, rest fine: dump the healthy tables, containing loss to one table.
  • App won't open after update but old file intact: sometimes the new app version can't convert the old format — the file itself is fine; find the old app version or export first, then upgrade.
  • Browser profile broken (bookmarks, passwords gone): don't randomly delete the browser profile when its SQLite files break — there may still be salvageable data; we've handled many such cases.

6. Cases That Need a Lab or the Vendor

  • The db file is 0 bytes with no journals and no other copies — the file itself is empty; nothing at shop level can conjure data from nothing.
  • Header-to-tail widespread damage where .dump / .recover yield nothing: needs byte-by-byte manual analysis, beyond shop scope.
  • Physical storage damage: unrecognized SD card, clicking disk — the storage must be rescued first, our sister lab Recoverydata King's territory.
  • All reasonable methods exhausted with nothing recovered: we'll tell you honestly instead of charging to try luck.
  • File broken by two programs writing at once (e.g. two apps writing the same file): first figure out which is the master — don't try to save both together.
  • Encrypted SQLite (e.g. SQLCipher): if the password is lost we can't help — the password is your responsibility; no password means no key.
  • File on a broken SD card: rescue the card first, SQLite second — if the card can't be saved, there's no point looking at the db.

7. Prevention and Backup Advice (So You Never Come Back for This)

  • Regularly copy the db file: SQLite backup is that simple — with the app fully closed, copy the .db elsewhere. Even weekly beats nothing.
  • Close the app before copying: copying while the app runs may capture a half-written state — the backup itself would be broken.
  • Don't treat cloud sync as backup: sync software doesn't understand SQLite's write rules; a half-sync easily corrupts. Sync is convenience, not backup.
  • 3-2-1 applies too: three copies, two media, one offsite — single-file databases benefit just the same.
  • Check whether the app has built-in backup/export: many do, you just never tapped it — enabling it is an extra safety net.
  • Don't rely on a single app for important data: periodically export CSV/Excel — open formats readable decades later.
  • Back up the phone/PC itself too: the SQLite file gets backed up along with the whole device — no need to worry app by app when switching devices. The laziest but most reliable approach.

8. Fees and Time (How It's Calculated)

  • Initial evaluation: we check file size, try opening and dumping, and tell you the situation and viability — no charge at this stage.
  • Formal quotes are per case: based on file size and damage extent. Itemized written quote before we touch anything.
  • No recovery, no recovery fee: if dump/recover genuinely yield nothing, you don't pay for recovery work.
  • Usually quick: single file, no server involved — inspection and attempts typically conclude the same day.
  • We never quote over the phone: quoting without seeing the file is irresponsible — we don't do that.
  • You can WhatsApp the file first: if the db isn't huge, compress it with a password and send it over — we can do a preliminary remote assessment so you don't have to travel.
  • Students and small shops can discuss: SQLite is usually personal app data, not enterprise — fees match the reality, never sky-high.

Disclaimer: there is no 100% guarantee in database repair. A 0-byte file, widespread header damage with no journals or copies cannot be recovered. After our initial evaluation we'll tell you honestly — no exaggeration. All fees confirmed in writing beforehand.

Frequently Asked Questions

What does 'database disk image is malformed' mean? Is it hopeless?

It means the SQLite file structure is damaged and the app can't parse it. Not necessarily hopeless — .dump or .recover often salvages most of it; only severe damage is truly unrecoverable. An initial evaluation will tell — we'll try it in front of you.

The .db file became 0 bytes. Definitely hopeless?

The file itself is empty, but a few places remain: -journal / -wal siblings, older copies on phone/PC, cloud version history. With none of those it's truly hopeless; with any of them it's worth bringing in.

Can I open the db file in Notepad to peek inside?

Absolutely not. Notepad is a text editor — one save changes encoding and line endings, instantly killing the db. To inspect, use sqlite3 tools or dedicated software like DB Browser for SQLite; never touch it with text editors. We've genuinely seen this mistake many times.

After a phone app update, all my data is gone. What now?

Don't uninstall the app first — uninstalling usually wipes the db too. Check the app for backup/restore features and whether you're signed into its cloud account; then check the phone's file manager for the db file. If unsure, bring it in and we'll help locate it — don't delete things randomly yourself.

I keep my db file in Dropbox sync. Any problem?

Risky. Sync software doesn't understand SQLite's write rules — if Dropbox syncs while the app is writing, it uploads a half-broken version and may even overwrite the good one. Sync is fine for convenience but never as backup; real backup means manually copying with the app closed. They're different things.

What mainly determines whether SQLite is recoverable?

Three things: file size (0 bytes or normal), damage location (header or middle), and whether journals/WAL/other copies exist. That's what we check at inspection — a few minutes is enough to know, and we'll tell you straight away.

How often should I back up the db file?

Depends on how often you use the app and how important the data is. A daily bookkeeping app: weekly is reasonable; critical data: daily isn't overkill. Key points: copy with the app closed, and verify the copy opens — don't do it carelessly.

After recovery, is the db file exactly the same as before?

Not necessarily identical. .dump / .recover exports what's readable and rebuilds — damaged parts that couldn't be saved will be missing. After recovery, check your important data yourself; we'll tell you which parts were saved and which are gone — we won't just say 'it's the same as before'.

WhatsApp 2115 9219