Answers.Body: <p>Old question but still unanswered, so here is my € 0,02:</p>
  <p>Use calibredb add_format [options] id ebook_file</p>
  <blockquote>
  <p>Blockquote
  Add the e-book in ebook_file to the available formats for the logical book identified by id. You can get id by using the search command. If the format already exists, it is replaced, unless the do not replace option is specified.</p>
  </blockquote>
  <p>source: <a href="https://manual.calibre-ebook.com/generated/en/calibredb.html#add-format" rel="nofollow noreferrer">https://manual.calibre-ebook.com/generated/en/calibredb.html#add-format</a></p>
  <p>So it should be as easy as
  calibredb add format epub $ID $epubfile</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-14T08:57:59.907Z
Answers.LastActivityDate: 2021-12-14T08:57:59.907Z
Answers.UserDisplayName: G.H. Snijders
Body: <p>There are some books with <code>mobi</code> and <code>azw3</code> formats on my calibre library which I want to convert them to <code>epub</code> and I prefer to do it from command line. </p>
  
  <p>I'm able to convert books using <code>ebook-convert</code> but I don't know how to add <code>epub</code> book to calibre.  </p>
  
  <p><code>calibredb add</code> doesn't work since it considers the <code>epub</code> as duplicate which is true. But I want to see if there is a way to add the book as a new format to calibre library before messing with calibre <code>sqlite</code> db.</p>
  
  <p>I have:</p>
  
  <ul>
  <li>book id</li>
  <li>epub path</li>
  </ul>
  
  <p>I want:<br>
  - to add the epub to an existing entry</p>
  
Tags: <epub><calibre>
Title: Add new format of a book to calibre from command line
UserDisplayName: pouya
ThreadText: # Add new format of a book to calibre from command line
  
  (Asked by: username_0 on 2020-04-11)
  
  There are some books with `mobi` and `azw3` formats on my calibre library which I want to convert them to `epub` and I prefer to do it from command line.
  
  I'm able to convert books using `ebook-convert` but I don't know how to add `epub` book to calibre.
  
  `calibredb add` doesn't work since it considers the `epub` as duplicate which is true. But I want to see if there is a way to add the book as a new format to calibre library before messing with calibre `sqlite` db.
  
  I have:
  
  * book id
  * epub path
  
  I want:  
  - to add the epub to an existing entry
  
  **Tags:** epub, calibre
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-12-14. Score: 2
  
  Old question but still unanswered, so here is my € 0,02:
  
  Use calibredb add\_format [options] id ebook\_file
  
  > Blockquote
  > Add the e-book in ebook\_file to the available formats for the logical book identified by id. You can get id by using the search command. If the format already exists, it is replaced, unless the do not replace option is specified.
  
  source: <https://manual.calibre-ebook.com/generated/en/calibredb.html#add-format>
  
  So it should be as easy as
  calibredb add format epub $ID $epubfile
  
  
  ---
  
  