Drush
Command Line Drupal
Andrew Riley
February, 2010
What is Drush?
Drupal Shell


Yes, it allows you to manipulate Drupal
without ever having to go into Drupal.


Shh, it works in windows too.
Who should use it?
Developers
Module Developers
Theme Developers
Site Developers
People who don’t call themselves developers*
Ongoing
Deployment
Developers
Content Managers
Don’t need Drush
They can use normal Drupal
They will be envious
Why use it?
1
    Speed
    Normal: 5 Steps
    Drush: 2 Steps

    200 Steps?
2
    Consistancy
    Things are better
    when humans aren’t
    involved.
Should you add modules in :
   /sites/all/modules (Possible)
/sites/default/modules (Possible)
       /modules (HECK NO)
3   It’s scriptable
#!/usr/bin/sh
rm ~/update_backup.sql.gz
drush sql dump | gzip > ~/
update_backup.sql.gz
drush update
drush cc
How to use it
Installing is easy -
follow the directions
Increase your memory_limit
         in php.ini
HELP ME!!!!
drush help
Downloading
drush download {modulename}

or

drush dl {modulename}

Example: drush download webform
Clear Cache
drush cache clear

or

drush cc
Run Cron
drush cron
Updating Drupal
drush update

Updates your code base and runs the
database update.
Backup your DB
drush sql dump

or

drush sql dump | gzip > ~/update_backup.sql.gz
Restore your DB
drush sql load
Variable Set/Get
drush variable get {name}

drush variable set {name} {value}
Extending Drush
Modules can expand it (xmlsitemap2,
sitedir_migrate, backup_migrate)

There are modules that only work with
Drush (Drush Make, etc)
Questions?
Andrew Riley

@andrewmriley

Associate Director of Software Development

Mindcomet

Drupalcamp 2010 Drush Presntation