From 9aeb3040ebeca6d22e4ec2f0adeff104a1916159 Mon Sep 17 00:00:00 2001 From: Simon R Jones Date: Thu, 2 Oct 2025 19:52:28 +0100 Subject: [PATCH 1/2] Remove auto Craft DB restore on failed deployment due to unreliability --- recipe/craftcms.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/recipe/craftcms.php b/recipe/craftcms.php index 7f2486c..eccb2ed 100644 --- a/recipe/craftcms.php +++ b/recipe/craftcms.php @@ -34,11 +34,9 @@ craft('db/backup', ['showOutput' => true]); }); -desc('Restore DB after deployment failure'); -task('craft:restore-db', function () { - $latest = run("ls -t storage/backups/ | head -n1"); - writeln(sprintf('Restoring Craft DB from storage/backups/%s', $latest)); - craft(sprintf('db/restore storage/backups/%s', $latest), ['showOutput' => true]); +desc('Output warning after deployment failure'); +task('craft:fail-warning', function () { + warning('The Craft deployment failed, please review DB backups (storage/backups) to assess whether you need to restore the database.'); }); // @deprecated Not sure if this is still required @@ -62,4 +60,4 @@ 'deploy:publish', ]); -after('deploy:failed', 'craft:restore-db'); +after('deploy:failed', 'craft:fail-warning'); From 8d1b1a642a45fe8445ee333fbc88d032dbfcdf80 Mon Sep 17 00:00:00 2001 From: Alan Isaacson <38862429+AlanJIsaacson@users.noreply.github.com> Date: Mon, 6 Oct 2025 15:13:28 +0100 Subject: [PATCH 2/2] Remove Craft DB backup as it wasn't working --- recipe/craftcms.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/recipe/craftcms.php b/recipe/craftcms.php index eccb2ed..56b14f0 100644 --- a/recipe/craftcms.php +++ b/recipe/craftcms.php @@ -28,12 +28,6 @@ ]); // Custom Craft Tasks -desc('Backup DB prior to deployment'); -task('craft:backup-db', function () { - writeln('Backing up Craft DB to storage/backups'); - craft('db/backup', ['showOutput' => true]); -}); - desc('Output warning after deployment failure'); task('craft:fail-warning', function () { warning('The Craft deployment failed, please review DB backups (storage/backups) to assess whether you need to restore the database.'); @@ -54,7 +48,6 @@ task('deploy', [ 'deploy:prepare', 'deploy:vendors', - 'craft:backup-db', 'craft:up', 'craft:clear-caches/all', 'deploy:publish',