The practical digital library updated

Library bookcaseA few years ago I moved my private library to the cloud. It uses Calibre to catalog my books, and the Open Publication Distribution System (OPDS) to provide an Internet-capable catalog. OPDS is built in to a lot of publisher-independent e-reader software. My e-readers can generally retrieve books from Internet hosts that provide OPDS.

My latest library uses COPS to construct the OPDS catalog from my Calibre database (book list). I update my library by keeping a copy of my Calibre database and directory of book files on a web server.

Originally I used calibre2opds to build an OPDS compatible directory. Unfortunately, calibre2opds seems to have been abandoned. When I run it on my Mac it demands I use a now-obsolete version of Java even though the documentation says the software uses the latest versions of Java. I posted a trouble ticket about this, and nothing has happened to it so far.

In any case, COPS is more efficient at keeping my library up to date. When using calibre2opds, I had to build the OPDS directory files separately. This produced hundreds of additional files that had to be separately updated on the server. It only took a few minutes to add books to Calibre, but it took a couple hours to locate and update all the revised files on the server.

To update my library with COPS, I simply add the new book files and associated directories. I also update the library database. There’s no OPDS directory structure to update. COPS builds the directory structures as needed, using the Calibre database.

Long term I might run into the same problem with support. COPS appears to be updated once a year, around late summer. According to the issue register on Github, calibre2opds was updated in early 2018. Perhaps it isn’t really dead yet. I may need to switch between them depending on which is better maintained over time. I really don’t want to apply my own rusty PHP or Python skills to support them myself.

Migration

Here’s a summary of the migration process from calibre2opds to COPS. I use a cheap shared hosting service. They maintain the Apache server, PHP, and access control to my site.

  • Prepare my server
    • The server needs to support a recent copy of PHP. No problem.
    • I edited the PHP initialization files (handled by the hosting provider) to activate ‘intl’ support
  • I uploaded the latest COPS software to the server.
    • It went in a separate directory from my library.
    • I edited the COPS local PHP config file to point to the directory containing my library. I forgot the trailing slash to start with.
    • I also changed the “library name” variable. It seems to display in upper case regardless of how you type it.
  • I removed the calibre2opds “_catalog” folder and its contents. Otherwise it might have been hard to tell if I were using the old or new directory.
  • I edited the settings in my e-readers to retrieve cops/index.php from the site. While I have HTML redirects to reach that file, OPDS doesn’t pay attention to these.

A wonderful feature of COPS is that it self-diagnoses installation errors. It displays a checklist of everything it needs and which things it couldn’t do or find. You just keep fixing the configuration till everything works.