Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-21-2010, 12:48 PM   #16
zin
Junior Member
zin began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2010
Device: android
Of course this happened to me before it got backed up. In fact, I was doing some cleanup, fixing some tags, adding some new books, before I moved the whole database to where my auto backup would pick it up. I had originally loaded the software on a crappy laptop just to give it try, and before I knew it, it had 1000 books and everyone in the house was accessing it via wifi. I thought the new network server would be better than a 6 year old laptop where the battery wouldn't hold a charge. I just didn't move quick enough!

I tried setting "Read metadata from file contents" and it made a bigger mess.

So, am I correct in assuming:
1. All secondary author info is only stored in metadata.db
2. The full (not truncated) book name is only stored in metadata.db
3. All book covers are stored as "cover.jpg" and whether the book has a "cover.jpg" is stored in metadata.db

It turns out I never deleted the source book files (thank you, overly large disk drives), so if I add all of them again from there into a clean library, I'll at least get the books and authors back. The pain will be the covers. Any ideas?

Thanks in advance.
zin is offline   Reply With Quote
Old 09-21-2010, 01:58 PM   #17
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by zin View Post
So, am I correct in assuming:
1. All secondary author info is only stored in metadata.db
2. The full (not truncated) book name is only stored in metadata.db
3. All book covers are stored as "cover.jpg" and whether the book has a "cover.jpg" is stored in metadata.db
Unfortunately, the answer is "Yes." To put it another way, all metadata is stored in the database - metadata.db. If there's metadata stored anywhere else, it's a byproduct of the fact that Calibre accesses files by labeling them with bits of metadata, or because the user has intentionally stored that metadata elsewhere in a backup, opf file or inside a format/file by making a same format conversion.

(More accurately, on point 3, I believe the database does not store whether the book has a "cover.jpg." Calibre just looks to see if it exists.)
Starson17 is offline   Reply With Quote
Advert
Old 09-21-2010, 02:51 PM   #18
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 657
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
I've just nearly had this problem, but luckily I had a very recent backup.

My solution would be for calibre to also store an *opf file in the directory with each of the entries, storing all the metadata, so it would be able to re-import the data if needed.

See this thread, for details
https://www.mobileread.com/forums/showthread.php?t=99193
Perkin is offline   Reply With Quote
Old 09-21-2010, 05:47 PM   #19
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by chaley View Post
Yes, you can recover this way.

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.
This is what I'm getting, correct me if I'm wrong.

For all the talk about making things much much worse, you don't go to a backup unless things are already bad.

Bottom line your saying if you have to go to a backup, restore a complete backup. That most likely an incremental step like restoring just the metadata.db file will prolong your frustration and in the long run cause more head banging or hair pulling.
DoctorOhh is offline   Reply With Quote
Old 09-21-2010, 09:44 PM   #20
zin
Junior Member
zin began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2010
Device: android
Quote:
Originally Posted by Starson17 View Post
Unfortunately, the answer is "Yes." To put it another way, all metadata is stored in the database - metadata.db. If there's metadata stored anywhere else, it's a byproduct of the fact that Calibre accesses files by labeling them with bits of metadata, or because the user has intentionally stored that metadata elsewhere in a backup, opf file or inside a format/file by making a same format conversion.

(More accurately, on point 3, I believe the database does not store whether the book has a "cover.jpg." Calibre just looks to see if it exists.)
Tonight I will test your comment on point 3. If you're right, you might have just saved me a lot of effort playing with book covers. I essentially have two near-identical file structures: The old one with no metadata.db, but all the cover.jpg files, and the new one with a correct metadata.db and no cover.jpg files. I can copy the old one over the new one (just the jpgs!) and they should go in the correct places. There are more than 1000 cover files, so it's worth a try. I will of course make copies before trying this.

Also, on the backup/restore part of the discussion, just based on my near-catastrophic database problems, I agree with dwanthny completely - the only way to back up this database is to backup the entire database. Disk space is cheap.

Thanks again for the info/advice.
zin is offline   Reply With Quote
Advert
Old 09-21-2010, 10:31 PM   #21
Dopedangel
Wizard
Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.
 
Dopedangel's Avatar
 
Posts: 1,793
Karma: 30548723
Join Date: Dec 2006
Location: Singapore
Device: Boyue
Quote:
Originally Posted by zin View Post
Tonight I will test your comment on point 3. If you're right, you might have just saved me a lot of effort playing with book covers. I essentially have two near-identical file structures: The old one with no metadata.db, but all the cover.jpg files, and the new one with a correct metadata.db and no cover.jpg files. I can copy the old one over the new one (just the jpgs!) and they should go in the correct places. There are more than 1000 cover files, so it's worth a try. I will of course make copies before trying this.

