Project

General

Profile

Actions

DrupalDrushUpdate » History » Revision 44

« Previous | Revision 44/50 (diff) | Next »
Andreas Kohlbecker, 06/18/2020 10:40 AM


Updating Drupal multisite installations with Drush

Requirements

Important

It is important that the zen theme is not updated automatically. The site configured as reference site for the code update will be tested by the script for having the zen theme enabled. To protect the zen theme from being modified by drush the site will be switched to the bartik theme while running the code update.

Preparation

Create a shell script drupal-multisite-update to configure and trigger the drupal multisite update with the following content:

#!/bin/bash

DRUPAL_ROOT=/var/www/drupal-7/
SITE=http://my.server.com/dataportal/cichorieae/
# In case this is empty, the default email address ProjectAdmin@bgbm.org will be used
EMAIL='' 

cd $DRUPAL_ROOT
chown -R www-data:www-data
/opt/server-scripts/drupal/drupal-multisite-update.sh $SITE $EMAIL
chown -R www-data:www-data

Make it executable

Execution

NOTE: Before executing the update, you may want to run dataportals-updatedb to apply all pending updates and to check for the health of all sites!

run the script:

./drupal-multisite-update

The script will print out the list of pending security updates and waits for user confirmation in order to proceed.

Troublesooting

drush updatedb warns about missing modules

Missing modules can be fixed using the script drupal-fix-missing-modules.sh which is contained in server-scripts/drupal/. In advance of using this script you need to download the module_missing_message_fixer:

drush pm-download --destination=sites/all/modules/ module_missing_message_fixer

Then you can run the script:

drupal-fix-missing-modules.sh {SITE-URL}

Updated by Andreas Kohlbecker almost 4 years ago · 44 revisions