Add backup restore feature

- Add restoreBackup() method to UpdateExecutor with full restore workflow
- Add getBackupDetails() to retrieve backup metadata and contents info
- Add restore controller routes (backup details API, restore action)
- Add restore button to backups table in UI
- Create backup_restore_controller.js Stimulus controller for confirmation
- Add translation strings for restore feature

The restore process:
1. Acquires lock and enables maintenance mode
2. Extracts backup to temp directory
3. Restores database (MySQL/PostgreSQL SQL or SQLite file)
4. Optionally restores config files and attachments
5. Clears and warms cache
6. Disables maintenance mode

Fix backup restore database import

The restore feature was using a non-existent doctrine:database:import
command. Now properly uses mysql/psql commands directly to import
database dumps.

Changes:
- Add EntityManagerInterface dependency to UpdateExecutor
- Use mysql command with shell input redirection for MySQL restore
- Use psql -f command for PostgreSQL restore
- Properly handle database connection parameters
- Add error handling for failed imports
This commit is contained in:
Sebastian Almberg 2026-01-30 22:51:25 +01:00
parent 0bfbbc961d
commit 1637fd63f4
5 changed files with 499 additions and 2 deletions

View file

@ -14994,5 +14994,29 @@ Buerklin-API Authentication server:
<target>WARNING: This version does not include the Update Manager. After downgrading, you will need to update manually using the command line (git checkout, composer install, etc.).</target>
</segment>
</unit>
<unit id="um_restore_backup" name="update_manager.restore_backup">
<segment state="translated">
<source>update_manager.restore_backup</source>
<target>Restore backup</target>
</segment>
</unit>
<unit id="um_restore_confirm_title" name="update_manager.restore_confirm_title">
<segment state="translated">
<source>update_manager.restore_confirm_title</source>
<target>Restore from Backup</target>
</segment>
</unit>
<unit id="um_restore_confirm_message" name="update_manager.restore_confirm_message">
<segment state="translated">
<source>update_manager.restore_confirm_message</source>
<target>Are you sure you want to restore your database from this backup?</target>
</segment>
</unit>
<unit id="um_restore_confirm_warning" name="update_manager.restore_confirm_warning">
<segment state="translated">
<source>update_manager.restore_confirm_warning</source>
<target>WARNING: This will overwrite your current database with the backup data. This action cannot be undone! Make sure you have a current backup before proceeding.</target>
</segment>
</unit>
</file>
</xliff>