feat(cli): add database conversion command for SQLite migration - #1327
Open
krbrs wants to merge 14 commits into
Open
feat(cli): add database conversion command for SQLite migration#1327krbrs wants to merge 14 commits into
krbrs wants to merge 14 commits into
Conversation
krbrs
marked this pull request as draft
May 21, 2026 13:16
krbrs
marked this pull request as ready for review
May 21, 2026 13:42
krbrs
marked this pull request as draft
May 21, 2026 20:54
Run conversion mode before hosted services and web endpoints start, and wrap early startup in a temporary conversion Shoko home. This keeps Quartz, bootstrap, and other startup-time filesystem/database initialization from touching the user's real Shoko home during conversion. Source settings are copied before isolation, while the target SQLite file still uses the resolved conversion output path.
krbrs
marked this pull request as ready for review
May 22, 2026 08:26
But keep the override for the db fixture.
- switch the database migration fixture from --config to the supported --home override - remove bare convert-db detection and require --convert-db explicitly - update conversion parser tests to use --home instead of --config - keep parser coverage for false positives on option values
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
This PR should be merged after #1326.
This PR adds database conversion support for migrating supported Shoko databases into SQLite through the shared
SystemServicestartup lifecycle.Since SQLite now performs well even with large Shoko databases, users may want to migrate existing installations to SQLite, which is also the default database backend for Shoko.
The converter currently supports one-way migration into SQLite from:
Changes
Conversion mode
--convert-dbconversion mode toShoko.CLISystemServicestartup lifecycleShoko.CLIShoko.TrayServiceLateStart()during conversion modeSource and target handling
ServerSettings.Database--source-type--source-connection-string--target-fileSQLite target bootstrap
Versionstable, since migration metadata is backend-specificData migration
Verification
Safety and guardrails
--overwritebefore replacing an existing target SQLite fileResult
Shoko now has a practical migration path for users who want to move an existing SQL Server or MySQL/MariaDB installation to SQLite.
This is especially useful now that SQLite performs well enough for larger libraries while remaining the default Shoko backend.