Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 12-02-2010, 09:14 PM   #1
mabee
Junior Member
mabee began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2010
Device: zxreader
restore database help

Hi!
This is my second try at using calibre, and i´m really happy. Now my library is in order. I´ve been using it for about 3 months and i´ve added 15997 books, done conversions and reading in my pc. I was using calibre in a pendrive with a backup copy in my pc, but the library became too big for the pendrive, so i decided to send it to the pc. While using it from the pendrive the database suffered some problem i tried to run the calibre library maintenance and check the databse integrity but i get this error:ERROR: Error: Failed to check database integrity

Traceback (most recent call last):
File "site-packages\calibre\gui2\actions\choose_library.py", line 94, in run
File "site-packages\calibre\library\database2.py", line 2452, in check_integrity
File "site-packages\calibre\library\sqlite.py", line 232, in run
DatabaseException: database disk image is malformed
RemoteTraceback (most recent call last):
File "site-packages\calibre\library\sqlite.py", line 181, in run
File "sqlite3\dump.py", line 49, in _iterdump
DatabaseError: database disk image is malformed

I´ve searched this forum and google but i could not find a fix, i also ran "calibredb restore_database" from command line but it seems like nothing is fixed. Also i updated to calibre 0.7.31 and it was not fixed, i´m running calibre in windows vista at the pc and at work from windows xp.
Could someone help me please?
Mabee
mabee is offline   Reply With Quote
Old 12-02-2010, 10:19 PM   #2
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: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Questions:
- what version of calibre were you running when the problem happened? If it was before 0.7.21 (or there-abouts), the required OPF files will not have been generated, and restore_database won't do anything useful.

- Did you use the 'really do it' option when you ran the command?

- Could you post the output produced by calibredb restore_database?
chaley is offline   Reply With Quote
Advert
Old 12-03-2010, 07:30 AM   #3
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: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
@chaley, Does the check need drive space, as if it's on a pen drive (as seems here), that's full, would that cause the check to fail?
Perkin is offline   Reply With Quote
Old 12-03-2010, 07:38 AM   #4
mabee
Junior Member
mabee began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2010
Device: zxreader
Chaley:
Thank you for the quick answer.
I checked my library with treesize and all books have a metadata.opf file.
Also as far as i remember i was running version 0.7.28 when i ran the database check and i got an error message, my mistake was in not paying attention to it. I think i skipped installing a version and jumped to version 0.7.30 and then 0.7.31.
Could you send me the syntax for that "restore_database 'really do it' " command, i'm a newbie at command line in calibre. I won't be able to run that check till 11 pm (about 12 hours from now), and how do i get that "calibre restore_database" output?
Thank you,
Mabee
mabee is offline   Reply With Quote
Old 12-03-2010, 08:17 AM   #5
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
See this manual entry. The output is whatever the program prints into the console after you started it.
Manichean is offline   Reply With Quote
Advert
Old 12-03-2010, 08:20 AM   #6
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: 11,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Perkin View Post
@chaley, Does the check need drive space, as if it's on a pen drive (as seems here), that's full, would that cause the check to fail?
Yes, the check does need space, but not a lot. My guess is around double the size of the metadata.db file.

@mabee: Manichean has the right of it. Good luck!
chaley is offline   Reply With Quote
Old 12-03-2010, 01:25 PM   #7
mabee
Junior Member
mabee began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2010
Device: zxreader
Quote:
Originally Posted by Manichean View Post
See this manual entry. The output is whatever the program prints into the console after you started it.
Manichean:
should i type in start>run>
calibredb restore_database --really-do-it, -r
?
Mabee
mabee is offline   Reply With Quote
Old 12-03-2010, 04:56 PM   #8
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
Principially, that works. I'd suggest running "cmd" from start->run (or starting the command prompt from the start menu) and typing the command there. That way, you get to see the output it generates even after the program terminates- if you execute a console program via start->run, the output window gets closed as soon as that program is terminated.
Manichean is offline   Reply With Quote
Old 12-03-2010, 08:40 PM   #9
mabee
Junior Member
mabee began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2010
Device: zxreader
Manichean:
Thank you for the "cmd" advice.
I started cmd, changed directory (cd) to the directory where metadata.db is and this:

