calibre Library Seems Corrupted: How to Repair It Safely

  • Protect every book and metadata record before attempting database repairs.
  • Separate missing files, missing records, permissions, and sync conflicts.
  • Test repairs on a copied library before replacing the original.

When a calibre library seems corrupted, the visible symptom may be an empty book list, missing formats, incorrect metadata, database errors, covers that no longer load, or books that appear in folders but not in calibre. These symptoms do not all mean the same thing. The cause may be an incorrect library location, a damaged metadata.db file, missing book files, interrupted cloud synchronization, filesystem permissions, a plugin problem, or changes made directly inside calibre's managed folders.

The safest response is not to delete the library, reinstall calibre immediately, or start rearranging author and title folders. First protect the existing data, identify whether the database or the files are affected, and test repairs on a copy. The steps below apply to Windows, macOS, and Linux and are designed to preserve as much information as possible.

E-book library files and database being inspected beside a protected backup copy.

1. Confirm the Symptom With a Small Safe Test

Before attempting a calibre library seems corrupted fix, confirm which part of the library is actually failing. A calibre library consists of a main library folder containing author and book subfolders, e-book files, covers, per-book metadata backups, and a database named metadata.db.

The metadata.db file is the library's central catalog. It tells calibre which books exist, where their managed folders are, and what titles, authors, tags, series, ratings, identifiers, custom-column values, and other metadata belong to them. If the database cannot be read, calibre may display an empty list or generate database errors even though the book files remain on disk.

1.1 Verify That calibre Opened the Correct Library

Click the calibre library button and inspect the path shown for the current library. If the library was moved, an external drive received a different drive letter, or a mounted volume is unavailable, calibre may have opened or created a different empty library.

Use Switch/create library to point calibre to the folder that contains the expected metadata.db. If you do not know where the folder is, search your computer and attached drives for that filename. Do not choose an individual author folder or the folder above the library. Select the library's top-level folder.

Success means the expected books, tags, and other library information reappear after switching. If that happens, stop troubleshooting. The original library was not necessarily damaged, and database restoration is unnecessary.

1.2 Distinguish Missing Records From Missing Files

Select several affected book records and use calibre's option to open the containing folder. Then compare what calibre displays with what exists in that book's folder.

  • Record exists, format is missing: calibre knows about the book, but the EPUB, PDF, MOBI, or other format file is absent.
  • File exists, record is missing: the book file remains in the library folders, but the database does not currently list it.
  • Record and file both exist: the problem may involve metadata, covers, permissions, a viewer, a plugin, or a damaged source file rather than broad library corruption.
  • Entire author or book folders are missing: investigate deletion, synchronization conflicts, drive failure, or an incomplete backup.

Do not assume that restoring the database will recreate deleted e-book files. Database repair can rebuild records from surviving library folders and metadata backups, but it cannot reconstruct an EPUB or PDF that is no longer present anywhere.

1.3 Test One Known Book

Choose one book that should contain a readable format. Confirm that you can edit its metadata, open its folder, view the book, and copy it to a temporary test library. This small test helps separate a library-wide database problem from a single damaged book.

Success means the selected record behaves normally. If only a few books fail, repair or re-add those specific formats rather than rebuilding the whole database.

2. Check the Library and Database State Directly

Once you have confirmed that calibre is using the correct folder, use calibre's built-in library maintenance tools. These tools are safer than manually editing the database or renaming folders in the filesystem.

2.1 Back Up the Entire Library Before Repairing It

Close calibre and stop the Content server before making the backup. Confirm that no calibre process is still using the library, then copy the entire top-level library folder to a separate local location. Include metadata.db, every author and book folder, covers, formats, and OPF files.

A copy of metadata.db by itself is not a complete library backup. Conversely, copying only the book folders may preserve the files but omit database-only information. The safest backup is the complete folder tree.

If the library is very large, verify the copied folder's total size and inspect several book folders before proceeding. Keep the backup unchanged. Success means you have a separate, readable copy that will not be modified during troubleshooting.

