How to Organise a Big Calibre Library Without Losing Metadata
Tidy a big calibre library on Linux by working inside calibre, not the file system: back up the folder, fix metadata in bulk, and partition it with virtual libraries.
The fastest way to lose metadata is to tidy a calibre library by hand. On a library of a few thousand books, the honest answer is counterintuitive: leave the files alone and change the metadata inside calibre instead.
calibre keeps your books in a folder it manages, with the metadata in a SQLite database beside them. Rename a file or move a folder in your file manager and calibre no longer sees it. Per the calibre manual, the library folder and all of its contents are managed by calibre. Every step below works with that, not against it.
What you need
- calibre on Linux. Use the official binary install rather than your distro’s package. The download page warns that distro packages are often outdated. It needs
xdg-utils,wget,xz-utilsand Python already installed.
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
- The path to your library folder. calibre shows it when you click the calibre icon on the main toolbar.
- Free disk space for a copy of the library, so the backup is a real one.
- Optional: Calibre Zen for a calmer interface on the same library.
1. Back up the folder before you change anything
The library folder holds your books and their metadata. At its top level sits metadata.db, the SQLite database with the title, author, rating and tags for every book. To back it up, copy the whole folder with every file and sub-folder inside it, per the manual.
To back up settings and plugins as well, back up the config folder. Find it at Preferences → Miscellaneous. Restoring a config folder is not officially supported, but the manual says it should work in most cases.
There is a built-in path too. Right-click the calibre icon on the toolbar and choose Export/import all calibre data, then Export all your calibre data. Disconnect any device first or the option is greyed out. It writes your books, settings and plugins to one folder, which you can copy to another machine and import.
2. Leave the files where calibre put them
calibre copies each book into sub-folders by author and title, and keeps the catalogue in metadata.db. Do not add, rename, move or delete files in the folder yourself: the manual warns that calibre may delete files it did not create. To attach an extra file to a book, use the top-right area of the Edit metadata dialog, or Add books → Add data files to selected book records.
The reason this matters is that search beats folders. The manual’s own example: a Genre → Author → Series → ReadStatus folder scheme makes it easy to find Asimov’s Foundation books, but there is no quick way to list every unread science fiction book without rearranging the whole tree. In calibre you tag the genre and the read status once, then search tag:scifi and not tag:read.
3. Fix metadata in bulk, not one book at a time
Select several books with Ctrl-click or Shift-click, then click Edit metadata. With more than one selected, calibre opens the Bulk metadata edit dialog. Set the author, publisher, rating, tags or series for all of them at once. It is built for a batch you just imported that shares values.
The dialog has a Search and replace tab that runs plain text or regular expressions and can copy one column into another. It applies after the other tabs, so use it on its own if you are unsure what the result will be.
Authors are their own entity. Right-click an author in the Tag browser and choose Manage authors to fix the name and its sort form, which updates that author on every one of their books. Separate multiple authors with &. The default sort assumes First name Last name and stores Last name, First name. Change that at Preferences → Advanced → Tweaks with the author_sort_copy_method setting.
To fill gaps from the internet, select the books, right-click Edit metadata and choose Download metadata. You can take metadata, covers, or both.
4. Split a large collection with virtual libraries and saved searches
A virtual library makes calibre show only part of the collection while every book stays in place. The manual calls it the way to partition a large collection into smaller, manageable chunks. Create them from the tutorial linked in the manual, in Search & sort → Virtual libraries.
Saved searches do the rest. Type a search in the search bar, give it a name in the Saved Searches box, and click the plus icon. You can then reuse it with one click from Saved searches in the Tag browser. The full-text button at the left of the search bar indexes the text inside your books, so a word search reaches past the metadata.
5. Add columns for what calibre does not track
calibre ships columns for the common fields, and you add the rest at Preferences → Interface → Add your own columns. In the add-column dialog, Quick create makes a column for the ISBN or the formats, and the template language builds “virtual columns” that combine other columns.
Custom columns and saved searches live inside the library folder, so the backup from step 1 covers them. That is another reason to copy the whole folder and not just the book files.
6. Move, merge and recover libraries
A calibre library is just the folder and everything in it, and you can keep more than one. Click the calibre icon on the toolbar to create, remove, rename or switch libraries. With two libraries set up, right-click a book and choose Copy to library to move or copy it across.
If the book list comes up blank, calibre has lost the path to the folder. Right-click the calibre icon, choose Switch/create library, and point it at the folder with the blue icon. If you do not know where the folder went, search the disk for metadata.db.
Moving to a new computer is the same export and import from step 1: it carries your books, settings and plugins in one go.
7. Read the same library in Calibre Zen
Calibre Zen is calibre with a new interface layer on top. It wraps calibre’s own binary, so your library, plugins and formats are still calibre’s. It opens an existing calibre library as it is, and both apps can open the same library, one at a time. Its welcome wizard can copy your calibre settings across once. The full comparison is in Calibre Zen vs calibre, and the newer tools around the format are in Calibre alternatives.
When it won’t help
- You already moved files by hand. calibre cannot find books whose files it did not place. Restore the backup and redo the work through calibre.
- The library is on a NAS. Unsupported, as above. Run calibre on one machine and share it with the Content server.
- The metadata was never entered. calibre copies what is inside the file. Bulk edit and metadata download can fill gaps, but calibre will not invent a title or author.
- The books are DRM-locked. Per the manual, calibre can store and transfer a purchased EPUB but cannot open it. You need Adobe Digital Editions to authorize the reader first.
- Two copies of calibre are open on the same library. calibre is a single-user application. Open a library in one app at a time.
Takeaways
- Back up the whole library folder first: it holds both the books and
metadata.db. - Organise by editing metadata in bulk and by using virtual libraries, never by moving files.
- Keep the library on a local disk, and sync it with rsync or Dropbox only while calibre is closed.
- Add custom columns for anything calibre does not track, since they back up with the folder.
- Empty lists and moved folders are recoverable from the backup, so make one before you start.
Questions
Will tidying my calibre library folder break calibre?
Yes. calibre manages the folder and the metadata.db inside it. Rename or move files by hand and calibre loses those books. Change the metadata inside calibre instead.
Can I put my calibre library on a NAS or network drive?
No. The calibre manual says not to. Network filesystems often lack locking and hardlinking, and two copies of calibre on the same library corrupt it. Use the Content server, or sync with rsync or Dropbox while calibre is closed.
Does Calibre Zen change my calibre library?
No. Calibre Zen opens the same library folder as calibre. Both apps can read it, one at a time, and neither changes the other's settings.
Read next
- Calibre Zen 0.2: Move From calibre in One ClickCalibre Zen 0.2.0 brings your calibre settings, library and plugins over in one click, and adds updates from inside the app, a smaller Edit metadata window and a Flatpak.
How to Convert MOBI to EPUBConvert a MOBI ebook to EPUB in calibre or Calibre Zen: add the book, pick the output format and profile, end up with a real table of contents, and send it to your reader.
How to Convert MOBI to AZW3Convert a MOBI ebook to AZW3 (KF8) in calibre or Calibre Zen: check what your file really is, set the output format and a Kindle profile, and move it to your Kindle by USB.