Last updated March 4, 2014. Created on March 21, 2013.
Edited by batigolix, kostajh. Log in to edit this page.

See https://drupal.org/node/1946954

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 before continuing.

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.php might 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',
  ),
);
?>

Now you need to create a rebuild info file in the path you defined above under %rebuild.

Your local development environment directory should look like this now:

/docroot <-- contains Drupal
/resources <-- misc resources
/resources/rebuild.info <-- your rebuild info file

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.