With Drush you can greatly reduce the amount of time needed to setup and upgrade your Drupal installations - even if you're not a command line expert. If you haven't used Drush yet, you've probably at least heard of it.
This walkthrough will list the steps to get Drush setup on Windows. I'm using WAMP for my localhost. If you're using something else some of your paths might be different, but the setup process is the same.
Drush is a command line shell and Unix scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.
To learn more about getting started with Drush, watch the screencast Drupal School: Jumpstart with Drush and Command Line.
Download the Drush project from drupal.org.
Where to Install Drush?
Drush is not a module, not specific to a Drupal site or Drupal version (5.x, 6.x...). While you can place it in sites/all/modules, it makes more sense to install it outside of your Drupal directory for example in C:/ or C:/wamp/www.
Installation on Windows
- Install additional applications:
- Use bsdtar for tar, it's more reliable. Copy the file C:\Program Files\GnuWin32\bin\bsdtar.exe to C:\Program Files\GnuWin32\bin\tar.exe
Setup PATH environment variables for Drush, PHP, and tar/get/wget binaries installed above:
Control Panel > System > Advanced System Settings > Environment Variables
Select Path and click Edit.
Append your paths (separated by semicolons) to php.exe, drush.bat and tar/get/wget binaries to the Path Variable value. This field is not so usable as a textfield. You'll probably want to copy the existing value to a text editor, append your new entries and paste everything back into the field.
You're paths should look something like this, but they may be different depending on your setup.
Check to make sure your Path variable includes the path to the folder containing mysql.exe. While this isn't necessary to use Drush, being able to use MySQL via the command line comes in handy.
If you have an open command window, you will need to reopen it to refresh your path variables.
Edit drush.bat located in the root of your Drush folder to include the full path to your PHP installation.
@C:\wamp\bin\php\php5.3.0\php.exe "%~dp0drush.php" %*
Testing your Drush Setup
Open the Command Line, type
drush --help and hit enter. If installed correctly you should see a help listing of Drush commands.