Drush: The Swiss Army Knife for Drupal
Article
I’m personally amazed at the new features and advances of Drupal 8. There are so many changes to talk about, but for this article I want to cover configuration management. In case you haven't yet heard, with the new version of Drupal we see all configuration stored in files instead of in the database. With the new version of Drush there are some built in tools to help manage these files.
At the time of this writing, the recommended version of Drush is 6; however, this article uses commands that were introduced with version 7. Before you can try any of these, you’ll need to be running that version of Drush. The tricky part is that it currently does not have a full release. Typically, you would not want to install a project’s dev release in a production environment. I’m going to assume you will be working locally, on a development server, or are confident you can’t hurt anything otherwise.
In a previous article I explained how to install Drush using Pear; however, the project is shifting to Composer. You can still install via Pear, or even manually, but it's recommended you switch to Composer. Drush has also been moved to GitHub; you will find additional instructions for installing with something other than composer there.
Assuming your environment already has Composer installed, get the latest release of Drush 7 and issue the below command.
composer global require drush/drush:dev-master --prefer-source
Next, verify that it installed:
drush version
The output should indicate you have Drush 7.0-dev, or something along those lines. If it didn't work you may need to log out and back in again before your SSH user will know it's installed.
Now that we have the latest and greatest, the next thing to do is get Drupal 8. Using Drush you can request a specific version of Drupal, or any project, by providing the version number. If you don’t provide a version it will find the recommended version and download that instead.
To get the dev version of Drupal, type this:
drush dl drupal-8.x-dev
Next, let’s get a site installed. Keep in mind that you will need to configure your web server and database since this command only handles the install of Drupal.