SMIT.
I would like to propose a new feature that enables running a MySQL backup job as part of the deployment process. This could be implemented similarly to the existing {RUN_SCRIPT [1,2]}
functionality, but with a backup ID.
example:
git pull origin {BRANCH}
npm install
# Run a MySQL backup here and continue when done.
{BACKUP_JOB [12]}
####
npm run create-snapshot
npx directus database migrate:latest
By integrating a MySQL backup job into the deployment script, users can ensure that their database is backed up before proceeding with any migrations or updates. This provides an additional layer of safety and can help prevent data loss during the deployment process.
Sebastiaan
Yes this is exactly what I need!
Dennis
@Sebastiaan Didn't you want this as well?
Sebastiaan
@Dennis yes indeed. This is a really pain in my ass right now. Would love to automatically backup db before continuing (especially php artisan migrate
) the deployment script. I have to disable the quick deploy and remember to backup the db manually in ploi before manually clicking the deploy button (I may seem lazy but what I mean is that human errors are possible xD)
Johan Strömqvist
I actually use Spatie a lot for Laravel apps (https://spatie.be/docs/laravel-backup/v8/introduction) so I just add php artisan backup:run
to the deployment process. Works great.
But getting it build-in.... <3
Dennis
Merged Trigger a backup when syncing from staging to production into this item
Created by: Bow House
It would be great if there was a way to automatically trigger a database and file backup of a site when the "Deploy to production" button is clicked on sites that are linked to a staging environment. This would mean that if anything went wrong in the deployment (a bad database migration for example) the site could be restored to its previous state without too much hassle.
As it stands, it's not currently possible to do this with a command in the deploy script because the deploy script runs after they have already been synced. One way to fix this would be to have a pre deploy script added to the production site, but having it inbuilt into the UI would be great!
I think the easiest way to manage it in the UI would be to have some extra settings in the Production tab of the staging site near the "Ignored folders & files" section, with the ability to enable database and file backups and ideally some sort of retention policy so you don't have to remember to remove old ones.
Dennis
Merged Backup database during deployment into this item \n\n Created by: Johan Strömqvist \n\n It would be cool with a build-in database backup snapshop one-linear for the deployment scripts. Like backup database-name
and then I guess some folder structure for rotating them etc. So one could snapshot on deployment (now I'm using my own stuff, but a build-in way would be pretty handy)
Integrate MySQL Backup Job into Deployment Script
-
Dennis moved item to board Planned
2 years ago -
Dennis moved item to board Under review
2 years ago -
SMIT. moved item to project Site Level Requests
2 years ago -
SMIT. created the item
2 years ago