I just upgraded from 7.21 --> 7.22.
Although the output of "drush update" suggested otherwise:
Performed update: field_update_7003 [ok] Performed update: dblog_update_7002 [ok] Performed update: system_update_7078 [ok] Finished performing updates. [ok]
I had to go to each multisite "Update" page and manually run the DB updater.
Normal?
-Kenneth
On 4/14/13 5:52 PM, Kenneth Jacker wrote:
I just upgraded from 7.21 --> 7.22.
Although the output of "drush update" suggested otherwise:
Performed update: field_update_7003 [ok] Performed update: dblog_update_7002 [ok] Performed update: system_update_7078 [ok] Finished performing updates. [ok]
I had to go to each multisite "Update" page and manually run the DB updater.
Normal?
-Kenneth
Well, every installation needs to have ITS database updates run, multi-site doesn't change that. I don't know if drush is supposed to be able to detect that it is in a multi-site and do the update on all the installations at once.
On 15/04/13 07:04, Richard Damon wrote:
Well, every installation needs to have ITS database updates run, multi-site doesn't change that. I don't know if drush is supposed to be able to detect that it is in a multi-site and do the update on all the installations at once.
I don't know either, but if there is a sites.php in the proper place I don't see why it shouldn't.
Perhaps someone could check their database logs and see whether it happens, and if not file a "feature request?"
In the mean time, under Linux/MAC OS etc, the find command coupled with a little shell scripting would work well.
First, thanks to all who responded to my query.
rd> I don't know if drush is supposed to be able to detect that it is rd> in a multi-site and do the update on all the installations at once.
js> Perhaps someone could check their database logs and see whether it js> happens, and if not file a "feature request?"
I saw nothing in the logs. Also, the Drupal "status" and "updates" reports indicated that each DB needed to be updated (which I manually did).
js> In the mean time, under Linux/MAC OS etc, the find command coupled js> with a little shell scripting would work well.
Not sure what you mean here ...
Use 'find' and the shell to do what?
Sorry if I'm being dumb/dense,
-Kenneth
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@TestServer ~]# find /var/www/sites -name settings.php /var/www/sites/testserver/sites/default/settings.php [root@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@TestServer ~]# find /var/www/sites -name settings.php -exec dirname {} ; /var/www/sites/testserver/sites/default [root@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@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@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.
I have a drush alias file for all my sites (some multisite, some single site, see http://drupal.org/node/670460). I then use "drush alias updatedb" for all sites in a multisite installation to make sure that all databases are updated.
(of course, I have a development multisite installation as well, so that I can test the updates first).
"drush site-alias" gives you a list of all your aliases, so in principle, you could create script like this:
#!/bin/bash for site in `/usr/local/drush/drush site-alias` do drush update drush updatedb done (I repeat the drush update for all sites, in case some of the modules are not used by all sites)
However, that would update all your databases. Since I update develop first, I actually have two update scripts:
#!/bin/bash for site in "firstdev" "seconddev" "thirddev" "forthdev" do echo "running updates for ${site}" /usr/local/drush/drush @${site} up /usr/local/drush/drush @${site} updatedb /usr/local/drush/drush @${site} cc all done
(and then of course a second one for the production sites)
Hope this helps,
Ursula
On Wed, Apr 17, 2013 at 8:13 AM, John Summerfield summer@js.id.au wrote:
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@TestServer ~]# find /var/www/sites -name settings.php /var/www/sites/testserver/sites/default/settings.php [root@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@TestServer ~]# find /var/www/sites -name settings.php -exec dirname {} ; /var/www/sites/testserver/sites/default [root@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@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@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.
-- [ Drupal support list | http://lists.drupal.org/ ]
On 18/04/13 05:19, Ursula Pieper wrote:
for site in `/usr/local/drush/drush site-alias`
A handy hint:
in bash one can code for site in $(/usr/local/drush/drush site-alias)
for improved legibility (sometimes those backticks can be hard to distinguish from apostrophes), and for improved clarity on those occasions when one finds it expedient to nest them. Whether this is standard with bourne shell I don't know, but bash is available on all Linux distros (although I suspect Debian no longer installs it by default, I think the default shell is now dash), on OS X, and if not installed on *BSD* it can be.
Drush by default only runs updates on the "default" drupal install. However you can get databases in sync quickly with:
drush @sites updatedb
Which will run the database update on all sites defined in your codebase.
The @sites alias can be used for any drush command of course.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of John Summerfield Sent: Tuesday, April 16, 2013 7:49 PM To: support@drupal.org Subject: Re: [support] Manual DB Updates on Multisite
On 15/04/13 07:04, Richard Damon wrote:
Well, every installation needs to have ITS database updates run, multi-site doesn't change that. I don't know if drush is supposed to be able to detect that it is in a multi-site and do the update on all the installations at once.
I don't know either, but if there is a sites.php in the proper place I don't see why it shouldn't.
Perhaps someone could check their database logs and see whether it happens, and if not file a "feature request?"
In the mean time, under Linux/MAC OS etc, the find command coupled with a little shell scripting would work well.