Quote:
Originally Posted by Adoby
It seems you have "orphan" books. This typically happen if you used some other tool than calibre to manage your books, and made a mistake. For instance copy a old version/copy/backup of the library OVER the current library. Having the library on a network share may or may not cause problems. In the calibre documentation you are clearly told not to! So don't be surprised when you experience strange problems if you disobey. (I have previously, for some years, successfully stored my library on a NAS, using NFS and Linux laptop client.)
The fix is simple: Create a new empty library with the same structure as the old. Then move the books from the old library to the new library, using calibre.
When you are done, what is left inside the folder of the old library is the orphan books. They may be duplicates only. But there may be some that are not duplicates. You can add all the books in the folder of the old library to the new library and skip all duplicates.
To avoid having this happen in the future you might consider storing the library on the laptop. And a backup copy on the network share. Keep the backup copy updated using some file sync utility. I like rsync from the command line, creating multi-generation snapshots, but there are many free Windows sync utilities you might use. Possibly also with multi-generation snapshot ability.
You can even use a copy of a backup copy as a read-only calibre library on some other device.
I have my calibre libraries stored on my laptop. And several backup rsync snapshot copies on the second SSD on my laptop. And several backup rsync snapshot copies on a NAS.
|
So - the Move library trick didn't work but then I managed to solve it!!
essentially I tried the following two things:-
1. After opening the existing library in Calibre; went to Switch/Create Library>Move Current Library to a new location, with "Copy structure from current library ticked" -- this MOVED the duplicates as well; and left "mostly" EMPTY, the author named folders in the previous location. Mostly because, in a very few instances, the books folders (and the ebooks themselves) were also left unmoved. These were NOT ALL folders though.
2. next, I did the simplest thing - In library maintenance, I ran "check library" option and voila- it neatly provides the list of all the files/directories which are not in my db and an option to mark/ delete them. It also provided a list of incorrectly labelled books (i.e. filename was inconsistent with naming convention; and an option to delete empty folders!. Deleted one book first after checking there were indeed 2 instances in directory structure and it correctly deleted the orphan. Then ran the whole shabang; and my calibre library was correctly compressed from 195GB to 82 GB with all 5102 books still there with their unique instances!! And it took just 5 minutes for it to do this.