C:\Users\***\Biblioteca de calibre>calibredb restore_database "really-do-it
"
Usage: calibredb.exe restore_database [options]

Restore this database from the metadata stored in OPF files in each
directory of the calibre library. This is useful if your metadata.db file
has been corrupted.

WARNING: This command completely regenerates your database. You will lose
all saved searches, user categories, plugboards, stored per-book conversion
settings, and custom recipes. Restored metadata will only be as accurate as
what is found in the OPF files.


Whenever you pass arguments to calibredb.exe that have spaces in them, enclose t
he arguments in quotation marks.

Options:
--version show program's version number and exit

-h, --help show this help message and exit

-r, --really-do-it Really do the recovery. The command will not run
unless this option is specified.


GLOBAL OPTIONS:
--library-path=LIBRARY_PATH, --with-library=LIBRARY_PATH
Path to the calibre library. Default is to use the
path stored in the settings.


Created by Kovid Goyal <kovid@kovidgoyal.net>

What did i do wrong?
I´m worrried.
Mabee
mabee is offline   Reply With Quote
Old 12-03-2010, 09:03 PM   #10
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
According to your message, you left of the -- characters at the start of the --really-do-it option. As a result the command merely displayed it's help message giving the format of valid parameters and describing their purpose.
itimpi is offline   Reply With Quote
Old 12-03-2010, 10:56 PM   #11
mabee
Junior Member
mabee began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2010
Device: zxreader
Itimpi:
Thank you for that, it really helped.
i ran the recover and my library is recovered.
I want to thank you to everyone who helped me solve this problem.
I wrote this step by step of what i did, in case someone else has this problem.
Steps to recover a metadata.db in windows
1. start > run > cmd (enter)
2. change directory until you are in your library folder.
3. Type: calibredb restore_database "--really-do-it" (enter).
4. This process takes some time, depending on your database size, be patient
5. It´s over when appears thins message: restoring database succeeded, old database file saved as: metadata_pre_restore.db, this is saved in your library folder.
6. If there were errors a detailed report (metadata_db_restore_report.txt in saved in your library folder.
7. Start calibre and go to library maintenance > check database integrity, if no error appears your database is recovered.

I think that now i have to close the thread, but i don´t know how, how is it done?
Mabee
mabee is offline   Reply With Quote
Old 12-04-2010, 04:38 AM   #12
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 mabee View Post
3. Type: calibredb restore_database "--really-do-it" (enter).
Just as a side note: While they should do no harm, the quotation signs aren't needed.
Manichean is offline   Reply With Quote
Old 01-06-2011, 12:28 AM   #13
bookworm01
Junior Member
bookworm01 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2011
Device: nook
I am very new to Calibre and know very little about computers. I have a Macbook and I accidentally deleted my library. I have no clue how to restore my books back onto my library. Can someone help me? Please explain in laymen's terms
bookworm01 is offline   Reply With Quote
Old 01-11-2011, 02:16 PM   #14
Sinner3k
Enthusiast
Sinner3k began at the beginning.
 
Posts: 33
Karma: 10
Join Date: Jun 2010
Device: Aluratek Libre Pro, B&N Nook Classic, Pocket Edge, Kindle Fire
Thank you to everybody who contributed to this thread, it just saved my library! And with the easy to read instructions, I was able to restore the library while holding a newborn, which is a testament to how easy you guys made it. Somebody should sticky this thread.
Sinner3k is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] Calibre Backup and Restore Timber Calibre 21 06-01-2011 07:31 PM
Restore DB Sweetpea Calibre 17 10-21-2010 08:20 AM
PRS-600 Backup and Restore of Notes raymondchen625 Sony Reader 1 12-20-2009 11:49 PM
any one has kindle dx restore firmware?? chinaet Kindle Developer's Corner 0 07-25-2009 05:14 AM
iLiad Backup / Restore ? ce3po iRex Developer's Corner 3 11-18-2007 05:53 PM


All times are GMT -4. The time now is 11:19 PM.


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