Backup restore#714
Open
chengxicx wants to merge 2 commits into
Open
Conversation
added 2 commits
July 25, 2026 01:28
- Add restore_backup endpoint to upload and restore from backup files - Preserve system-specific settings (backup_dir, mecab_path) during restore - Add _add_missing_default_settings to ensure TTS and other settings exist - Add before_request hook to reset SQLAlchemy engine after restore - Handle missing backup directory gracefully (auto-create or return empty list) - Add try/except guards for settings loading after restore from older versions - Handle missing current_language_id after restore Allows users to restore from backup files uploaded via web UI, while preserving system-specific paths that should not be overwritten.
- Move imports to top level (sqlite3, tempfile, shutil, secure_filename) - Fix line-too-long issues - Prefix unused parameter with underscore - Add pylint disable for too-many-locals
chengxicx
force-pushed
the
feat/backup-restore
branch
from
July 24, 2026 17:29
83e8df9 to
71f24ad
Compare
Collaborator
|
Thanks for the PR @chengxicx . There was already a PR open for this at #666, what is different about this PR? Restoring backups is such a massive thing that I'm not sure how much I want to automate it :-) I don't know if there will be primary key issues with any things like audio files, images, etc. This may require a lot of work. |
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.
Adds a complete end-to-end backup and restore workflow:

One-click backup trigger available on the Settings page; archives include the database, configuration files, and book library data
Supports rolling back the system state from any historical backup snapshot
Preserves all user custom preferences (backup directory path, MeCab binary path, etc.) during restoration, preventing overwrites from outdated configs stored in backups
Implements SQLite connection pool reset logic to maintain valid database connections after swapping database files during restore