Jun 11

Command-line Drupal-core update with drush

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

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!

-PCP

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

 

Comments

batti says:

Some may choose not to reveal their ethnic identity for whatever reason while others may not want to disclose their gender. Yet others may believe that anonymity may help them obtain a slightly brighter shade of customer service.
Melissa and Doug Easel

batti says:

The colors and the themes will more often than not be very helpful in making a good business identity for your club business. Regular clients will most of the time associate the color scheme to your club business.
Social Media Franchise

batti says:

There seems to be a lot of news coverage right now on all can't absence. Most of this seems to relate to reconsidering benefits packages, states and union contracts, and the overall belt-tightening that continues. It is really very good information!
thesis writing service

graceman9 says:

Be careful!
after this code

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

my drush say to me "drush_pm_download error" and my project deleted.. arghh...

schedal says:

Hello, tried this several times, all it does is break your entire website, I have never gotten this to work and I would advise EXTREME caution:

Here were my results:

#ln -s mywebsite.com drupal-6.20
#drush dl drupal-6.20
 
Install location /webdev/drupal-6.20 already exists. Do you want to overwrite it? (y/n): y
 
unlink(/webdev/drupal-6.20/sites/default/default.settings.php): Permission denied    [warning]
 
drush.inc:1428
Destination directory /webdev/drupal-6.20 already exists.                            [error]
 
Unable to move !/tmp/drush_tmp_1296061621/drupal-6.20 to !/webdev/drupal-6.20.       [error]
 
Project drupal (6.20) could not be downloaded to /webdev/drupal-6.20.

Website dead... recover from backup.

schedal says:

Instead, just go to your website and type

#drush up drupal

This will update only core to the latest version, simple, easy, and it works.