Getting started with Drush

4,603 views
4,536 views

Published on

A very quick presentation presented at NWDUG (North West Drupal User Group) to explain some of the commands I commonly use, as well as how to get started with Drush.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
4,603
On SlideShare
0
From Embeds
0
Number of Embeds
111
Actions
Shares
0
Downloads
31
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Getting started with Drush

  1. 1. DRUSH DRUpal SHell Basics stemount, NWDUG August 20th 2010
  2. 2. IT HAS PLENTY OF COMMANDS To automate the administration of your Drupal site
  3. 3. WHAT DO THE COMMANDS DO? • Download modules/themes • Enable/Disable modules/ themes • Installs Drupal providing you have a install profile • Updates Drupal • Reindexes search • Clears caches • Run cron
  4. 4. USEFUL COMMANDS drush si (Site Install) This installs Drupal with your install profile. drush dl [module/theme name] Download a specified module/ theme name drush en [module/theme name] This enables a theme/module
  5. 5. USEFUL COMMANDS drush sm Lists all modules and themes. - good for debugging performance and cleaning up to go live drush cli Enters a Drush-only mode so you do not have to continuously type “drush command” drush search-index Indexes the site for the core search module without need to run cron
  6. 6. DRUSH UPDATE backup before you use Drush update. This make break your website. drush up Updates your Drupal install and patches security vulnerabilities, fixes bugs and (sometimes) includes performance tweaks
  7. 7. DRUSH UPDATE drush up Updates your Drupal install and patches security vulnerabilities, fixes bugs and (sometimes) includes performance tweaks
  8. 8. HOW TO GET STARTED • The Drush install script kindly written by me! • Youcan find the Drush install script on GitHub but will also be released on my blog with these slides. • Download it from CVS • Download it from Drupal.org, read the documentation and install manually
  9. 9. WHAT DO I DO WHEN I HAVE DRUSH? Simply type “drush” into Terminal / a CLI on your machine to get a list of commands
  10. 10. WHAT DO I NEED TO HAVE FOR DRUSH You need a UNIX/Linux/Mac OS X to use Drush It will work on Windows, see http://tohin.wordpress.com/2009/07/14/drush-power-tool-drupal-winxp/ however it is not made for Windows and this is a hack.
  11. 11. BACKING UP A SITE You wouldn’t use Drush for the time being It is to be automated in the future with the command “drush bam backup” however until then, it’s best to use the backup_migrate module
  12. 12. Use admin_menu (http://dgo.to/admin_menu) to navigate straight to a Quick Backup
  13. 13. 1 2 2- Step Process Use the drop-down box to select if you wish to download to your machine or keep on the server Click “backup now”
  14. 14. Similarly, you can use the “restore” feature to restore a database backup from backup_migrate
  15. 15. UPLOAD A BACKUP FILE AND RESTORE A DATABASE
  16. 16. THIS IS ONLY THE DATABASE THOUGH, YOU HAVE TO BACKUP THE FILES TO YOUR SITE. THAT’S UP TO YOU HOW YOU WANT TO DO THAT. GIT, TAR, AUTOMATED CRONJOB, BACKUP TO S3, BACKUP TO TAPE, DOWNLOAD FILES FROM YOUR CONTROL PANEL, LOG INTO YOUR FTP OCCASIONALLY AND DOWNLOAD THE FILES, USE AN AUTOMATION MODULE, IT GOES ON AND ON AND I WOULDN’T WANT TO WASTE ANY MORE OF OUR VALUABLE TIME
  17. 17. THE KEY TO SUCCESS WITH BACKING UP REGULARLY TESTING YOUR BACKUP ON A VANILLA INSTALL JUST IN CASE SOMETHING EVER DOES GO HORRIBLY WRONG. AND YOUR CLIENT / FRIEND / SIBLING / FRIEND OF A FRIEND DOESN’T LOSE THEIR SITE!
  18. 18. DRUSH DRUpal SHell Projects Mentioned: backup_migrate (http://dgo.to/backup_migrate) drush (http://dgo.to/drush) admin_menu (http://dgo.to/admin_menu) Blog Post with Drush Script: http://stemount.posterous.com/north-west-drupal-user- group-20-aug-2010

×