View Single Post
Old 09-03-2014, 03:38 PM   #1
gsparks2
Connoisseur
gsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-books
 
Posts: 93
Karma: 886
Join Date: Apr 2005
Device: Moon+ Reader Pro on Samsung Galaxy S7 Edge International version
Restore Database Experience or How to Learn to Be Careful

I am using Calibre 2.1 on Win 7 64 bit system.
I had my entire Calibre library synced with Calibre Companion on my Samsung S4. I have a large library (thousands).

So, I inadvertently removed my main library from Calibre.

How I did this was with an uncoordinated, spastic flick of the wrist when trying to quick switch to a different Calibre Library. The select library dialog for Quick Switch, Rename, and Remove Library look EXACTLY THE SAME with no "are you sure?" dialog for Rename and Remove sequences. (would be nice to have)

When I saw that I had removed my main library from Calibre, and after I stopped crying, I started to figure out ways to get it back.

The first thing I did was create a new Calibre library and connected with my device. I saw that I can view the list of books on the device and I could transfer from device to Calibre using Calibre Companion. Neat.

As I watched the phone screen flash, and saw that little was happening the in the new Calibre Library folder, I decided to explore other options. So while the computer and phone were happily playing with each other and laughing at me, I went exploring to find Another Way.

Searching this forum I learned of the Restore Database function in Library Maintenance.

Noticing that it might take weeks to transfer my library from my device to Calibre, I stopped that.

I went back to Calibre and created a new, empty folder with default structure.

I went to the folder that had my main Calibre Library in it and copied, using Windows Explorer, all sub-folders and files into the new, empty Calibre library folder. This included metadata.db and metadata_db_prefs_backup.json.

I then opened the new, empty Calibre Library in Calibre and selected Library Maintenance>Restore Database.

A dialog popped up that said something along the lines of don't interrupt and this will be done in 3 steps. Fairly rapidly the progress bar got to 27% and stopped. The little wheel kept spinning and the Calibre program showed as (not responding). I did not get excited about this since Windows sometimes reports Calibre not responding when in fact Calibre is just too busy to talk to Windows.

An hour or two later I had the same status at 27%, spinning wheel, and not responding.

Thinking it had failed due to me doing something wrong (like manually copying sub-folders into a Calibre Library Folder), I stopped Calibre using the Task Manager and resolutely prepared to endure the move of books from device to Calibre, no matter how long it took.

When I reopened Calibre I found that all the books and structure were there just like the library I had inadvertently removed from Calibre. For some reason Calibre had completed (as far as I can tell) the restoration and then did not tell Windows or me that it was done. Hmmmph.

Just thought I would share my experience although I sort of violated the rule of doing things within a Calibre Library folder without using Calibre. No complaints here.

Just glad there is so much flexibility in the program.

Comment from experts welcome.
gsparks2 is offline   Reply With Quote