-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(web): exposed a job to manually trigger database backup procedures #16622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I’m not sure I love the fact that it kicks out the old backups right away, tbh. It would be better to have some kind of rudimentary keep last X days IMO |
|
I was thinking the same thing |
danieldietzler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also agree with the others in that it'd make more sense in the "create job" modal
|
Hi @danieldietzler, I've moved it to the Do you have any other suggestions? |
…es (immich-app#16622) * feat(web): exposed a new job to create a manual database backup * chore(server): added a new test case * chore(server): moved job to backup db into the create job popup * remove irrelevant change * openapi * chore: formatting * docs: trigger backup documentation --------- Co-authored-by: Lorenzo Montanari <[email protected]> Co-authored-by: Alex Tran <[email protected]> Co-authored-by: Zack Pollard <[email protected]>


Description
This is a small PR that exposes already present database backup machinery in a way that allow users to manually trigger a database backup, without the needing to wait for the automatic cron job to run.
This is particularly handy if your Immich instance does not run at all times (e.g. on a server/NAS) because, for example, you run it on your main computer and you start it "on demand", meaning you start Immich only when you actually need it, and stop it when your done with it.
The resulting
.sql.gzfile created in the backup folder will count as a database copy.Hence, if in the system settings page you set that you only want 3 backups, manually clicking this new button four times, will result in four different backups being produced, but only the latest 3 will be kept, just like with database backups produced by the execution of the scheduled cron job to handle database backups.
I'm also attaching a screenshot of the modified Job Status page.
How Has This Been Tested?
Testing manual backups is straightforward, as you just need to click the
Startbutton in the new section in Job Status page.Testing manual backups and automated one is a bit more convoluted. These are the steps i followed:
StartbuttonScreenshots (if appropriate)
As you can, a new section for a new job is being rendered. When the
Startbutton is clicked, a new database backup will occur.API Changes
The only notable change is that
/api/jobscan now be invoked with a new manual job, that isbackup-database.Checklist:
src/servicesuses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services)