📚 Preparation#
Since Komga cannot recognize MOBI format ebooks, these files need to be batch converted to EPUB format for reading in Komga.
📥 Download and Install calibre#
The conversion can be done using calibre, so you need to download and install calibre first. You can download the installer for your operating system from the official website at https://calibre-ebook.com/download.
⚙️ Configure ebook-convert#
After installing calibre, you need to configure the correct path for ebook-convert.exe
in order to perform the conversion. Please set it according to your installation path.
🔄 Batch Convert MOBI to EPUB#
Using the provided script, you can easily convert all MOBI files in a directory to EPUB format. Follow these steps:
@echo off
setlocal EnableDelayedExpansion
for /r %%i in (*.mobi) do (
set "filename=%%~ni"
set "extension=%%~xi"
set "directory=%%~pi"
set "output=!directory!!filename!.epub"
<ebook-convert.exe path> "%%i" "!output!"
)
set /p confirm=Are you sure you want to delete all .mobi files in this directory and its subdirectories? (y/n)
if /i "!confirm!"=="y" (
for /r %%i in (*.mobi) do (
echo Deleting "%%i"...
del "%%i"
)
echo All done!
) else (
echo Operation cancelled.
)
echo All done!
pause
- Paste the provided script into a text editor and replace
<ebook-convert.exe path>
with your actual path. - Save the script as a batch file (
.bat
), for example,convert.bat
. - Place the
convert.bat
file in the directory that contains the MOBI files you want to convert. - Double-click
convert.bat
to run it, and the script will automatically convert all MOBI files to their corresponding EPUB files.
❗️ Delete Original MOBI Files (Optional)#
If you want to delete the original MOBI files after the conversion is complete, you can follow these steps:
- After the conversion, the script will ask if you want to delete all MOBI files. Enter
y
orn
as prompted. - If you enter
y
, the script will delete all MOBI files in the directory and its subdirectories. - If you enter
n
, the script will not delete the MOBI files.
Please note that the deletion operation cannot be undone, so proceed with caution.
🎉 Completion#
After completing the above steps, your MOBI files will be successfully converted to EPUB format and can be enjoyed in Komga!