5

I have to update all sites on a D7 multi-site installation. I normally deal with single installation and I use drush up to update the core, modules and db. I have no prior experience with a multi-site installations.

I read this article on how to install drush for multi-site but I would like to know if running drush -l mysite1.com up will actually work before running it.

Kindly help if you have prior experience in this matter. Thank you.

2 Answers 2

7

Yes! But maybe no! Be careful!

If you run pm-updatecode on any code in a given Drupal site, it is necessary to run updatedb afterwards in order to make the database schema(s) match the current schema in code. So, while drush -l mysite1.com will in fact correctly run pm-updatecode followed by updatedb on mysite1, if you have any modules in sites/all/modules that is updated, or if Drupal core is updated, then you will also need to run updatedb on every other site in the multisite install. If you skip this step, then mysite1 will work, but you might break the other sites in the multisite install.

When dealing with a multisite installation, the safest policy is:

  1. Copy live to dev
  2. Run pm-updatecode on every site in the multisite on dev
  3. Run updatedb on every site in the multisite on dev
  4. Test! Test! Test!
  5. Take all of the sites in the multisite offline on production
  6. Push your updated code from all multisites on dev to production
  7. Run updatedb on every site in the multisite on production
  8. Test again!
  9. Bring all of the sites back online

You can avoid doing all sites at once if you know that all of your updated modules are in sites/mysite1/modules, and Drupal core is not updated. In general, though, it is better to avoid multisite installs so that you do not need to worry about the interdependence of the shared code on multiple databases.

1

Yes! drush @alias works for most everything I have tried so far. Just make sure you have you aliases properly configured. This feature just pretty much works the way it's written on the box. So far I have mostly used if for rsync and sql-sync without problems with multiple aliases.

I have set up all my aliases in .drushrc folder as stated on their manpage. - Make sure you scroll down on that page the good stuff is at the botton.

Hope this helps, good-luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.