Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 05-12-2019, 09:38 PM   #1
ranchero
Junior Member
ranchero began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2019
Location: On a Mexican beach
Device: kindle
Empty calibre after disk crash/replacement

My e: disk crashed, fortunately, Calibre was fully backed up by File History (Windows 8.1). The computer techs installed a new drive and restored the disk from File History.

I now have ALL the books, a LOT of .db backup files (e.g. metadata (2019_05_04 03_04_43 UTC).db) and a zillion .json files

(e.g. metadata_pre_restore.db)

but an empty Calibre. The library appears to have been restored entirely but with a wiped out metadata.db file. Attempts to rebuild it resulted in empty Calibre.

I backed up the library again before experimenting, using all the suggestions I could find in the manual and forums, but I am missing something.

Can anyone point me in the right direction?

Thanks
rob
Attached Thumbnails
Click image for larger version

Name:	Calibre .db files.jpg
Views:	32
Size:	63.4 KB
ID:	171437  
ranchero is offline   Reply With Quote
Old 05-12-2019, 10:51 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 23,063
Karma: 24012262
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab A, Kobo Aura2
The prerestore is generated by the restore process. It does not exist in a working Library (and is deleted upon completion of the restore)
2 files you need
<rename the latest <dated> metadata.db to metadata.db
You should hopefully have metadata_db_prefs_backup which is the structure and settings that apply to the columns
theducks is offline   Reply With Quote
Old 05-14-2019, 05:34 PM   #3
ranchero
Junior Member
ranchero began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2019
Location: On a Mexican beach
Device: kindle
I rename dthe latest dated metadata.db to metadata.db

I did not have a metadata_db_prefs_backup, but I renamed "metadata_db_prefs_backup.json"] to "metadata_db_prefs_backup", although I was pretty sure that would fail.

Well, the rebuild failed (I used Switch/create library). This was the message.

calibre, version 3.42.0
ERROR: Failed to repair library: Restoring database failed, click Show details to see details (the metadata.db file appears untouched. There is a new metadata_db_prefs_backup.json containing only 14KB).

Traceback (most recent call last):
File "site-packages\calibre\db\restore.py", line 128, in run
File "site-packages\calibre\db\restore.py", line 281, in replace_db
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'E:\\LIBRARY\\metadata.db'

Any advice on next step? I appear to have my original library, a metadata.db file of some 14MB. Could I create a new Calibre library by exporting the data] to a new Library 2 file?

thanks rob
ranchero is offline   Reply With Quote
Old 05-14-2019, 06:40 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 23,063
Karma: 24012262
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab A, Kobo Aura2
Quote:
Originally Posted by ranchero View Post
I rename dthe latest dated metadata.db to metadata.db

I did not have a metadata_db_prefs_backup, but I renamed "metadata_db_prefs_backup.json"] to "metadata_db_prefs_backup", although I was pretty sure that would fail.

Well, the rebuild failed (I used Switch/create library). This was the message.

calibre, version 3.42.0
ERROR: Failed to repair library: Restoring database failed, click Show details to see details (the metadata.db file appears untouched. There is a new metadata_db_prefs_backup.json containing only 14KB).

Traceback (most recent call last):
File "site-packages\calibre\db\restore.py", line 128, in run
File "site-packages\calibre\db\restore.py", line 281, in replace_db
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'E:\\LIBRARY\\metadata.db'

Any advice on next step? I appear to have my original library, a metadata.db file of some 14MB. Could I create a new Calibre library by exporting the data] to a new Library 2 file?

thanks rob
The filename DOES have .json as its extension
It is small because it only describes the structure (columns and type, and setting for the. No Data.
The restor processes uses the json file to create an empty table that matched the oldne.
The next step scans the folders and uses the OPF file to populate the table (this is what takes time. Read the file, validate, make the entry. Repeat)
theducks is offline   Reply With Quote
Old 05-15-2019, 08:07 PM   #5
chaley
CC Android & calibre dev
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: 8,927
Karma: 2737706
Join Date: Jan 2010
Location: UK
Device: Many android devices
Quote:
Originally Posted by ranchero View Post
Traceback (most recent call last):
File "site-packages\calibre\db\restore.py", line 128, in run
File "site-packages\calibre\db\restore.py", line 281, in replace_db
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'E:\\LIBRARY\\metadata.db'
That message says that *something* is trying to read metadata.db at the same time that calibre is using it. If E: is a network shared drive or a folder synced by Dropbox, Onedrive etc; then copy that folder to a local drive and try again.

The same thing can happen if you are using an aggressive antivirus. In this case try turning it off for the duration of the restore.
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
saving book to disk remove empty sting reup Library Management 2 12-22-2017 04:10 AM
Recovering Calibre Windows 64 after disk crash tytrate Library Management 1 02-03-2016 08:05 PM
Reinstall Calibre after a disk crash, have a recovered Library folder indigene Library Management 3 11-07-2012 10:14 AM
calibre crash libero6 Calibre 1 10-12-2011 03:41 PM
Calibre 0.7.22, Empty eBooks not saved on Save to disk? Nadrek Calibre 3 10-04-2010 12:24 PM


All times are GMT -4. The time now is 09:03 AM.


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