3. • Different options in official site
• Recommended option:
– Install composer globally
– $ composer global require drush/drush:7.*
• Test drush installation:
– $ drush –-version
• or
– $ drush status
4. • Update:
– $ drush self-update
• or
– $ pear upgrade drush/drush
• Drush can be run in your shell by typing "drush" from
within any Drupal root directory.
• $ drush [options] <command> [arg1] [arg2]
• $ drush help (list of available options)
6. • A lot of useful commands but here you can find some of them:
– Clear cache (all caches):
• $ drush clear-cache all (alias: $ drush cc all)
– Update DB (after installation or update)
• $ drush updatedb (updb)
– List modules and themes available for your site:
• $ drush pm-list (pml)
• It can be combined with grep or use parameters
• $ drush pml | grep modulename
– See the value of a particular variable:
• $ drush variable_get (vget) variable_name
7. – See watchdog results:
• $ drush watchdog-show (ws)
– Download and enable modules:
• $ drush pm-download (dl) project_name
• $ drush pm-enable (en) project_name
• $ drush en project_name –y (dl and en)
– Update core and modules:
• $ drush pm-update (up) (update all modules and core)
• $ drush up drupal (update only core)
• $ drush up –n (list available updates)
• $ drush up –-no-core project1 project2 … (update only
specific modules)
8. – Clear cache even if Drupal is broken:
• $ drush sql-query “DELETE FROM cache”
– Disable a module even if Drupal is broken:
• $ drush sql-query "UPDATE system SET status = '0' WHERE
name = 'module_name‘
• $ drush sql-query "DELETE FROM cache_bootstrap WHERE
cid = 'system_list‘
– Set a password for a user:
• $ drush upwd --password="asdf" username
– See all drush aliases:
• $ drush site-alias
9. – Registry rebuild: very useful if there was folder changes
• $ drush dl registry_rebuild (install the contrib module)
• $ drush rr
– Search and replace: (it will replace only text fields but it
could be easily extended to another fields)
• $ drush dl sar
• $ drush sar “live.site.fr/” “integration.keyconsulting.fr/"