Quantcast
Channel: drupal.org - Site administrators
Viewing all articles
Browse latest Browse all 426

Configuring your Drush alias

$
0
0

Drush Rebuild requires a properly configured Drush Alias. If you are not familiar with Drush aliases, type drush docs-aliases and read up about them.

Drush Rebuild can only rebuild local environments that have a Drush alias defined.

Let's say you have a production site at example.com, and you want to set up a local development environment at local.example.com.

Your Drush alias at ~/.drush/example.aliases.drushrc.phpmight look like this:

<?php
$aliases
['local'] = array(
 
'root'=> '/path/to/your/repo/docroot',
 
'uri'=> 'http://local.example.com',
 
'db-url'=> 'mysql://root:password@localhost/example_local',
);
?>

You should be able to type drush @example.local status and get some output.

In this example, your local development environment file structure looks like this:

/docroot <-- contains Drupal
/resources <-- misc resources

To modify your alias for Drush Rebuild, make the following change:

<?php
$aliases
['local'] = array(
 
'root'=> '/path/to/your/repo/docroot',
 
'uri'=> 'http://local.example.com',
 
'db-url'=> 'mysql://root:password@localhost/example_local',
 
'path-aliases'=> array(
   
// Under path aliases, you specify the full path to the rebuild manifest
    // for your local environment.
   
'%rebuild'=> '/path/to/your/repo/resources/rebuild.info',
  ),
);
?>

Viewing all articles
Browse latest Browse all 426

Trending Articles