How Drush Makes Your Life Easier in Drupal 8
Drush is a tool in Drupal 8, which helps perform various tasks like website installation, configuration, and update from the command line.
A website may require an update due to several reasons, such as security issues. Choosing to update the modules via conventional methods proves to be time-consuming task.
But Drush makes it convenient and saves time by allowing you to update your website using just one command.
How Drush eases the process when Drupal already has a friendly UI?
Drush helps speed up the updating process and scripting. You can simply run the commands from within a script.
Drupal can help you:
- Use rsync to update remote instances or install profiles
- View project info such as project status, site activity, installation location, or module info
- Add security patches and update core module, update database or migrate it from an older version to newer version
- Run cron, clear the cache, and build the search index
- Retrieve and set the core module variables quickly
- Create custom Drush features
How to install Drush in Drupal 8?
Using Composer is the simplest way to install Drush on Drupal 8. To install the Drush scripting interface, you need to use the command line. Any command that you use can be issued from there.
Which commands can you play with?
In Drush, you can play with the following commands. However, you must take a backup of the site and your database beforehand.
Using this command, you can backup both files and database in a single directory.
This command helps update Drupal core, contributes modules and applies for any pending database updates.
drush up –security-only
drush up –security-only helps in security updates for third-party modules on your site.
drush up –no-core
This command helps update the contributed modules without Drupal core.
drush pm-updatestatus/drush ups
If you want to show the security update status for all modules on your site, enter this command.
drush up <module1_name> <module2_name> …
You can easily update individual Drupal modules by hitting this command.
Using this command, you can update the database, if required.
drush sset system.maintenance_mode 1
This command helps activate the maintenance mode.
Using this command, you can clear the cache.
Ensuring an updated website—Drupal core and third-party modules—at all times becomes extremely simple with effective Drupal security policies in place. Drush is considered inevitable for Drupal 8, since it eases the process of updating your website to the latest stable versions.
If you are still using Drupal 7, then it’s time to switch to Drupal 8.