2.2 Run Check Library

In calibre, open the library menu and choose Library maintenance, followed by Check library. This compares database records with the files and folders on disk. Depending on what it finds, the report may identify missing formats, extra formats, missing covers, extra covers, unexpected folders, malformed paths, or other consistency problems.

Read the report before authorizing any cleanup. An extra file is not automatically disposable, and a missing format cannot be recovered merely by removing its database reference. Keep the backup until you understand every category that affects important books.

Use the report diagnostically:

  • Many missing formats: files may have been deleted, moved, quarantined, or omitted by synchronization.
  • Many extra formats or folders: the database may have lost records, a restore may be incomplete, or files may have been placed inside the library manually.
  • Missing covers only: the core book formats may be healthy, making a full database rebuild excessive.
  • Malformed or failed paths: check permissions, unsupported characters, filesystem errors, or interrupted folder operations.

Success means Check library completes without serious inconsistencies, or the reported issues correspond to a small, understood set of books. Stop making broad changes if the library opens normally and the remaining problems are limited and explainable.

2.3 Restore the Database Only When Evidence Supports It

If metadata.db is missing, unreadable, or clearly inconsistent with intact book folders, use Library maintenance and Restore database. calibre can rebuild the database using metadata stored in OPF files within the individual book folders.

Database restoration is a recovery operation, not routine maintenance. It regenerates the central database, and some information that is not represented in the per-book OPF backups may not survive. Saved searches, user categories, plugboards, stored per-book conversion settings, and custom recipes are examples of information that may be lost during a full database reconstruction.

Run this operation only after creating a complete backup, preferably while working on a copied library. Success means calibre opens the rebuilt library, expected books appear, representative formats open, and metadata is broadly correct. Once that result is stable, stop changing settings and preserve both the repaired library and the pre-repair backup until you have verified important custom data.

2.4 Do Not Manually Rearrange calibre's Folders

calibre manages its own folder structure. Renaming author folders, moving files between book directories, merging folders manually, or changing title folders outside calibre can break the relationship between the filesystem and metadata.db.

Edit titles, authors, formats, and covers through calibre. If you need an independently organized collection, use calibre's export or Save to disk features to create a separate folder structure. Do not transform the active library into a manually organized archive.

Local e-book library contrasted with cloud sync, network storage, permissions, and security obstacles.

3. Check Storage, Permissions, Sync, and Security Software

A database error can originate below calibre. If the operating system prevents reliable reads, writes, renames, or file locking, the library may behave as though it is corrupted.

3.1 Move the Active Library Off Network Storage

Do not keep the working calibre library on a NAS or ordinary network share. Network filesystems can differ in locking, rename behavior, link support, latency, and recovery from interrupted connections. Running two calibre instances against the same network-hosted library creates additional risk.

Copy the complete library to an internal or directly attached local drive, switch calibre to that copy, and run the same small tests again. If you need remote access, keep the active library local and use calibre's Content server rather than opening the database directly across the network.

Success means database errors and inconsistent updates disappear when the library operates from local storage. If so, stop experimenting with the database and redesign how the library is accessed.

3.2 Pause Cloud Sync During Diagnosis

Cloud-sync folders can create similar hazards. A sync client may upload a partially written database, restore an older copy, create conflict files, delay folder renames, or process thousands of calibre-managed changes while calibre is running.

Close calibre, allow synchronization to finish, and create a fully local copy outside the synchronized folder. Pause the sync client while testing that copy. Never combine conflicting versions of metadata.db by guessing which folders belong with which database.

If the local copy works consistently, cloud synchronization was likely contributing to the problem. Use cloud storage for closed, verified backups or exports rather than treating a live multi-device folder as a shared database. Ensure calibre is closed before any backup or synchronization process copies the active library.

3.3 Verify Permissions and Free Space

