// Download a module or theme drush dl cck // Enable module or theme drush en cck // clear cache all, don't need sudo drush cc all // Get help message on command drush help pm-update // List site aliases drush sa // Get status on particular site, via site-alias drush @math status
// drush core-rsync <source> <destination> drush core-rsync @dev @stage
drush dl drush_extras
This command creates a ssl public/private key in your home directory and copies the public key to a remote server. Subsequent drush commands will use this public/private key for authentication.
// okay substitute your username for "boris" and your server for "badinoff.com" drush pushkey firstname.lastname@example.org
cd <drush directory>/commands/ git clone https://github.com/scor/dgb.git
# from DRUPAL_ROOT # cd up one directory cd .. # create directory for backed up database mkdir databases # initialize a git repository git init
cd <DRUPAL_ROOT> drush dgb-backup
The DGB instance directory is the directory up from your DRUPAL_ROOT.
Database dump for default is in databases/default.sql
# from DRUPAL_ROOT cd into the DGB instance directory cd .. # see list of git commits git log # see what files have changed since last call to drush dgb-backup git status
# from DRUPAL_ROOT cd ../.. # create a dev directory parallel to other site mkdir dev cd dev git clone <path to dgb instance> # create a new branch called "my-dev-branch" git branch my-dev-branch # checkout the new dev branch git checkout my-dev-branch # now create a new database with the database dump # change <dbuser>, <dbpasswd>, <devdbname> and <path-to-dgb-instance> # and also the substitute default.sql for the name of your databasedump mysql -u <dbuser> -p <dbpasswd> <devdbname> < <path-to-dgb-instance>/databases/default.sql # now finally update settings.php to point to your dev database vim sites/default/settings.php # finally check that there is an .htaccess file in your new dev # <DRUPAL_ROOT> if not, copy it over from the cloned siteF
# Core-rsync copies all of the files from one site instance to another. # The first time you sync you can use --include-conf option to copy settings.php. drush core-rsync @live @dev --include-conf # Next change database settings to use @dev database. vi <document-root>/sites/default/settings.php # After first sync use w/out --include-conf and it will preserve the existing settings.php. drush core-rsync @live @dev # Sync databases. drush sql-sync @live @dev