Sunday, 22 November 2015

How to upgrade drupal using drush command line tool?

Drupal can be upgraded using nice command line tool called "drush" (drupal shell). If you are using Ubuntu, you can install it by the following command :

$ apt-get install drush

Now change the site to maintenance mode using below command :

$ drush vset --exact maintenance_mode 1

Now clear the cache using the below command :

$ drush cache-clear all

To update the drupal core, use the below command :

$ drush up drupal

If you are getting below error use, the following command :

Command pm-update needs the following modules installed/enabled to run: update.

$ drush en update

Now run the update command again,

$ drush up drupal

If every thing went well, use the below command to revert the maintenance mode and remove cache:

$ drush vset --exact maintenance_mode 0

$ drush cache-clear all

No comments:

Post a Comment