Confirm that your user account can create, rename, and delete a small test file in the library's top-level folder. Also check available disk space. A full or read-only disk can interrupt metadata updates, format additions, conversions, cover changes, and database writes.

  • Windows: inspect the folder's Security properties, controlled-folder-access settings, and whether the drive or folder has become read-only.
  • macOS: check Privacy and Security permissions, folder ownership, external-volume access, and whether the volume is mounted read-only.
  • Linux: check ownership, write permissions, mount options, available inodes, and whether the filesystem was remounted read-only after an error.

Do not solve permissions problems by granting unrestricted access to everyone. Correct ownership and grant the required account normal read and write access. Success means calibre can edit metadata, add a test book, remove that test record, and reopen the library without an error.

3.4 Review Antivirus and Backup Activity

Security or backup software may lock, quarantine, delay, or repeatedly scan metadata.db and newly created book files. Check the product's logs for actions involving the calibre library rather than disabling protection permanently.

If an exclusion is necessary for testing, limit it to the trusted local library folder and restore normal protection after confirming the cause. Recover quarantined files through the security product when appropriate instead of downloading replacements from untrusted sources.

4. Use Logs and Debugging When the Cause Is Still Unclear

Logs are useful when the visible error is intermittent, triggered by a plugin, or limited to one operation. Capture the failure before reinstalling, because reinstalling the application rarely repairs a damaged library database and may erase useful context.

4.1 Review Job Details

If the problem occurred while converting a book, downloading news, fetching metadata, sending mail, or transferring a file, open calibre's Jobs panel and view the failed job's details. A conversion or email error does not necessarily indicate library corruption.

Look for the first meaningful error, including permission failures, unavailable source files, malformed input, connection failures, or plugin exceptions. Test the operation with one known-good, non-protected file. Do not use these troubleshooting steps to bypass DRM or retailer restrictions.

Success means the known-good file completes and the library remains consistent. That points to a source-file, account, device, conversion, or plugin issue rather than database damage.

4.2 Start calibre in Debug Mode

calibre can be started in debug mode from the interface by right-clicking the Preferences button, or by using the documented keyboard shortcut. Advanced users can also launch the graphical interface from a terminal with calibre-debug -g.

Reproduce the problem once, close calibre normally, and inspect the resulting output. Note the operation, library path, affected book, and exact error. Avoid posting a complete log publicly until you have removed email addresses, usernames, local paths, server credentials, and other private information.

4.3 Test Without Third-Party Plugins

If calibre started failing after a plugin installation or update, run a controlled test without custom plugins. The command-line interface supports launching calibre while ignoring custom plugins. You can also disable a suspect plugin through Preferences and restart calibre.

Do not uninstall several plugins and modify the database at the same time. Change one condition, reproduce the symptom, and record the result. Success means the error disappears with plugins ignored and returns only when a particular plugin is active. At that point, leave the plugin disabled and stop altering the library.

5. Run a Clean Temporary Test Before Reinstalling

A clean temporary test is one of the safest ways to determine whether the problem belongs to the library, calibre's configuration, or the operating environment.

5.1 Test a Copied Library

  1. Close calibre and stop its Content server.
  2. Copy the entire affected library to a new local folder.
  3. Make a second untouched backup if the data is important.
  4. Open the copied folder as a separate calibre library.
  5. Run Check library on the copy.
  6. Test several books, metadata edits, covers, and searches.
  7. Restore the database on the copy only if the evidence justifies it.

If the copied library repairs successfully, retain it under a clearly different name until verification is complete. Compare book counts, important tags, custom columns, several authors, and a sample of each major format before adopting it as the replacement.

5.2 Create a Small New Library

Create an empty temporary library on a local drive and add two or three known-good, non-protected e-books. Edit their metadata, add a cover, close calibre, reopen it, and view the books.

If the temporary library works, calibre itself and the basic operating-system environment are probably functional. Focus on the original library's database, files, location, or permissions. If the temporary library fails in the same way, investigate configuration, plugins, security software, temporary-folder permissions, or the installation.

5.3 Reinstall Only After the Test

