09-20-2010, 01:44 AM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2010
Device: android
|
Database problem
Calibre locked up while I was adding a book. I think there was a disk or file system issue.
After killing the locked up program, I restarted Calibre and the library came back with 0 books. It should be 1000+. The location is correct and the directory structure with all the actual books is there, but the database somehow got lost or cleared. The metadata.db file is about 100k. Is there any method to restore the database? If the answer is no, is there any easy way to re-add all my books? I didn't have much metadata entered but I did have cover pictures for most books. Thanks, Zin |
09-20-2010, 02:24 AM | #2 |
Enjoying the show....
Posts: 14,270
Karma: 10462841
Join Date: Jun 2008
Location: Arizona
Device: A K1, Kindle Paperwhite, an Ipod, IPad2, Iphone, an Ipad Mini & macAir
|
Welcome to MobileRead, Zin.
Hope your problem gets sorted out soon! |
09-20-2010, 05:26 AM | #3 | ||
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Quote:
Once this library is created click on the drop down arrow next to the Add Books icon (top left) select Adding books from directories, including sub directories (one book per directory, assumes every ebook file is the same book in a different format) now select the directory you previously used for your library and wait until it finishes adding those books to this library. Since the much of the metadata was kept in the metadata.db file some of the metadata maybe lost, but the books and covers should all be added. Last edited by DoctorOhh; 09-20-2010 at 05:30 AM. |
||
09-21-2010, 01:10 AM | #4 |
Junior Member
Posts: 4
Karma: 10
Join Date: Sep 2010
Device: android
|
Well, it almost worked.
Only about 2/3 of the books were added, none of the covers, and any books with multiple authors lost all but the first. Any other ideas, or do I have a big job ahead of me? Thanks in advance, zin |
09-21-2010, 05:08 AM | #5 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
It should have been more successful and if the covers are in the directories I thought it would work. Check Preferences - Import/export - Adding Books and ensure that Read metadata from file contents rather then file name is checked (see attached). If it wasn't checked, check it and start from the beginning. If it was checked already, you may just have a lot of work ahead of you. Hopefully from here on out you will learn to backup your library / metadata.db file. Last edited by DoctorOhh; 09-21-2010 at 05:16 AM. |
|
09-21-2010, 05:46 AM | #6 |
Wizard
Posts: 2,013
Karma: 251649
Join Date: Apr 2010
Location: Tempe, AZ, USA, Earth
Device: JetBook Lite (away from home) + 1 spare, 32" TV (at home)
|
I'm using an online backup service to backup my data files. If I were to lose my metadata, couldn't I just grab the latest library folder from the backup service and just paste in place of the corrupted one?
|
09-21-2010, 06:01 AM | #7 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Absolutely, As long as that backup includes the metadata.db file which is typically in the root of the library folder structure. If the structure of you library is fine just restoring the metadata.db file could be enough for it to all come together again.
|
09-21-2010, 06:53 AM | #8 |
Wizard
Posts: 2,013
Karma: 251649
Join Date: Apr 2010
Location: Tempe, AZ, USA, Earth
Device: JetBook Lite (away from home) + 1 spare, 32" TV (at home)
|
Cool! I'm covered without having to lift a finger. I had thought so but verification is always nice.
|
09-21-2010, 07:55 AM | #9 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Note that books that have had an author or title change since the last backup will be 'lost' if you restore the database. Reason: author and title are used to construct the folder path for the book. When you change one of them, the folders are moved to the new names. Restoring a metadata.db with the old author/title metadata will look in the old (and now non-existent) folder. Result: books are gone.
This was the reason I decided not to do an automatic backup of metadata.db when you do a search/replace. If you were playing with authors or titles, restoring the old copy could make the problem much much worse. I didn't want to imply a promise we couldn't keep. |
09-21-2010, 08:15 AM | #10 | ||
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Quote:
The nature of the beast is that you don't restore from backup until there is a problem. Depending on how you back things up restoring the metadata.db file might be the route to minimized loss of metadata. My metadata.db file is backed-up on the fly every time it is changed. I can try the last 150 backups in order and never physically lose a file because of it. Of course if restoring just the metadata.db file doesn't produce the results you like, restoring the entire library is still an option. Maybe I'm missing something, the promise of a backup is that you can recover to the last point in time you actually backed up your files. Last edited by DoctorOhh; 09-21-2010 at 08:17 AM. |
||
09-21-2010, 08:44 AM | #11 | |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Quote:
|
|
09-21-2010, 09:31 AM | #12 | ||
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Assume that I change an author from Joe to John. Calibre will change the metadata in the db, then rename the folder 'Joe' to 'John'. Now I restore the db from before. It thinks that the author is Joe, and that the folder is 'Joe'. Unfortunately, the folder 'Joe' does not exist, which is something that is not supposed to happen. In addition, the folder 'John' is sitting out in space, loved by no one. Quote:
If you are careful, before running db integrity you can manually change the authors back to what they were, and the floating-in-space folders will be found and used. This must be done before calibre notices that the folders are missing and changes the db. The reason it is 'much much worse' is that restoring a db can have catastrophic unintended consequences. For example, assume a user did something to tags that s/he didn't like. Perhaps all of them were turned to the letter Z or some such, it doesn't matter. In the same operation, the user changed the authors of the selected books on the first screen (yes, this is possible). Noticing the bad tags, the user says 'Hey, it made a backup' and restores it. At this point the tags are made right but all the formats are are made gone. Ouch. |
||
09-21-2010, 10:48 AM | #13 | |
Well trained by Cats
Posts: 29,807
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
If Calibre were to use this number, similar to that used for numbering title file names, finding "orphans" should now become a rather trivial (Not in list) operation |
|
09-21-2010, 11:02 AM | #14 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
09-21-2010, 11:44 AM | #15 | |
Well trained by Cats
Posts: 29,807
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
but now that you mention it, the old one was NOT discarded. (so why are there gaps in the numbers?). |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre problem to start (database) | disi | Calibre | 1 | 10-11-2010 06:35 PM |
What Database? | LadyLou | Calibre | 8 | 02-12-2010 06:32 AM |
Exporting the database... | mharrop19 | Calibre | 8 | 11-17-2009 05:54 PM |
duplicates in database | RJA | Calibre | 3 | 06-22-2009 09:06 AM |
new database format | alexxxm | Calibre | 10 | 11-19-2008 03:45 AM |