getting started with drush

18
DRUSH DRUpal SHell Basics stemount, NWDUG August 20th 2010

Upload: stephen-mount

Post on 12-Nov-2014

5.176 views

Category:

Documents


0 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Getting started with Drush

DRUSHDRUpal SHell Basics

stemount, NWDUG August 20th 2010

Page 2: Getting started with Drush

IT HAS PLENTY OF COMMANDSTo automate the administration of your Drupal site

Page 3: Getting started with Drush

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

Page 4: Getting started with Drush

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

Page 5: Getting started with Drush

USEFUL COMMANDS

drush smLists all modules and themes. - good for debugging performance and cleaning up to go live

drush cliEnters a Drush-only mode so you do not have to continuously type “drush command”

drush search-indexIndexes the site for the core search module without need to run cron

Page 6: Getting started with Drush

DRUSH UPDATE

drush upUpdates your Drupal install and patches security vulnerabilities, fixes bugs and (sometimes) includes performance tweaks

backup before you use Drush update. This make break your website.

Page 7: Getting started with Drush

DRUSH UPDATE

drush upUpdates your Drupal install and patches security vulnerabilities, fixes bugs and (sometimes) includes performance tweaks

Page 8: Getting started with Drush

HOW TO GET STARTED

• The Drush install script kindly written by me!

• You can 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

Page 9: Getting started with Drush

WHAT DO I DO WHEN I HAVE DRUSH?

Simply type “drush” into Terminal / a CLI on your machine to get a list of commands

Page 10: Getting started with Drush

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.

Page 11: Getting started with Drush

BACKING UP A SITE

You wouldn’t use Drush for the time beingIt 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

Page 12: Getting started with Drush

Use admin_menu (http://dgo.to/admin_menu) to navigate straight to a Quick Backup

Page 13: Getting started with Drush

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”

1 2

Page 14: Getting started with Drush

Similarly, you can use the “restore” feature to restore a database backup from backup_migrate

Page 15: Getting started with Drush

UPLOAD A BACKUP FILE AND RESTORE A DATABASE

Page 16: Getting started with Drush

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

Page 17: Getting started with Drush

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!