Project

General

Profile

Useful Drush tricks

What is drush? see here :http://drush.ws/about

All tips and tricks account to Drupal 7!

see also the DrupalAdministrationWithDrush page


Template for new entries:

 `admin/foo/bar` 

* drush command: `drush lorem ipsum  val_1` 
* values:  
  * val_1: foo
  * val_2: bar 

error level

  • admin menu equivalent: admin/config/development/logging
  • drush command: drush vset -y error_level <value>
  • values:
    • 0: none
    • 1: errors and warnings
    • 2: all

clean urls

  • admin menu equivalent: admin/config/development/logging
    • when the clean URL test fails be sure to check the following
    • run sudo a2enmod rewrite
    • check that in your .htaccess RewriteEngine on is set
    • drush command: drush vset clean_url -y <val>
    • values:
    • 0: off
    • 1: on

javascript and css preprocessing

  • drush command: {{drush vset -y preprocess_css 1; drush vset -y preprocess_js 1}}}

maintenance mode

  • admin menu equivalent: admin/config/development/maintenance
  • drush command: drush vset -y maintenance_mode <val>
  • values:
    • 0: off
    • 1: on

reset cdm_dataportal schema version

This allows running an update again even if the update function already has been executed in the past.

  • drush command: drush sql-query --db-prefix "UPDATE {system} SET schema_version=<version> WHERE name='cdm_dataportal' and type='module';"
  • : the schema version to reset to, e.g.: 7003

show the cdm server url of a dataportal

Display the value of the cdm_webservice_url variable, which contains the cdm server url configured to a cdm dataportal

  • drush command: @ drush vget cdm_webservice_url@

unblock account after 5 failed login attempts

  • drush command: drush sqlq --db-prefix "delete from {flood}"
Add picture from clipboard (Maximum size: 40 MB)