Book page Révision de Platform maintenance du mer, 2009-06-03 12:30

Les révisions vous permettent de suivre les différences entre plusieurs versions d'une contribution.

Introduction

While respecting the change policies, this document describes how to add, update and remove modules installed in any given platform.

Handy tips

This document assumes you have a drush command in your path, and that it is ran as the aegir user.

Since drush is not yet installed system wide, you will probably want to setup an alias for it. And because you will very likely use sudo to run drush, your alias will probably look something like this:

alias drush="sudo -u aegir /var/aegir/drush/drush.php"

You can put that command at the end of your ~/.profile to make sure it is ran every time you connect to the server.

It also assumes you work from the aegir home directory (~aegir or /var/aegir) unless otherwise noted.

cd /var/aegir

Those commands need to be ran through the shell, and you need appropriate permissions from the sysadmin committee (which is given upon request and with a proper reason to CT members). Eventually, this will be controlled by the Hosting frontend so this manual fiddling will not be necessary.

Creating a platform

To create a new platform, you need to use Drush. It's as simple as:

drush dl drupal

This will download the latest stable Drupal release (6.12 at the time of writing) into the current directory (which, as mentionned above, should be /var/aegir).

Once the code is downloaded, you need to add a "platform node" so that the frontend knows about the new platform.

Platform are named after the CMS (ie. only "Drupal" right now, excepted when we import existing sites, see below), its version (e.g. 5.14) and its status (e.g. "dev" or "prod"). If the platform is the default platform, it should have "(default)" in its title. An optional extra version can be added to follow module updates.

The platform name is used as the platform node title and the directory name. So for example, the default platform right now is named ''Drupal 6.11-prod (default)'' and the directory should be (but isn't, for historical reasons) drupal-6.11-prod (note that we omit the default).

Updating modules in a platform

You need to create a new platform every time you do an update on a prod platform module, as specified in the change policies. The new platform is basically a copy of the old platform, with one or a few modules updated.

Since you do not upgrade core, you will have conflicts in platform names, so this is where the optional extra version (mentionned above) comes in handy: you can use it to avoid conflicts with the previous versions. So say you are upgrading views on the 6.12 platform, but not the core (which is wise). You will create a new 6.12 platform named: "Drupal 6.12-1.0-prod". The next iteration, if necessary, will be 6.12-1.1.

When the new platform is created, you can start migrating sites to it. That will take care of running the update.php and changing all the required configuration in the backend.

So the general steps are as follows:

  1. create a new platform
  2. copy the modules from the old platform
  3. update the modules code
  4. migrate sites

Broken down into commands, that is:

  1. creating a new platform:
    drush dl drupal
    mv drupal-6.12 drupal

Adding modules to a platform

Adding modules is simpler