Drupal upgrades

The release of 6.15 and 5.21 prompted a review of local Drupal sites. We have a collection of 44, many experimental, some customer evaluations and a few "productive" sites. Fortunately, all our sites have a similar file structure and we can obtain a status report of all Drupal code with a few lines of code.

#!/bin/bash
for i in `find /home/*/public_html/*/ -maxdepth 1 -name CHANGELOG.txt`
do
VERSION=`sed -n '3p' $i`
echo $i,"-",$VERSION
done

Also fortunate, all local files are in the "sites" directory tree. We downloaded and expanded the new versions from http://drupal.org in our "root" directory and immediately move "settings.php" out of the way in the 5.21 tree. Then in the "root" directory of each site and as the "user" who "owns" that part of the file system, we copy over the new code.

cp -a /root/drupal-6.15/* .

We use "drush" to update contributed modules and the database from the directory "sites/all/modules.".

drush update

Next we visit each site and obtain a status report. In a few cases "cron.php" was stale and we examined the crontabs.

crontab -e

A few were missing and hastily added.

# m h  dom mon dow   command
0 5 * * * wget -O - -q -t 1 http://example.net/cron.php

Not all could be updated from "status report" and we ran those manually.

wget -O - -q -t 1 http://example.net/cron.php

A quick look at the home page of each site and a small sample of links assured basic functionality. We found a few "permission" problems which were fixed with a combination of "chown" and "chmod" and in two cases - database "privileges" using "phpmyadmin".

Any public facing website is vulnerable to attack; at least we can offer the defense that all our Drupal code is up to date. (With one exception, "atrium" has not updated their version but I would expect a new release in the next few days).