Drush is a command-line shell for Drupal which enables you to perform many website maintenance tasks and administrative tasks from the terminal instead of using the Drupal administrative interface. Drush aliases allow you to run drush commands on your local server but actually the command executes on a remote server.
Everyone knows Drush is a very important tool in Drupal development, to execute things faster and to manage Drupal websites remotely. Drupal specifically built its shell function to update its configurations, managing modules, running drupal updates, etc.
This article is about a few drush commands as well as Linux commands that helped ease my work at times while working on remote servers. Mostly while updating or upgrading. The need for bulk operations in drush is often never met except using complex Linux commands often involving 'sed'. Operations like disable all non-core modules, enable the disabled modules from a list, create a list of all core and non-core modules in use and so on.
Can you imagine how it will be to manage Drupal sites without Drush. We may face one issue when Drupal 8 release coming up. Drupal 8 needs the all new version of Drush, and it won't be compatible with older Drupal version 6 and so. Drush version 5 is used to Drupal 6, drupal 8 requires drush of version 8, or else if you have scripts for Drush developed for version 6 or 7 will not work with the latest version of Drush. In this article lets see how we could experiment switching between the Drush versions.
Here I am listing some methods to clear Drupal caches. Drupal caching is done to improve and enhance overall performances of the site. Its always recommended to enable the page caching and block caching in Drupal.
Being drush in your portfolio has something to count on you. Drush has its own way of doing things. We all might be knowing on how to make a copy of the database of a project profile using MySQL in bash.
As part of Drupal development project, we always use drush commands. Drush or Drupal shell refers to a command-line shell and scripting interface for Drupal. Drush enables developers to effectively manage and maintain their Drupal websites from the server command line. A few frequently used commands are listed below.
Imagine if your Drupal site has more than 30-50 modules and you wanted to update them all or you want clear all Drupal cache. If you do it manually just by unzipping and run update.php or just click the clear cache it may takes more time. Hence if you can do this all process in one single command it will be easier for a developer. Here we can use drush commands to do all work with a single command and in few seconds.
It is important to keep our drupal site up-to-date. New releases of contributed modules and Drupal core come out periodically to address critical security fixes, and it's important to stay on top of updates as they are released. It is difficult to download the latest version of each module separately and then remove the old one from the sites/all/modules folder and put the the new one in that place and all. Drush comes to help us in updating the modules in an easy way. The following are the steps to update the non hacked modules using drush
The radical changes that Drupal 8 brought forward have been reflected in Drush 7 as well. Drush 7 now uses composer to download its dependencies. Before installing Drupal 8 you must make sure that Drush 7 has been installed. This is because Drupal 8 can be downloaded and installed using Drush like in the previous versions of Drush and also, Drupal 8 only supports Drush 7. Unlike earlier versions, Drush 7 cannot be installed using "sudo apt-get install drush" nor can it be updated by running "drush self-update" because that will result in updating to Drush 6 and no more. Hence the purpose of this article.
Drush is a powerful tool to manage routine tasks in a Drupal site. Downloading, installing or enabling modules, running cron and much more can be accomplished using Drush. This is why its important to have Drush 7 before a Drupal 8 installation. Drupal 8 requires minimum version of PHP 5.4. Apache requirements haven't been mentioned, but I recommend apache2.4. After this we can begin installing Drush 7.
I got assigned with a task of executing drupal-8 migrations. The only way to migrate data into Drupal 8 is through Drush. While I was progressing through working with Drupal-7 to Drupal-8 migration we got stuck with white screen death.
So we find out following are the methods to correct this error.
In a Drupal site, I was working on, I found that many of the modules were unused. Their presence was increasing the size of the site and consuming time when searching for useful info. So I thought of removing these modules.It makes our job a lot easier if we are using Drush Read on to know how to remove unused modules in a Drupal site with the help Drush.
What do you do if you have to take your Drupal site into maintenance mode from the command line? Well you can do this easily if you have drush set up on your server. With drush you can do quite a lot powerful drupal administration tasks right from the command line.
In Drupal 6
The following drush command will take your Drupal site offline
As the World wide web is starting to resemble the wild wild west, you have to ensure that your Drupal site is always up to date. If you are ignoring the security updates of Drupal, then you are simply making your Drupal site vulnerable to the worst enemy of all - Negligence. Updating a Drupal site requires time and effort which is why most people ignore it. Here is a quick way to update your Drupal site using Drush and Hacked module.
The default method of changing a Drupal theme using the graphical Admin interface is familiar to most Drupal users. However a Drupal user is limited to changing only one theme at a time using this method and it is also slightly time consuming. What if you want to enable more then one theme at a time? Drupal provides a quicker way to change the theme using the bash command line. Read on to know how to enable multiple Drupal themes using the bash command line