Multisite: How to specify ~/sites/mydomain.com.mysite in the command-line options?
| Project: | Drush |
| Version: | All-Versions-2.1 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
I've been digging though a lot of documentation and forum postings on command-line options for specifying a multi-site site, but I'm just not seeing the answer to this.
My sites look like:
~/sites/sub.domain.com.mysite/
~/sites/sub.domain.com.myothersite/
~/sites/sub.domain.com.anothersite/
... where "mysite," "myothersite," and "anothersite" are self-pointing symlinks in Web root ("ln -s . mysite").
How do I do a status, for example?
./drush --root=/var/www/domain/httpsdocs --uri=https://sub.domain.com status
./drush --root=/var/www/domain/httpsdocs --uri=https://sub.domain.com/mysite status
I get either the default site only, or "Drush command could not be completed." The multi-site setup has been in operation for months and is working correctly, so this is not a startup installation question. I'm trying to add drush into the mix.

#1
Or maybe I misunderstand the scope of the status command. But how do I specify the site for doing an updatedb?
#2
I am not 100% sure about the paths and domains you are using, so let me describe what I did.
/srv/www/drupal == where I usually put my Drupal root.
I usually create "myothersite.domain.com" and "anothersite.domain.com", all pointing at /srv/www/drupal, but this time I created the domain testms.com and gave it its own document root.
/srv/www/testms == document root for testms.com
/srv/www/testms/index.html == "hello world"
/srv/www/testms/drupal/ == symlink to /srv/www/drupal
Then I did the following tests:
drush --root=/srv/www/testms/drupal --uri=testms.com/drupal statusdrush --root=/srv/www/drupal --uri=testms.com/drupal statusBoth of these worked. "updatedb" in place of "status" also worked.
Finally, I added the following site alias to my drushrc.php file:
$options['site-aliases']['tms'] = array ('uri' => 'testms.com/drupal',
'path-aliases' =>
array (
'!root' => '/srv/www/testms/drupal',
),
);
After that, I could also do this:
drush tms statusAnd that worked as well. I did notice that there are some other bugs with these sorts of site aliases, as the sitealias code expects to see 'testms.com.drupal' in some places instead of 'testms.com/drupal' (which is what is necessary). However, I could still use the tms alias with 'drush sql sync' after I added an entry for 'db-url'.
In any event, I will make another incident to repair the site alias bugs. I hope that the information above will be enough to get you started on your way.
#3
I realized I should set this to 'fixed' since there is no drush change needed here.
#4
i am not sure i understand the magic of your symlink stuff :-)
anyway, what I find the best is running drush in the directory of the site you want to work for. Simply create an alias and there you go : cd /sites/whatever drush status (without the need to specify -r and -l).
#5
Automatically closed -- issue fixed for 2 weeks with no activity.