Skip to content

Instantly share code, notes, and snippets.

@underhilllabs
Last active February 9, 2016 21:10
Show Gist options
  • Save underhilllabs/2466be260e3a4e1994e7 to your computer and use it in GitHub Desktop.
Save underhilllabs/2466be260e3a4e1994e7 to your computer and use it in GitHub Desktop.
drush notes

Drush Commands

drush sql-sync @source @target

sync database from source alias to the target alias drush sql-sync @prod @dev (copies the production db to dev for testing purposes.)

drush rsync @source @target

rsync files from the drupal root of @source to the drupal root of @target alias @target could be the production site on a remote server.

drush sql-cli

get dropped into mysql command prompt

drush uli 1

get a one-time link for the super user account

drush upwd 1

change the password for the account (1 is the super user, can do this for any user id or user name).

drush dl

drush dl views (will download the latest stable version of views, still need to enable it.)

drush en

drush en views (will enable

Example Drush Aliases file

<?php


$aliases['mu_dev'] = array(
   'root' => '/var/www/mu_dev/drupal-7.12/',
   'uri' => 'http://majorursa.net',
);
$aliases['election_dev'] = array(
   'root' => '/home/bossy/projects/ucdelection/drupal7/',
   'uri' => 'http://ucdelection.denvertech.org',
);
$aliases['election_prod'] = array(
   'root' => '/home/bossy/projects/ucdelection/drupal7/',
   'uri' => 'http://ucdelection.denvertech.org',
   'remote-host' => 'mystagingserver.myisp.com',
   'remote-user' => 'root',
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment