Jun 11

Command-line Drupal-core update with drush

Fri, 06/11/2010 - 14:13 — peter

This article is over 2 years old and drush no longer works as it did before, so the technique described here may be harmful to your setup. However, the ability to update Drupal core is now part of drush, so just grab a recent version of it to update Drupal core for your setup.

This is just a quick note on how one can use drush to update a Drupal core from the command-line.

Say your site is at /var/www/mysite.example.com, that it is running Drupal 6.16, that Drupal 6.17 was recently released and that you have drush somewhere on your search path. The simplest way I've found to update it is this:

cd /var/www 
ln -s mysite.example.com drupal-6.17  
drush dl 
rm -f drupal-6.17  
cd mysite.example.com  
drush updb

Done! Obviously I do this on my development site first, make sure nothing got broken, update the code on svn/git/whathave-you and then just update the working copy running on the production server, but still, this can be used straight on production for the svn-less of you out there...

Easy Peasy!


P.S.: Know a better way? Please leave it in the comments!