Drush, streamlining Drupal maintenance

posted by Ishmael Sanchez on May 22, 2010

I have written about upgrading Drupal modules, but at that time I was working on only a handful of Drupal sites. Now, I'm working on quite a few Drupal sites. So manually upgrading modules was becoming a bigger pain and I needed a way to automate the upgrade process. Thankfully, the Drush module (Drush = DRUpal SHell) was created to solve that very problem. I had seen demos and screencasts of Drush but never took the time to install and configure it on my site. That all changed today.

So first, what is Drush? Drush is a command line shell that allows you to interact with your Drupal site. Now the phrase, 'command line' might be scary to some, but the commands are very simple (ex. drush cron). Using Drush you can download, enable, disable, uninstall, update: modules, themes, profiles, and translations. Drush also allows you to perform things like: running cron, clearing your cache, and running SQL commands.

To install Drush you will need command line access, check with your hosting company if you are unsure about this. If you are on a Windows machine you can use a SSH client like PuTTY to connect once you verify that you have command line access. Next, make a folder mkdir foldername and download and extract the module (Use the wget and tar commands), verify that the drush* file is executable. Create an alias to the executable (make sure you know the path to it, pwd).

Run the command drush status. If everything worked you should get output stating your PHP and Drush configuration. Just to give you an idea of how much time Drush can save you, I updated about 20 modules in less than 2 minutes.

***Update: The latest version of Drush will update Drupal core as well!

Resources

Post new comment

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

More information about formatting options

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

Ishmael Sanchez