Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 08-07-2020, 06:15 AM   #1
MateoPeri
Junior Member
MateoPeri began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2020
Device: Kindle
Question How to merge two libraries from the command line?

I have calibre and calibre-server in my Synology NAS. Recently I found a huge library (~500 GB) and want to add it to my existing library. I can of course switch to that library but I'd lose my existing books.
I've seen many posts about merging libraries using the Calibre GUI, but I don't have that available.
What is the best approach? Should I add the books one by one? If so, how? Is there a 'bulk add' command?

Thanks in advance
MateoPeri is offline   Reply With Quote
Old 08-07-2020, 07:36 AM   #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: 45,295
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://manual.calibre-ebook.com/gen...calibredb.html
kovidgoyal is offline   Reply With Quote
Old 08-07-2020, 10:58 AM   #3
MateoPeri
Junior Member
MateoPeri began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2020
Device: Kindle
Sorry, I don't understand. Which is the command to merge two libraries?
MateoPeri is offline   Reply With Quote
Old 08-07-2020, 12:33 PM   #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: 45,295
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://manual.calibre-ebook.com/gen...bredb.html#add
kovidgoyal is offline   Reply With Quote
Old 08-07-2020, 01:09 PM   #5
MateoPeri
Junior Member
MateoPeri began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2020
Device: Kindle
So if I use:
calibre --with-library /path/to/main/library add /path/to/other/libary
will it add all the books in the other library to my main library?
MateoPeri is offline   Reply With Quote
Old 08-07-2020, 01:15 PM   #6
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: 45,295
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
And add --recursive and --one-book-per-directory
kovidgoyal is offline   Reply With Quote
Old 08-07-2020, 01:17 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 45,751
Karma: 168959600
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by MateoPeri View Post
So if I use:
calibre --with-library /path/to/main/library add /path/to/other/libary
will it add all the books in the other library to my main library?
You will likely need to add books from a directory and it's subdirectories (see the Adding From Directories at the end of the Add section in https://manual.calibre-ebook.com/gen...bredb.html#add ). I have not used that functionality but the --recurse or -r and --one-book-per-directory or -1 options should work (the one book item may not be needed if the second library only has a single format in each subdirectory).

Unless that 500GB library is a single directory which is somewhat unlikely, IMNSHO.

Edit: I don't want to think about the provenance of a 500GB ebook library.

Last edited by DNSB; 08-07-2020 at 01:19 PM. Reason: I don't want to think about the possible source and legality of a 500GB ebook collection
DNSB is online now   Reply With Quote
Old 08-07-2020, 01:57 PM   #8
MateoPeri
Junior Member
MateoPeri began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2020
Device: Kindle
The file structure is:
- Library
-- Author
---- Book Title
------ Book, Cover, metadata...

I'll try with the add from directory command. I'm not sure about the -1 command, but I'll give it a try.
MateoPeri is offline   Reply With Quote
Old 08-07-2020, 04:16 PM   #9
MateoPeri
Junior Member
MateoPeri began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2020
Device: Kindle
Exclamation

When I run this command in the calibre docker container I get this output (after like an hour or two).
The process has taken around 2.5GB or RAM, and has not finished yet (it actually crashed and I had to reattach).
Code:
root@linuxserver-calibre:/# calibredb --with-library /Calibre_Library add -r "/downloads/Bibliot
eca 75.452 (EPUB) (ESP)/Biblioteca"                                                             
                                                                                                
                                                                                                
Failed to render /tmp/calibre_4.20.0_tmp_EEgtWb/F4ULLA_epub_meta/OEBPS/Text/index_split_000.html
 with errors:                                                                                   
Traceback (most recent call last):                                                              
  File "site-packages/calibre/utils/ipc/simple_worker.py", line 54, in run                      
  File "site-packages/calibre/utils/ipc/__init__.py", line 23, in eintr_retry_call              
EOFError                                                                                        
                                                                                                
Failed to render /tmp/calibre_4.20.0_tmp_EEgtWb/ladgpT_epub_meta/OEBPS/Text/cubierta.xhtml with 
errors:                                                                                         
Traceback (most recent call last):                                                              
  File "site-packages/calibre/utils/ipc/simple_worker.py", line 54, in run                      
  File "site-packages/calibre/utils/ipc/__init__.py", line 23, in eintr_retry_call              
EOFError
MateoPeri is offline   Reply With Quote
Old 08-07-2020, 05:44 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,587
Karma: 145863177
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Where did this "found" 500GB library come from and are there books in there that are still in copyright?
JSWolf is offline   Reply With Quote
Old 08-07-2020, 06:10 PM   #11
MateoPeri
Junior Member
MateoPeri began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2020
Device: Kindle
Are you asking because you want them? I can PM them to you (not sure about the link posting rules in this forum), but the books are all in Spanish.

A lot of them are classical books (no copyright), but others are still in copyright. Why? Is it not allowed in this forum?
MateoPeri is offline   Reply With Quote
Old 08-07-2020, 08:59 PM   #12
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 45,751
Karma: 168959600
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by MateoPeri View Post
Are you asking because you want them? I can PM them to you (not sure about the link posting rules in this forum), but the books are all in Spanish.

A lot of them are classical books (no copyright), but others are still in copyright. Why? Is it not allowed in this forum?
Copyright violation is severely frowned upon. It's the sort of thing that attracts unwanted attention from lawyers. I'm not a moderator but I agree that copyright violation is not a good way to keep MobileRead open and accessible. One group I used years back was shut down due to a couple of members who kept posting links to copyright material and pusillanimous moderators who did not want to ban posters.

Do not post a link here to your library.

BTW, that is why I did not want to think about the provenance of your library.

One other issue is that quite a few of the books in your library are likely to be total garbage which you are going to spend more time and effort to clean up than the end result will be worth.
DNSB is online now   Reply With Quote
Old 08-07-2020, 09:05 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,587
Karma: 145863177
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DNSB View Post
One other issue is that quite a few of the books in your library are likely to be total garbage which you are going to spend more time and effort to clean up than the end result will be worth.
The solution is to save yourself 500GB and delete the entire library that's not fully legal.
JSWolf is offline   Reply With Quote
Old 08-08-2020, 12:31 AM   #14
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: 45,295
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That output is because your docker container is preventing qqtwebengine from running which is used to render the first page of epub files as their covers when they dont have a cover.
kovidgoyal is offline   Reply With Quote
Old 08-08-2020, 05:06 AM   #15
MateoPeri
Junior Member
MateoPeri began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2020
Device: Kindle
Thumbs up

Quote:
Originally Posted by kovidgoyal View Post
That output is because your docker container is preventing qqtwebengine from running which is used to render the first page of epub files as their covers when they dont have a cover.
Thanks you for answering.
Why would that be? A permissions issue maybe? The docker image I'm using is linuxserver/calibre (latest).
I'll try running it as root.

But that's not that big of an issue, is it? Does it prevent the book from being imported?
MateoPeri is offline   Reply With Quote
Reply

Tags
bulk import, library, merge


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to execute a non-root command without access to command line Galunid Kindle Developer's Corner 4 05-15-2018 07:50 PM
to merge an advanced search and a shortcut into one command reinsley Library Management 0 12-02-2016 09:54 AM
How to merge libraries BAD18 Library Management 11 03-21-2015 11:19 PM
Command line transfer between libraries? bibby Library Management 2 02-13-2014 03:16 AM
Copy/Move books between libraries using command line tools jameszh Library Management 3 02-15-2011 09:02 AM


All times are GMT -4. The time now is 10:59 PM.


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