IHello.
I have few sites in a drupal 8 multisite installation.
I have updated the core via composer to v8.6.3 and updated the database of one of the sites.
I didn't realize that I have to update the database of each site.

I already updated some of the sites but in some of them I can't load the /user/login page.
I'm receiving an error:
The website encountered an unexpected error. Please try again later.
I'm getting this error aswell, when I navigate in some pages in the site, which the database has not been upgraded.
When I update the database there is no error.

If I would have 200 sites it will be painful to login and update each one in the UI. I would like to do it with the commmand line if it's possible with only one command. Sure there are commands to do that.

I tried this command

 drush updatedb
 [success] No database updates required.

I found this article:

Updating a Drupal multisite using Drush

https://cvuorinen.net/2013/02/updating-a-drupal-multisite-using-drush/

I'm using this command to update all the sites

drush @sites updatedb
 [preflight] The alias @sites could not be found.

I tried to update a single site with

drush nameofthesite.domain.xyz updatedb

Command "nameofthesite.domain.xyz" is not defined.

nameofthesite.domain.xyz is in the list of the sites.php

Thank you.

Comments

jvr968’s picture

From this article I found a way to have free access to update.php to update the database of each site indicidualy by the UI.

https://www.drupal.org/forum/support/upgrading-drupal/2018-09-09/solved-...

setting this:

$settings['update_free_access'] = TRUE;

in the settings.php file of the site.

The thing is wich is thway to do it automatically via CLI individually.

Or better all at the same time.

Thank you.

vm’s picture

you've found the pain of a multisite installation. There wasn't an autoscript to handle this in the past. Unsure if there is now. At the end of my experience, I realized that while multisite made some thing easier it also made some things more challenging. As such, the only time I utilize a multisite is to have  a dev and a prod site running off same code base.