[support] Manual DB Updates on Multisite

John Summerfield summer at js.id.au
Wed Apr 17 15:13:15 UTC 2013


On 17/04/13 20:33, Kenneth Jacker wrote:
> Not sure what you mean here ...
>
> Use 'find' and the shell to do what?
>
>
> Sorry if I'm being dumb/dense,

[root at TestServer ~]# find /var/www/sites   -name settings.php
/var/www/sites/testserver/sites/default/settings.php
[root at TestServer ~]#

The settings.php directories show which sites' databased need to be 
updated. I don't have multiple sites set up so it's hard to demonstrate.

To work back a little,
[root at TestServer ~]# find /var/www/sites   -name settings.php -exec 
dirname {} \;
/var/www/sites/testserver/sites/default
[root at TestServer ~]#
When I set up multisites under D6, there were directories beside 
/var/www/sites/testserver/sites/default that reflected the domain names 
of the sites .

I think that still works, but now there is also sites.php. If you can 
code in PHP (I can't really), then you can read that in PHP and work on 
the $sites array.

This demonstrates making some sense of the sites.php from the commandline:
[root at TestServer ~]# cat 
/var/www/sites/testserver/sites/example.sites.php  | awk '/\$sites\[/ 
{if ($2 ~ ".sites") { printf "%s\t%s\t%s\t%s\n",  $1, $2, $3,$4}}'
*       $sites['dev.drupal.org']        =       'example.com';
*       $sites['localhost.example']     =       'example.com';
*       $sites['8080.localhost.example']        =       'example.com';
*       $sites['8080.www.drupal.org.mysite.test']       = 
'example.com';
[root at TestServer ~]#

Note that in reality you would have "if ($1" etc, I used 2 here to test 
the second word to show the kind of output you should expect.




More information about the support mailing list