Drush site-upgrade and re-running upgrades over existing code
Drush's site-upgrade command asks whether to replace or re-use an existing target site.
Drupal site already exists at /home/ben/code/anjali7/web. Would you like to:
[0] : Cancel
[1] : Delete the existing site and start over.
[2] : Re-use the existing code, re-import the database from the source site
and run updatedb again.
This can be avoided by running the command with the --reuse
flag.
When site-upgrade runs the contributed modules upgrade, it will use the downloaded versions too, but it will spend time checking the status of each project and – self-defeating for our purposes of automation – asking if you want to replace the module or use what is there. It is possible that drush site-upgrade @target.site
will be made smarter about re-using a code base of contributed modules, but my attempt to refactor it found it much easier to create a separate script for the time being. It is available at drupal.org/sandbox/mlncn/1154002 and can be downloaded via git with git clone --branch master http://git.drupal.org/sandbox/mlncn/1154002.git drushreupgrade
.
Note: This script was written while working on the upgrade appendix of The Definitive Guide to Drupal 7 and a better approach with Drush core commands is outlined there!
Comments
Post new comment