User login

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

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.