Unable to Open Calibre after Moving Library
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I have found a problem with the Calibre program. I suppose that technically it is not a bug but there is a trap that can result in someone never being able to use Calibre again on the PC. I decided to move the Calibre library. I am now aware of the option to move a library within the program. At the time however, I moved the folder with a file manager and somehow also corrupted the "metadata.db" and "metadata_
If the restore function fails, please change the program to provide an option to open the program with no library, possibly in a way similar to how the program is opened for the first time. If I did not have a backup copy of my library, I would never have been able to use Calibre again. I have used other programs that use a library and have on occasion lost the connection to the library. These programs usually just open up with no content and then you can then reestablish the connection to the library through a file menu option. Having Calibre function this way would be preferable.
Changed in calibre: | |
status: | New → Invalid |
Calibre wouldn't have been forever broken. In fact, it didn't have any problems at all other than it was trying to read a mangled database and couldn't. There was nothing in the registry to clean (or at least, no more than the usual Windows crap.) Worst case scenario, rename the library and calibre won't find it. Or delete it. But you can easily fix it as follows:
Rename the broken library in the file explorer. Open calibre and create a new library. Close calibre.
******* ******* ******* ******* ******* ******* ******* ******* ******* ******* * ******* ******* ******* ******* ******* ******* ******* ******* ******* *
*** All device settings, conversion choices, tweaks, general stuff that is ***
*** cross-library is not stored in the db and stayed safe anyway. ***
*******
Copy the file metadata_ db_prefs_ backup. json from the old library folder to the new one -- this contains all the plugboards, custom columns, saved searches, virtual libraries, etc. and is backed up when calibre quits-- basically, anything that IS stored per-library. Even the data for the Overdrive link plugin, which unlike most plugins stores stuff in the database.
Open calibre, and go to Libraries ==> Library Maintenance ==> Restore Database.
Now import all your books from the renamed folder. Use Add Books ==> Add books from directories,... (One book per directory, assumes each file is the same book in a different format). Treating a calibre library as if it were a saved-to-disk library has worked for me several times, (adding from a portableapps windows library to a linux library if I forget to save,) and it takes into account all metadata changes saved into the metadata.opf backups.
All your info is now back -- the settings saved in the config folder, the per-library settings in metadata_ db_prefs_ backup. json, and the actual ebook files, which aren't edited by the database, together with the latest metadata changes you made. It will even add the metadata for you custom columns.