feat: add ServiceDatabase restore/import support
Summary
Add support for restoring/importing backups in ServiceDatabase (Docker Compose databases).
Changes
- Add
ServiceDatabasecase inbuildRestoreCommand()method - Handle ServiceDatabase container naming in
getContainers()(usesname-service.uuidformat) - Support PostgreSQL, MySQL, MariaDB, MongoDB detection via
databaseType() - Mark unsupported ServiceDatabase types (Redis, KeyDB, Dragonfly, Clickhouse)
- Update
updatedDumpAll()to handle ServiceDatabase dump-all mode
Technical Details
The implementation uses the existing ServiceDatabase::databaseType() method to detect the database type and build the appropriate restore command, following the same pattern as standalone databases.
Testing
- [ ] Test with PostgreSQL ServiceDatabase
- [ ] Test with MySQL ServiceDatabase
- [ ] Test with MariaDB ServiceDatabase
- [ ] Test with MongoDB ServiceDatabase
Related Issue
/claim #7529
Demo Video
(Will be added after testing)
The target branch has to be next not v4.x
Application composes don't have the UI to support imports and backups at the moment. So just enabling the functionality in the backend won't be enough. The user needs the necessary UI to configure them as well.
Thanks for the feedback! I've added the Import Backup UI to the ServiceDatabase configuration page for supported database types (PostgreSQL, MySQL, MariaDB, MongoDB).
The import functionality uses the existing Import Livewire component. Full backup system (scheduled backups, backup execution views) would require more work - let me know if that's needed for this PR or should be a separate issue.