Also, on the backup/restore part of the discussion, just based on my near-catastrophic database problems, I agree with dwanthny completely - the only way to back up this database is to backup the entire database. Disk space is cheap.

Thanks again for the info/advice.
I personally think calibre should have a built in backup that backs up metadata.db every time you open calibre for lets say five times it won't be foolproof but in case of metadata.db corruption it could ask if you want to use an older version and save many headaches.
I personally use dropbox so thats backs up the metadata.db for me automatically.
Dopedangel is offline   Reply With Quote
Old 09-22-2010, 04:01 AM   #22
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by Dopedangel View Post
I personally think calibre should have a built in backup that backs up metadata.db every time you open calibre for lets say five times it won't be foolproof but in case of metadata.db corruption it could ask if you want to use an older version and save many headaches.
I personally use dropbox so thats backs up the metadata.db for me automatically.
Uhm, it has been said in this thread that replacing your metadata.db with an older version leads to much headache and hairpulling and thus isn't recommended. So I don't see why the developers would include that as an "official" backup method.
Manichean is offline   Reply With Quote
Old 09-22-2010, 05:12 AM   #23
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by chaley View Post
Quote:
Originally Posted by dwanthny View Post
I'm confused. How will restoring just the metadata.db make things much much worse? It will create blank folders with no books but it won't cause any folders to go poof, will it? Running a database integrity check at this point will point out any mismatches and you can manually search for the missing items or re-add those items via the metadata edit window.
No, calibre won't create blank folders.
Ok, folks are starting to not understand things.

Calibre will, in fact, create empty folders, based on the metadata.db file. Try it yourself. Create an empty library, exit calibre, place a large metadata.db file in the completely empty library (mine had 4019 book) in place of the recently created metadata.db and when you start calibre it will populate that empty library with a complete folder structure that matches what the metadata.db file says should be there. There won't be any files but the entire folder structure will be created (see attached).

Quote:
Originally Posted by chaley View Post
This must be done before calibre notices that the folders are missing and changes the db.
Calibre does not change the metadata.db file to match the existing folders, it changes the existing folders to match the metadata.db file. It will create folders to match the db but not delete or change any existing folders.

Quote:
Originally Posted by Manichean View Post
Uhm, it has been said in this thread that replacing your metadata.db with an older version leads to much headache and hairpulling and thus isn't recommended. So I don't see why the developers would include that as an "official" backup method.
While I don't think this should be a feature and that doing a full restore from back up is the least problematic method to restore a library, it may not be the quickest, and doing a full restore is not your only option.

If I had been updating my library for a week (since the last full backup) and I get hit by a power glitch that corrupts my metadata.db file. Simply replacing the corrupt metadata.db file with a recent backup from the last time the metadata.db file was updated prior to the power glitch is a quick way to get you back up and running with minimal risk to pulling out any hair. My metadata.db file using Dropbox version 0.8.?? is backed up every time the file is changed.

While there may be items lost, running a database integrity check should point out where any discrepancies lie. There is virtually zero chance of things getting much worse then not working to begin with, which is the state the library would have been in when you tried to restore it. And there is virtually every chance that the restoration will be a smooth one with minimal bumps in the road.
Attached Thumbnails
Click image for larger version

Name:	empty_library.jpg
Views:	229
Size:	88.3 KB
ID:	58613   Click image for larger version

Name:	empty_library_file_structure.jpg
Views:	221
Size:	171.9 KB
ID:	58614  

Last edited by DoctorOhh; 09-22-2010 at 05:18 AM.
DoctorOhh is offline   Reply With Quote
Old 09-22-2010, 06:18 AM   #24
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by dwanthny View Post
Calibre will, in fact, create empty folders, based on the metadata.db file. Try it yourself.
Just did. You are right. And I think that calibre should not do this.
Quote:
While I don't think this should be a feature and that doing a full restore from back up is the least problematic method to restore a library, it may not be the quickest, and doing a full restore is not your only option.
You pays your dues, you takes your choice.

I don't want to deal with someone asking why his/her foot got shot, so I won't provide a loaded gun. Others may make a different decision.
chaley is offline   Reply With Quote
Old 09-22-2010, 06:19 AM   #25
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by chaley View Post
I don't want to deal with someone asking why his/her foot got shot, so I won't provide a loaded gun. Others may make a different decision.
Seems like a reasonable position to me.
DoctorOhh is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 06:52 PM.


MobileRead.com is a privately owned, operated and funded community.