|  07-03-2012, 02:00 PM | #1 | 
| hopeless n00b            Posts: 5,126 Karma: 19597086 Join Date: Jan 2009 Location: in the middle of nowhere Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9 | 
				
				speed up metadata backup
			 
			
			Is there a way to speed up metadata backup? I'm in the process of backing up my library so I selected the "Start backing up metadata of all books" to update the opf files but it's taking forever to finish (1 book every 3 sec per the dialog). I know the opf files it creates are just failsafes in case metadata.db gets corrupted nevertheless, I'd like to have those updated before I backup my Calibre library. Thanks!
		 | 
|   |   | 
|  07-03-2012, 03:56 PM | #2 | 
| Wizard            Posts: 4,553 Karma: 950151 Join Date: Nov 2008 Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader) | 
			
			OPF files are normally updated any time you press the OK button on the Edit Metadata dialogs, so you should not normally need to run the option to get them backed up.     That is intended primarily for use on old libraries that pre-date the existence of the OPF files in a Calibre library, and IS deliberately designed to run at a limited pace so that the function could be run as a background job without severely affecting performance of Calibre in the foreground. | 
|   |   | 
| Advert | |
|  | 
|  07-03-2012, 06:02 PM | #3 | 
| hopeless n00b            Posts: 5,126 Karma: 19597086 Join Date: Jan 2009 Location: in the middle of nowhere Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9 | 
			
			I changed some templates around in the custom columns and those haven't been propagated to the OPF backups. I know that generating the OPF is usually done in the background and is designed to use as little system resource as possible but in my case (multiple libraries with 500-15,000 ebooks each), I would prefer to have the option to run it in the foreground (or have a CLI utility that can do it) and practically lock up my system in exchange for finishing the task much faster.
		 | 
|   |   | 
|  07-04-2012, 12:10 AM | #4 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | 
			
			calibre-debug -c "from calibre.library import db; db = db('/path/to/library'); db.dump_metadata(db.all_ids())"
		 | 
|   |   | 
|  07-04-2012, 12:48 PM | #5 | 
| hopeless n00b            Posts: 5,126 Karma: 19597086 Join Date: Jan 2009 Location: in the middle of nowhere Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9 | |
|   |   | 
| Advert | |
|  | 
|  07-04-2012, 04:49 PM | #6 | 
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | 
			
			It is worth noting that as of the latest release (or thereabouts), composite custom column templates are saved in the metadata_db_prefs_backup.json file every time you exit the calibre gui. This file is used by restore to rebuild the custom columns, as well as to restore a lot of other things like saved searches, user categories, plugboards, grouped search terms, custom template functions, and several library-level preferences.  The custom column descriptions in the metadata.opf files are used only if the metadata_db_prefs_backup.json is missing or corrupted. | 
|   |   | 
|  08-29-2013, 03:53 PM | #7 | |
| Deviser            Posts: 2,265 Karma: 2090983 Join Date: Aug 2013 Location: Texas Device: none | 
				
				Calibre-debug: can't downgrade SHLock object (Error Code: 1)
			 Quote: 
 C:\Program Files\Calibre2>calibre-debug.exe -c "from calibre.library import db; db = db('C:\Users\Public\Public eBooks\Calibre2'); db.dump_metadata(db.all_ids() )" Python function terminated unexpectedly can't downgrade SHLock object (Error Code: 1) Traceback (most recent call last): File "site.py", line 132, in main File "site.py", line 109, in run_entry_point File "site-packages\calibre\debug.py", line 231, in main File "<string>", line 1, in <module> File "site-packages\calibre\db\legacy.py", line 348, in dump_metadata File "site-packages\calibre\db\cache.py", line 55, in ans File "site-packages\calibre\db\cache.py", line 1012, in dump_metadata File "site-packages\calibre\db\legacy.py", line 146, in all_ids File "site-packages\calibre\db\cache.py", line 54, in ans File "site-packages\calibre\db\locking.py", line 212, in __enter__ File "site-packages\calibre\db\locking.py", line 83, in acquire File "site-packages\calibre\db\locking.py", line 153, in _acquire_shared calibre.db.locking.LockingError: can't downgrade SHLock object | |
|   |   | 
|  08-29-2013, 10:27 PM | #8 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | 
			
			For version 1.0 and newer, use this code instead: calibre-debug -c "from calibre.library import db; db = db('/home/kovid/test library'); db.dump_metadata(tuple(db.all_ids()))" | 
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Custom metadata in archived/backup books? | PatNY | Library Management | 14 | 03-29-2012 06:50 PM | 
| metadata backup | silverraven | Calibre | 3 | 03-06-2012 07:56 PM | 
| Metadata Backup? | Mountainjack | Calibre | 2 | 07-17-2011 04:42 PM | 
| How to speed up "Downloading Metadata/Covers"? | butterbescotch | Calibre | 4 | 05-04-2011 09:58 PM | 
| [Metadata Download Plugin] Goodreads Metadata **Deprecated** | kiwidude | Plugins | 30 | 04-23-2011 02:10 PM |