Adding & Upgrading Modules

Shared Modules

Note: To simplify maintenance www.futurelogisticslivinglab.com.au shares libraries and modules with www.embeddedsystemsaustralia.com.au

/opt/lampp/htdocs/futurelogisticslivinglab/sites/all/libraries -> ../../../embeddedsystemsaustralia/sites/all/libraries//
/opt/lampp/htdocs/futurelogisticslivinglab/sites/all/modules -> ../../../embeddedsystemsaustralia/sites/all/modules//

 This means that updates should probably be done from the www.embeddedsystemsaustralia.com.au site.  Core file upgrades have to be done on both websites.

Note: There are better ways of having one Drupal installation shared by two sites.  See Drupal documentation.

Module Update

The Plugin Manager module is useful to search and upgrade modules.  It is linked to the software that tracks the status of modules (whether they are out of date) this link, however, is not perfect.

  1. Check Status of the sytem: http://www.embeddedsystemsaustralia.com.au/admin/reports/status
  2. Check Modules are Up to Date: http://www.embeddedsystemsaustralia.com.au/admin/reports/updates/list
  3. Use Plugin Manager to guess and update modules (ideally should match list in (2) above): http://www.embeddedsystemsaustralia.com.au/admin/plugin_manager/update
  4. Run Update http://www.embeddedsystemsaustralia.com.au/update.php
  5. Note: Do not be overly concerned about resolving all module dependences.  If you do you'll enable modules that are not being used and create more confusing menu options for the administrator.

Manual Download and Install

If Plugin Manager is not detecting the correct software to install then a manual download and install is required. Here is an example of manually upgrading the Backup Migrate module:

  1. Connect to web server esa-web.ext.nicta.com using Putty.
  2. Login: local-admin
  3. Password: Ask Neil Temperley for this.
  4. Put Drupal into maintenance mode: http://www.embeddedsystemsaustralia.com.au/admin/settings/site-maintenance
sudo -i
NEWTAR=backup_migrate-6.x-1.2.tar.gz
MODULE=${NEWTAR%%-*}
echo ${NEWTAR%%-*}
cd /opt/lampp/htdocs/drupal/sites/all/modules
wget http://ftp.drupal.org/files/projects/$NEWTAR
mv $MODULE $MODULE.old
# Note: Check above is OK before this next step!
tar xvf $NEWTAR
rm $NEWTAR
  1. Run update: http://www.embeddedsystemsaustralia.com.au/update.php
  2. Put Drupal out of maintenance mode: http://www.embeddedsystemsaustralia.com.au/admin/settings/site-maintenance
  3. Done!

Drupal Core Files Upgrade

Follow the upgrade notes in the new drupal distribution.  Note: Upgrades to core files is a major headache mainly because you are supposed to disable all contributed modules before proceeding! 

  1. Put the site off-line for maintenance: http://www.embeddedsystemsaustralia.com.au/admin/settings/site-maintenance
  2. Backup all the database: http://www.embeddedsystemsaustralia.com.au/admin/content/backup_migrate
  3. [Suggest you skip this!  Read on...]  Disable all contributed modules [remember which ones you were using!]: http://www.embeddedsystemsaustralia.com.au/admin/build/modules
    [This step is really onerous because you have to re-enable the modules after upgrade.  I suggest you risk skipping this step.]
  4. Use Putty to log in to the server as user local-admin
  5. The following Unix commands can act as a useful guide [change the filenames accordingly].   You can cut & paste small groups of these into the Unix command prompt:
# Change user to root:
sudo -i
cd /opt/lampp/htdocs
# Set a bash environment variable to the website directory
WEBDIR=embeddedsystemsaustralia
# Set a bash environment variable to the correct new drupal version name:
NEW=drupal-6.XX
# Set a date variable too:
DATE=`date +%Y%m%d`; echo $DATE
# Get the new version:
wget http://ftp.drupal.org/files/projects/$NEW.tar.gz
# Backup all:
tar -czvf $DATE-esa_all.tar.gz $WEBDIR/
# Extract new drupal version:
mv $WEBDIR $WEBDIR-old
tar -xvpf $NEW.tar.gz
mv $NEW $WEBDIR
# Fix ownerships:
chown -R local-admin $WEBDIR
chgrp -R local-admin $WEBDIR
# Move across old sites directory to new installation:
cd $WEBDIR
mv sites sites.orig
mv ../$WEBDIR-old/sites .
# Copy across the style sheet used when printing newsletters:
mv misc/print.css  misc/print-old.css
cp ../$WEBDIR-old/misc/print.css  misc
cd ..
# Restart Apache
/opt/lampp/lampp restart
# Cleanup
rm $NEW.tar.gz
  1. Run Update http://www.embeddedsystemsaustralia.com.au/update.php
  2. Check for modules that need updating. http://www.embeddedsystemsaustralia.com.au/admin/reports/updates/list
  3. Put the site back on-line: http://www.embeddedsystemsaustralia.com.au/admin/settings/site-maintenance