|
The traceback shows the error happened in the "delete after copy" step, which runs against the library you are copying FROM (the currently open library), not the destination. So the copy itself most likely completed, and it is the source library's metadata.db that is damaged.
calibre has tools for exactly this, under Library maintenance. Click the arrow next to the calibre Library button in the toolbar, then Library maintenance:
1) First, as a precaution, close calibre and make a copy of the whole library folder (or at least of metadata.db in it).
2) Library maintenance->Check library. This runs an integrity check on the database and tries to repair it, then offers to check that the files on disk match the database. Often that is all you need.
3) If the check fails, use Library maintenance->Restore database. calibre keeps a backup of every book's metadata as a metadata.opf file in that book's folder, and this rebuilds metadata.db from those files. The old database is not deleted; it is renamed and kept in the library folder, and calibre tells you its name when the restore finishes. The OPF backups are written in the background, so a very recent metadata edit may not have made it into them yet. Otherwise your books, metadata and custom columns should all come back.
Once the source library is working again, the books you copied will still be in it, because the delete never happened. Check that they are present and fine in the destination library, then delete them from the source by hand.
|