First, the reassuring part: this is not about your photographs. A Lightroom catalogue records information about photos — the folder tree, filenames, capture times, star ratings, colour labels, flags, keywords, collections, develop settings. The pictures themselves are ordinary files on your disk and are untouched by whatever has gone wrong with the .lrcat. What is at risk here is years of curation, which is painful to lose but is a different loss from losing the images.
Second, before anything else: copy the file. Copy the .lrcat — and the two sidecar files described below, if they are there — somewhere separate, and do everything from here on to the copy. Repair attempts on a damaged database can turn a partly readable situation into an unreadable one, and that is not reversible.
Why a photo application produces a database error
A Lightroom catalogue is a SQLite database with a .lrcat extension. That is the whole explanation for the odd-sounding message. database disk image is malformed is SQLite's standard diagnostic for “I opened this file, started reading, and the internal structure did not add up.” Its sibling message, file is not a database, means the same family of trouble one step further along.
Three consequences follow, and they are all in your favour:
- Ordinary SQLite tooling applies to your catalogue. You are not limited to whatever one vendor supplies.
- There is a free, documented recovery command — see below — that you should try before spending money with anyone, us included.
- Corruption in a SQLite file is usually regional. Damaged pages do not imply a damaged whole. Large parts of the catalogue are frequently still readable after the database as a whole has been declared malformed.
One caution about the timing of the message: SQLite opens a file lazily, so the structure is not validated at the moment of opening — the complaint surfaces on the first real read. A tool that reports “opened fine” and then fails a second later is not contradicting itself; that is simply how the format behaves.
Check 1 — are there -wal and -shm files beside the catalogue?
Look in the same folder as the .lrcat for two files with the same name and the suffixes -wal and -shm. If they are there, do not delete them, and do not copy the catalogue without them.
Those are SQLite's write-ahead log and its shared-memory index. The -wal file can hold committed changes that have not yet been folded back into the main database file. Deleting it, or copying the .lrcat on its own to a new drive, can discard real work that was safely written — and it is a very common way for a recoverable catalogue to become a lossy one between the problem and the rescue attempt.
The rule is simple: move the set, not the file. Catalogue plus both sidecars, together, every time.
Check 2 — is there a healthier copy you have forgotten about?
Before spending effort on a damaged database, spend ten minutes looking for an undamaged one. In rough order of likely success:
- Lightroom Classic's own scheduled catalogue backups. Lightroom Classic can write a zipped copy of the catalogue on a schedule, into a
Backupsfolder with a dated sub-folder per run. Its location and the schedule are settings on your own machine and vary between installations and versions, so look next to your catalogue first and then wherever your backup preference points. A backup from last month that opens is worth more than a perfect recovery of today's file that does not. - Time Machine, File History, or whatever backs your machine up. Restore a copy from before the problem, to a different folder, and try that.
- Cloud-storage version history, if the catalogue lived in a synced folder. Be aware that keeping a live catalogue inside a sync folder is itself a well-known route to this exact damage, because two processes writing the same database do not agree.
- Any other machine that ever opened this catalogue. Old laptops and disk images are full of forgotten copies.
Check 3 — the free route, and it is a real one
The sqlite3 command-line tool has a .recover command that walks a damaged database, reads whatever rows it can still make sense of, and emits them as SQL. It is free, it is documented by the SQLite project, and it costs you nothing but ten minutes.
sqlite3 ships with macOS. On Windows it is a free download from the SQLite project's own site. Working on your copy:
sqlite3 copy-of-catalogue.lrcat ".recover" > recovered.sql- then, to build a fresh database from what came out:
sqlite3 rebuilt.lrcat < recovered.sql
If that produces a database that opens and holds your keywords and collections, you are finished and you need buy nothing from anyone. We would rather tell you that here than sell you something you did not need. It is also worth running PRAGMA integrity_check; against the original copy first — it will often tell you how much of the file is actually affected.
Where this route tends to disappoint is in the reading, not the recovering: what you get back is a database, not a report. Turning it into something you can act on — a list of which photos carried which keywords, ratings you can move to another application — is a further job, and for most photographers it is the job that matters.
Check 4 — is the catalogue genuinely a catalogue, and genuinely empty?
There is a third outcome worth naming, because it is easy to misread as corruption. A file can be a perfectly valid Lightroom catalogue whose library is empty — no photos, no keywords, no collections. That usually means a newly created catalogue, or the wrong file of several with similar names. If a tool tells you the file is a genuine catalogue but there is nothing in it, that is a finding about the file, not a failure of the tool, and the next step is to go looking for the other .lrcat.
When our tool is the answer, and what it does
Lightroom Catalogue Rescue is a small desktop application for Windows and Mac that reads your own .lrcat on your own computer, without Lightroom installed, and lays out what it finds in a form you can use.
Two behaviours are relevant to the message on this page specifically:
- It expects this failure and handles it as a distinct case. The catalogue is opened read-only and probed with a cheap first read. When that read comes back with a corruption error —
database disk image is malformedorfile is not a database— the file is passed to a salvage lane rather than being dismissed as “not a Lightroom catalogue”. That distinction matters: a tool that mislabels a damaged catalogue as the wrong file type sends you off looking for a file you already have. - It does not touch the sidecars, and it does not touch your original. The catalogue is opened in SQLite read-only mode with writes forbidden at the database layer as well, it is SHA-256 hashed before and after every run as a hard stop if the bytes change, and no
-walor-shmfile is created beside it. Exports go to a separate folder you choose, in a fresh sub-folder every run, so nothing you already have there is overwritten.
What comes out is the curation: the folder tree and photo list, star ratings, colour labels, pick and reject flags, keywords with counts, collections and their membership, virtual copies, smart-collection rules decoded into plain English where that is possible, and develop-history step names — written as CSV, JSON and a readable HTML page. It also writes standard XMP sidecars, one per photo, carrying ratings, labels and keywords, so your work moves into darktable, Capture One, digiKam or anything else that reads XMP. Where the originals are gone but the catalogue's Smart Previews survive in the sibling .lrdata bundle, it reads that bundle's documented layout and writes out the preview images it finds — best effort, not a promise.
What it cannot do, said plainly. It does not recover your original RAW or JPEG files; a catalogue holds metadata about photos, not the pixels, and the originals live wherever Lightroom pointed at them. It does not re-render your edits — the recorded develop settings come back as recorded values, not as applied images, because Lightroom's develop pipeline is Adobe's own. It is designed and tested against Lightroom Classic 9 catalogues; other versions usually open and degrade gracefully, a missing optional section reading as empty rather than crashing, but LrC 9 is the version that has been tested. And it cannot retrieve what is not in the file — a truncated catalogue, or one on a failing drive, is past the point where any reader helps, and the next step there is disk-level recovery or a different copy.
Windows 10 and 11 (64-bit), and macOS 10.15 or later. One purchase covers both.
The order to work in
- Copy the catalogue and its
-waland-shmsidecars, together, somewhere separate. Work on the copy. - Never delete a
-walfile to “tidy up”. - Look for a healthier copy: scheduled catalogue backups, machine backups, version history, old machines.
- Run
PRAGMA integrity_check;to see how much is actually affected. - Run the free
sqlite3 .recoverroute. If it gives you what you need, stop here. - Only then reach for a tool that reads what remains and hands it back in a usable shape.
A good many people who arrive at this message finish at step three or step five. That is a better outcome for you, and we would rather say so than not.