05-15-2017, 04:26 AM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: May 2017
Device: Kobo Glo HD
|
Corrupted library won't restore
Hi all. I have a sizeable library that I've been slowly organising.
It's stored on an external HDD along with Calibre Portable. Recently I noticed a bunch of strange looking folders with garbled names on the hard drive, and without thinking I deleted them. (I know, I know) Next time I loaded Calibre it told me the database was corrupt, and it took a good few hours to go through the repair process and then failed. I've tried to restore the deleted folders but with no luck. This is the error message: calibre, version 2.83.0 ERROR: Failed to repair library: Restoring database failed, click Show details to see details Traceback (most recent call last): File "site-packages\calibre\db\restore.py", line 127, in run File "site-packages\calibre\db\restore.py", line 280, in replace_db WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'E:\\eBooks\\metadata.db' I'd greatly appreciate any help in getting it sorted. I thought I may just create a whole new library, but when doing a test run on one author the metadata was all over the place (some swapped author/titles, missing metadata and covers etc) so it seems Calibre hasn't been updating the files themselves as I'd hoped, and if I re import the whole library I will lose all of my work in cleaning it up. Thanks |
05-15-2017, 04:32 AM | #2 |
creator of calibre
Posts: 44,783
Karma: 25490594
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Run the restore from the command prompt, with calibre closed, like this:
calibredb restore_database -r |
Advert | |
|
05-15-2017, 05:09 AM | #3 |
Junior Member
Posts: 5
Karma: 10
Join Date: May 2017
Device: Kobo Glo HD
|
Thanks Kovid. It didn't work - unfortunately I think I've stuffed things up irreversibly by trying to fix the problem myself rather than coming here first and asking for help from the experts.
Edit: I've managed to get a backup of the database from another hard drive I had this synced to. It's a month since I last synced them so I've lost some work but I'm not back to square one at least. I now have a library sitting in a folder that contains more books than are included in the library. What is the best way to add the new books while skipping over the ones that are already in the library? Last edited by Geta; 05-15-2017 at 05:52 AM. |
05-15-2017, 05:48 AM | #4 |
creator of calibre
Posts: 44,783
Karma: 25490594
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You want one book per directory not multiple books per directory to restore.
|
05-15-2017, 05:55 AM | #5 |
Junior Member
Posts: 5
Karma: 10
Join Date: May 2017
Device: Kobo Glo HD
|
Thanks mate, you're a life saver. Thanks for taking the time to help me out
|
Advert | |
|
05-15-2017, 12:33 PM | #6 |
Junior Member
Posts: 5
Karma: 10
Join Date: May 2017
Device: Kobo Glo HD
|
Unfortunately it wasn't so easily solved....
I copied the database file from the other HDD and started importing the folder to bring in the 'new' books. It got a bit of the way through before giving an error - something about the import robot(?) failing. Clicking details showed me which book it happened on, and since it wasn't a book I cared about much I simply deleted it, and tried again. The same thing happened once more on a different book. I closed Calibre down and restarted it, and then when I tried to go into the library it gave a database corrupt error. Trying to restore it got most of the way through, until it failed towards the end with this message: calibre, version 2.83.0 This is the message it shows when I try to open it now:ERROR: Failed to repair library: Restoring database failed, click Show details to see details Traceback (most recent call last): File "site-packages\calibre\db\restore.py", line 127, in run File "site-packages\calibre\db\restore.py", line 280, in replace_db WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'E:\\eBooks\\metadata.db' calibre, version 2.83.0 Corrupted database: The library database at E:\eBooks appears to be corrupted. Do you want calibre to try and rebuild it automatically? The rebuild may not be completely successful. Traceback (most recent call last): File "site-packages\calibre\gui2\ui.py", line 648, in library_moved File "site-packages\calibre\db\legacy.py", line 78, in __init__ File "site-packages\calibre\db\cache.py", line 350, in init File "site-packages\calibre\db\backend.py", line 1239, in read_tables File "site-packages\calibre\db\tables.py", line 110, in read File "c:\cygwin64\home\kovid\sw\build\apsw-3.8.2-r1\src\cursor.c", line 231, in resetcursor CorruptError: CorruptError: database disk image is malformed I tried to run the repair function from the command line again, but it gives this error: E:\eBooks\1 - Calibre Portable\Calibre>calibredb restore_database -r Possibly as the library isn't in the default directory? (I can move it there if it will help)Qt: Untested Windows version 10.0 detected! Starting restoring preferences and column metadata ... 0% Cannot restore preferences. Backup file not found. ... 100% Restoring database failed with error: Traceback (most recent call last): File "site-packages\calibre\db\restore.py", line 127, in run File "site-packages\calibre\db\restore.py", line 281, in replace_db File "shutil.py", line 83, in copyfile IOError: [Errno 2] No such file or directory: u'C:\\Users\\danie\\OneDrive\\Documents\\Calibre Library\\metadata.db' I can delete the corrupted database file and restore it with the one from the other HDD again but I can only imagine the same thing will happen again so I'm not sure where to go from here. |
05-15-2017, 12:44 PM | #7 |
creator of calibre
Posts: 44,783
Karma: 25490594
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Umm if you are getting repeated database corruption then you have bigger problems. Either the disk is failing or you have put the calibre lirbary on some kind of non-native filesystem, such as a network share, dropbox folder or the like.
Move your calibre library to an NTFS internal disk and then add your old books. |
05-15-2017, 02:32 PM | #8 |
Junior Member
Posts: 5
Karma: 10
Join Date: May 2017
Device: Kobo Glo HD
|
I did a clean install of Calibre on my laptop, copied the books over and the database file from my back up HDD and then added the other books.
All worked perfectly so I guess either the HDD is dodgy, or a little 2.5" portable HDD just can't run a library of 10k plus books... Anyway, thanks for your help and for making such a great program. |
02-04-2022, 01:26 PM | #9 | |
Enthusiast
Posts: 25
Karma: 20670
Join Date: Jan 2013
Location: Catamaran (around the world)
Device: PW3, K4NT, KT, KT2 5.6.0 (2443690034)
|
Restore a specific corrupted library
Quote:
I am afraid I might bollix things up some more if I simply move these libraries elsewhere for the time being... BTW, thank you so much for everything! |
|
02-04-2022, 01:41 PM | #10 | |
Well trained by Cats
Posts: 30,594
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
You may need to use a POWERED USB Hub to get the extra ports AND enough power. Be sure to exit Calibre, then wait for the activity LED on the drive to stop blinking (the buffer may be flushing) before shutting down. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Restore annotations from corrupted db | Lucas Malor | Kobo Reader | 9 | 11-29-2016 06:01 PM |
Corrupted Library Won't Restore | pkw57 | Library Management | 6 | 04-02-2016 06:32 AM |
Mac version: corrupted database - restore fails | neilio | Calibre | 3 | 04-08-2013 05:28 PM |
Help. won't finish boot. complete restore? | tidixon | Sony Reader | 4 | 10-13-2008 11:19 AM |