Quick video tutorial on how to set up drush for drupal 8. This covers both windows and linux.
Directions are available on Drupalize.me. Which can be found here: Upgrading Drush to work with Drupal 8-dev
For the most up-to-date information on upgrading Drush for Drupal 8 read the official documentation Here on Drush.org
Manually upgrading if using Linux or Mac OSX (using official documentation)
This tutorial assumes you are comfortable working in the terminal and assumes a basic understanding of file structures. This is likely the most fool proof method to ensure Drush is updated to the latest version, while also preserving your old copy if you need to rollback or switch versions for an older site
Determine the latest version for your server using the Drush compatibility chart
If you are sure you want to the latest version, you can follow these steps:
- Open a terminal window and type:
- Download the latest version:
php -r "readfile('http://files.drush.org/drush.phar');" > drush
- Make the new version executable:
sudo chmod +x ~/drush
- **Important** Depending on your setup, you need to find the path of your current install by typing:
This will return something typically like "/usr/bin/local". However depending if you used a package manager or your system the path could be different.
- **Important** make sure you have copied this path before continuing, all the next steps require it
- Using the path found above, make a backup copy of drush
sudo cp /yourpath/to/install/drush /yourpath/to/install/drush_old
- Delete the old version:
sudo rm /yourpath/to/install/drush
- Move the new version to your install path:
sudo mv ~/drush /yourpath/to/install/drush
- Initialize the new version
- It may ask if you want to append some Drush bash customizations. Most people I would assume would choose yes.
- Now you should be able to navigate to a Drupal 8 site root and test with simply typing "drush". If all goes well you'll see a list of commands available for that site.