You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When updating modules and core with Drush, the existing code is moved to a backup location before the new code replaces it. If there is an error, the old code can roll back over the new code, restoring the system. The pm-updatecode command accepts an option --no-backups that prevents these backups from taking place, which I find useful when using git to manage my projects. I don't need the extra disk space used up with code backups.
Issue:
Most projects have additional files at the docroot, such as Google or Bing authentication files. When updating core with backups ON, these files remain intact. With backups off ($options['no-backups'] = TRUE), these files are lost. Also any non-core profiles are deleted.
Expected Result:
Any non-core files and directories I have in the docroot or profiles/* remain intact after updating core, regardless of whether I am backing up the code or not.
Actual Result:
Non-core files are lost after updating when --no-backup is set.
Proposed Solutions:
Users Can Fix:
Don't turn backups off. This may increase processing time and bloat your drush-backups folder, but you won't lose files.
Change the backup directory to a tmp location so backups are cleaned out. $options['backup-dir'] = '/tmp/drush-backups';
Thanks for the clear writeup. I do think this issue is a dupe of both the issues you linked to. Fragmented discussion is not helpful so closing this.
I'll note that sites built with https://github.com/drupal-composer/drupal-project dont suffer from this problem, mainly because the dont use pm-updatecode. Thats how all D8+ sites should be built and even D7 sites should consider it.
Given available workarounds, I doubt this will ever get fixed.
Summary:
When updating modules and core with Drush, the existing code is moved to a backup location before the new code replaces it. If there is an error, the old code can roll back over the new code, restoring the system. The
pm-updatecode
command accepts an option--no-backups
that prevents these backups from taking place, which I find useful when using git to manage my projects. I don't need the extra disk space used up with code backups.Issue:
Most projects have additional files at the docroot, such as Google or Bing authentication files. When updating core with backups ON, these files remain intact. With backups off (
$options['no-backups'] = TRUE
), these files are lost. Also any non-core profiles are deleted.Expected Result:
Any non-core files and directories I have in the docroot or
profiles/*
remain intact after updating core, regardless of whether I am backing up the code or not.Actual Result:
Non-core files are lost after updating when
--no-backup
is set.Proposed Solutions:
Users Can Fix:
drush-backups
folder, but you won't lose files.$options['backup-dir'] = '/tmp/drush-backups';
Drush Fixes:
--no-backups
set, store backups to a tmp directory instead of ignoring them.From what I can find, the offending code appears to be here:
https://github.com/drush-ops/drush/blob/master/commands/pm/updatecode.pm.inc#L215:L221
The text was updated successfully, but these errors were encountered: