|
|
#1 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 91
Karma: 69734
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX, Kindle Fire 1G
|
[SOLVED] Is it safe for two copies of Calibre to access the same database?
Is it safe to have both the Calibre Content Server running on my file server and accessing the database while also running another copy of Calibre on my laptop to make changes? Does the content server open the database as read-only? If it is safe, does the content server handle changes to the database automatically or will I have to restart the content server for it to pick up any change? I.e., is the content server caching data? Also, is it okay if the content server is running an older version of Calibre? Are there database changes happening in recent releases? Last edited by Halo; 01-31-2013 at 01:04 PM. |
|
|
|
|
|
#2 |
|
Handy Elephant
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 471
Karma: 1177340
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Ubuntu Linux, Cybook Opus, Motorola Xoom with Mantano
|
No, it is not safe. Calibre is not multi user.
One way to handle it could be to make a backup copy of the library and treat that as a read only version of the library, to be used by the content server. I run a content server like that. I have configured a Virtual Box to automatically copy the latest backup of the Calibre library, using rsync, when starting. So I have three copies. One main copy that I add books to, and change. One backup. (Actually several backups.) And one copy of the latest backup used by the content server. This means that I can update and backup the main library at any time, and refresh the content server by restarting it. It is also very, very bad to switch between Windows and Linux. Linux use case sensitive filenames, but Windows don't. Chaos lurking there... Last edited by Adoby; 11-29-2012 at 06:35 PM. |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,597
Karma: 549131
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (stanza/iBooks/QuickReader)
|
It is safe to have the Content Server accessing the same database as the main Calibre progam as it never changes anything. It is NOT safe to have two copies of the main program accessing the database as they can trample on each others updates.
__________________
Calibre2opds: Calibre library as a web site - the popular alternative to the Calibre Content Server CLOUD SERVICES: Dropbox: Use this link to sign up for a free Dropbox account and both of us get an extra 500MB free space. Megacloud: Use this link to sign up for a free MegaCloud account and both of us get an extra 500MB free space. Copy.com: Use this link to sign up for a free Copy.com account and both of us get an extra 5GB free space. |
|
|
|
|
|
#4 | |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 91
Karma: 69734
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX, Kindle Fire 1G
|
Quote:
I'm okay there as I'm not switching between Windows and Linux. All of my Calibre work is done on Windows. Linux will only be used to run the content server. |
|
|
|
|
|
|
#5 |
|
Captain Penguin
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,234
Karma: 2070103675
Join Date: May 2009
Location: Vancouver, BC
Device: nook*, nexus 10
|
Indeed it is. My library is on Dropbox and I was accessing it from Windows and Linux machines. I got plenty of conflicts due to the case-insensitive nature of Windows, which resulted on ebooks disappearing, the covers disappearing, or both. I have stopped accessing it from Windows and now I rely only on Linux.
|
|
|
|
|
|
#6 |
|
Creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,519
Karma: 2944574
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The content server is not read only. If for example a calibre upgrade changes the database schema, the content server can cause the contents of metadata.db to change.
The CS can also cause metadata backups to run which alter the db and the file system. Finally, I plan on adding write features to the content server at some point.
__________________
Get calibre Notice to all: I can not provide assistance with DRM removal, for legal reasons, so please do not contact me about it. |
|
|
|
|
|
#7 |
|
eBook Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54,670
Karma: 26165759
Join Date: Nov 2006
Location: UK
Device: Kindle Touch, PW, Fire HD, iPad 3, iPhone 4, Samsung Tab 2 7 + More
|
It should be safe enough as long as you can absolutely guarantee that only one person will be accessing it at any one time - eg if you're the only user, and you're accessing it from two different locations. The problems occur if two or more people try to access it at the SAME time.
__________________
Harry Currently proofreading The Poison Belt, by Sir Arthur Conan Doyle. |
|
|
|
|
|
#8 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 91
Karma: 69734
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX, Kindle Fire 1G
|
Hi everyone,
I found a solution for this that's working well for me. I'm posting a follow-up so others can try this if they like. It's a bit technical, but if you are using Linux or Mac then this should work for you. So far, I am very happy with the results. I created a new user on my computer called 'calibre' and installed calibre into /home/calibre/calibre. Then I created a directory called 'library'. In this example my main calibre library is located at /srv/fileshare/Ebooks/Library. I will make a copy of my calibre library to /home/calibre/library which will be used by the calibre content server. First, make sure the directory for the content server library is empty. You can skip this step the first time you set up your library and content server. Be careful with this command! It removes all files in the directory including all sub-directories. This is one reason that I created a new user called 'calibre' just for the content server. Doing that restricts changes to the 'calibre' user and protects other files on my computer from accidental deletion including the original calibre library. Code:
rm /home/calibre/library/* -rf Code:
cp -as /srv/fileshare/Ebooks/Library/* /home/calibre/library/ Code:
rm /home/calibre/library/metadata.db rm /home/calibre/library/metadata_db_prefs_backup.json Code:
cp /srv/fileshare/Ebooks/Library/metadata.db /home/calibre/library/ cp /srv/fileshare/Ebooks/Library/metadata_db_prefs_backup.json /home/calibre/library/ Code:
/home/calibre/calibre/calibre-server --with-library /home/calibre/library/ --max-cover=200x266 --daemonize |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sync 2 copies of Calibre? | mark_e_h | Related Tools | 3 | 03-11-2012 09:30 PM |
| Two copies when fetching news in Calibre | wiltayx | Devices | 2 | 12-04-2011 08:16 AM |
| Calibre Database cp Kindle Database | mitch13 | Library Management | 1 | 05-22-2011 07:33 PM |
| iLiad Easy and safe SSH access to your iLiad | narve | iRex Developer's Corner | 15 | 11-30-2006 05:14 PM |