Hi,
how exactly is Drush handling the updating of modules when doing an drush update? What I can see is that Drush at some point creates backups of the updated modules; those backups are located in the site's root folder, e.g. ./backup/modules/20090629213741. But when and how exactly is Drush doing this?
The background of my question is that Merlinofchaos recommends as a general rule of thumb to always completely erase the contents of a module folder before putting the new tarball into it. I ran into an issue with this by upgrading the "Panels" module from v2 to v3 where the upgrade left files from the previous version living in the module's directory; I think I upgraded through Drush, but I wouldn't bet my hand on it anymore (at least du -h | grep panels doesn't show any backups, so probably I've done this upgrade manually).
However, I just want to make sure that Drush follows this "rule of thumb" and moves the module's directories to the backup location before installing the downloaded (new) version of the module; if it does not work this way, I'd like to change this to an feature request. A quick confirmation would be nice.
Thanks & greetings, -asb
Comments
Comment #1
moshe weitzman commenteddrush moves aside all files as you describe unless it notices that you use SVN to manage your files. if you do, then you are in charge of making the right changes in your SVN commit. it won't move aside in this case since you would lose your .svn folders and any local changes.
Comment #2
greg.1.anderson commentedComment #3
asb commentedJust for the record: The Drush version I'm currently using (All-versions-3.0-beta1) does not behave consistent, at least not as I would expect. Besides SVN managed folders, there's at least one other exception from the rule described in #1:
drush dl. Since Drush can not update theme files, I usually do andrush dl {theme}, and these files are not backed up (I haven't yet figured out what Drush exactly does, so I usually do a manual backup of the theme files and then arm -r sites/all/themes/{theme}). The lack of backups occurs also when there are patch files in the module's folder; after doing adrush dl {module}to force a module upgrade, the patch file is still there, so the old version isn't cleanly moved to the backup location.Greetings, -asb
Comment #4
timidri commentedRegarding #1: I feel this could be a feature request: let Drush handle the updates correctly even under SVN control. It is not easy to do this manually after the fact and besides, leaving old files behind may break the module (I have experienced this effect at least once).