Reinstalling calibre replaces application files, but it does not automatically reconstruct metadata.db, restore deleted formats, resolve an unreliable network filesystem, or undo manual folder rearrangement. Reinstall only when a new local test library also fails or application files appear damaged.

Do not delete the existing library during reinstallation. Keep the complete backup disconnected from experimental changes. Success means the clean test library and repaired copied library both remain stable through multiple restarts.

6. Quick Fix Checklist

  • Confirm calibre is opening the correct top-level library folder.
  • Search for metadata.db if the expected library appears empty.
  • Close calibre and back up the complete library folder before repairs.
  • Compare missing database records with files actually present on disk.
  • Run Library maintenance and Check library.
  • Read the consistency report before deleting or accepting any cleanup.
  • Restore the database only when metadata.db is missing or damaged.
  • Perform restoration on a copied library whenever possible.
  • Do not manually rename, merge, or rearrange calibre-managed folders.
  • Move the active library from a NAS or network share to local storage.
  • Pause cloud sync and test a copy outside the synchronized folder.
  • Check folder permissions, free space, drive health, and read-only status.
  • Review antivirus, backup, conversion, and job logs for the first error.
  • Test without third-party plugins if failures began after a plugin change.
  • Create a small temporary library before reinstalling calibre.
  • Stop changing settings when books open, metadata persists, and checks complete normally.

7. Frequently Asked Questions

7.1 What does metadata.db contain?

metadata.db is the central SQLite database for a calibre library. It stores the catalog information calibre uses to display and manage books, including titles, authors, formats, tags, series, ratings, identifiers, custom fields, and paths to managed book folders. The e-book files themselves normally remain in the library's subfolders.

7.2 Will Restore database recover deleted e-book files?

No. Restore database can rebuild records from surviving folders and per-book OPF metadata, but it cannot recreate an EPUB, PDF, or other format that has been deleted. Recover missing formats from a backup, recycle bin, security-software quarantine, original lawful source, or another storage copy.

7.3 Why are book folders present when calibre shows no books?

The wrong library may be open, or metadata.db may be missing or unreadable. First use Switch/create library to select the correct top-level folder. If the correct folder is open and the database is damaged, back up the library and test Restore database on a copy.

7.4 Can I repair the library by moving files into the right folders?

Manual rearrangement is not recommended. calibre's database and managed folder structure must remain synchronized. Use calibre to add formats, change metadata, copy books between libraries, and export files. Manual moves can turn a limited problem into widespread missing-format and path errors.

7.5 Is it safe to keep a calibre library in cloud storage?

A live synchronized library can be exposed to conflict copies, partial synchronization, delayed renames, and multiple computers writing different states. A safer arrangement is to keep the active library on a local disk and synchronize a closed backup or exported copy. Never run calibre on two computers against the same actively synchronized library.

7.6 How do I know the repair is finished?

A successful repair has clear signs: the expected book count is plausible, representative formats open, metadata changes survive a restart, Check library shows no unexplained serious inconsistencies, and no new database errors appear during normal use. Once those conditions are met, stop changing settings, retain the pre-repair backup, and establish a regular complete-library backup routine.


Citations

  1. Official guidance on calibre libraries, metadata.db, database restoration, backups, and network-drive risks. (calibre Frequently Asked Questions)
  2. Official overview of Library maintenance, Check library, and restoring metadata from per-book OPF files. (calibre Graphical User Interface Manual)
  3. Official command reference for checking a library and rebuilding a corrupted database. (calibredb Documentation)
  4. Official reference for starting calibre in debug mode and debugging device detection. (calibre-debug Documentation)
  5. Official command reference for launching calibre while ignoring custom plugins. (calibre Command Documentation)
Cindy, ContentBASE creator assistant

MEET CINDY

Your ContentBASE creator assistant

Cindy helps creators find Canva templates, content ideas, and simple ways to make better social media posts faster.

Want ready-to-use templates? Claim the free Canva bundles or browse the full bundle store.