Drupal - How to target specific sites with Drush when using Multisites?
When you say "core site", do you mean the site in sites/default
? Is it an option to just delete the settings.php file at sites/default/settings.php
?
If you'd like to manage your aliases in an alias file, create a file ~/.drush/mysite.aliases.drushrc.php
:
$root = '/path/to/root';
$aliases['site1'] = array(
'root' => $root,
'uri' => 'site1.com',
);
$aliases['site2'] = array(
'root' => $root,
'uri' => 'site2.com',
);
See this link for an example.
Then, to refer to one site:
drush @site1 status
- or -
drush @mysite.site1 status
To refer to all sites:
drush @mysite status
Maybe you want to get more fancy than this, though. If you have more aliases in your alias file (e.g. for 'dev' and 'live' sites, you can make your own lists:
$aliases['dev'] = array(
'site-list' => array('site1', 'site2'),
);
Then:
drush @mysite.dev status
If you want, you may also store your alias file in /path/to/root/drush
or /path/to/root/sites/all/drush
, but if you do this, Drush won't be able to find your alias file unless you specify --root on the commandline, or change your working directory to be somewhere inside of /path/to/root
.