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 08-21-2012, 03:34 PM   #1
laird
Junior Member
laird began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Aug 2012
Device: nook simple touch
Rsync failure, Database repair, missing books

I use an rsync job to keep my laptop and home machine in sync. I think I probably had a network failure while syncing and now I see that my calibre library is missing some books.

I performed a database restore and had lots of warnings like this:

Quote:
/Users/laird/Calibre_Library/Charles Stross/Down on the Farm (Laundry Files) (4138) with error:
Traceback (most recent call last):
File "site-packages/calibre/library/restore.py", line 245, in restore_books
File "site-packages/calibre/library/restore.py", line 259, in restore_book
File "site-packages/calibre/library/database2.py", line 3332, in create_book_entry
File "site-packages/calibre/library/sqlite.py", line 313, in run
IntegrityError: PRIMARY KEY must be unique
Any suggestions on how to fix this?

Thanks,

Alan
laird is offline   Reply With Quote
Old 08-21-2012, 11:49 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,377
Karma: 23764838
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You've got a mixture of different books with the same db id in your library folder. There's no way to restore them automatically,. You will have to move them from the library folder and re-add them by hand. You can use the recursive adding options to add them in bulk.
kovidgoyal is offline   Reply With Quote
Advert
Old 08-24-2012, 04:42 AM   #3
laird
Junior Member
laird began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Aug 2012
Device: nook simple touch
This is an interesting problem. It seems like it would be pretty messy if I copied the Calibre_Library folder and imported it again. Hopefully we would not import the duplicates but since the import no longer has the metadata, I'm expecting lots of duplicates with poor matching.

What would happen on a database restore if I had first edited all the metadata.opf files to have unique values here:
<dc:identifier opf:scheme="calibre" id="calibre_id">2663</dc:identifier>

Is this the only place in the metadata where a database id would collide?

Thanks,

Alan
laird is offline   Reply With Quote
Old 08-24-2012, 04:47 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,377
Karma: 23764838
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The import will read the metadata from the opf files. You can of course edit the ids by hand and then run a restore, but that's much more work.
kovidgoyal 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
Database Failure RichardGH Library Management 9 07-25-2012 05:59 AM
Serious firmware or database failure in Kobo Wireless - help! tigeraid Kobo Reader 5 09-27-2011 10:13 PM
Database repair? or what? emphasis Calibre 30 11-02-2010 03:00 AM
Repair Database metadata.db icq70610 Calibre 1 09-21-2010 02:35 AM
rsync thetechnobear iRex 1 03-05-2008 01:57 PM


All times are GMT -4. The time now is 06:13 AM.


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