drupal

Maintaining/upgrading drupal installations with git

This is based on http://www.versioncontrolblog.com/2007/08/02/upgrading-drupal-52-with-git/

This is a work in progress/idea dump right now - any suggestions/improvements - please do leave a comment ;)

I have quite a few sites that are using drupal. I know I could go the route of a multisite install (I've done it before) - but I found that the requirement of upgrading all sites simultaneously was a bit too hard. However - upgrading everything by hand for each site is also poor.

Technical:

Drupal track module

The track module seems to have woken up ;)

Work on a 6.x version is progressing here: http://drupal.org/node/367448

And once that is up we may also get waypoints: http://drupal.org/node/135725

So - rather than working on a replacement of the geocaching module - perhaps track can take over.

Technical:

Mollom spam blocking

[img_assist|nid=370|title=Mollom stats|desc=click for full size|link=popup|align=right|width=200|height=98] This site (being a drupal site) uses mollom to prevent comment spam. This works extremely well - but looking at the latest graph I am intrigued as to who/what/why in november/december:

Using git for handling drupal contrib CVS

Using git for handling CVS checkouts for drupal contrib:

Details are on Maintaining a Drupal module using Git

For Mac OSX users you will need cvsps (fink install cvsps for example).

Useful alias for your .gitconfig:

drupalcontribcvs = !sh -c 'git cvsimport -p x -v -d:pserver:anonymous@cvs.drupal.org:/cvs/drupal-contrib contributions/modules/$0'

This allows you to call

git drupalcontribcvs <modulename>

Technical:

Logging in to drupal 5 using perl

Normally you can call the drupal cron page (/cron.php) as the anonymous user - but - to work around an issue with the simplenews module and taxonomy access control I need to run the cron script as a logged in user.

You need to do three things (for drupal 5 - I used to be able to start at step 2 for drupal 4).

  1. Grab the root page to get the PHPSESSID cookie
  2. Login to associate your cookie with a logged in session
  3. Call the script you want - in this case cron.php

Here's the script I ended up using

Protecting drupal update

An extra protection can be added to drupal update function by restricting which machines can access it.

Add this to the .htaccess

<FilesMatch "update.php">
Order deny,allow
Deny from all
Allow from 192.168.3.1
Allow from 192.168.3.*
Allow from .host.tld
Allow from hostname.host.tld
</FilesMatch>

Technical:

Drupal cron script

To avoid having to set up multiple cron lines - here's a script that will read your drupal install(s) and call cron on each one found.

Not sure where I saw the code (rss feed) - but the comment was present in the downloaded code - so thats a pointer to where it starts.

Changes I've made - the dir match is changed from ** to * so that it will follow symlinks. It also handles multiple drupal installs. Timeout wrapping added - one of my sites takes a long while to return.

Technical:

Upgrading drupal from 4.7 to 5.0

To upgrade a site from drupal 4.7 to 5.0:

I have several sites running drupal 4.7 that will want to be upgraded to 5.0 - here's how I'm thinking of approaching it. Mostly culled from a Lullabot video.

Prerequisites:

backups of site and db
all third party modules that a site is using are available

Process:

Technical:

drupal upgrade module status

Current status of modules for various drupal sites. Last updated 2007-01-07 apart from intern which was updated on 2007-02-05

Changes in CVS for some outstanding modules

  • disknode - nothing happening
  • print - CVS head - patch available
  • taxonomy_block - CVS head works under 5 - CVS tag for five simply missing
  • taxonomy_browser - nothing happening
  • vcard - nothing happening
  • onlinestatus - well - slow but some changes being made
  • signup - release nearly ready

intern.ochs.no

OK

Technical:

Drupal 5 - third party modules

Drupal 5 is now in beta. Not all the third party modules are converted yet.

Track here: http://drupal.org/node/82257

Technical:

Regenerating the access tables

After trying to run both Taxonomy Access and Simple Access - and finding that this didn't play well together (drupal 5 is supposed to be able to handle this better) the taxonomy access details were hosed. The actual taxonomies were hidden - but the nodes were displayed.

Thanks to help on the drupal forums - to rebuild this I had to:

  1. Disable taxonomy access (note - thats disable not uninstall)
  2. TRUNCATE node_access in the database
  3. Re-enable taxonomy access

This rebuilt the contents of the node access table and all started playing well together :

Technical:

Migration to drupal

For a long while this site has been running a combination of wordpress with embedded gallery2 (using the wpg2 plugin).

On wednesday the process of migrating it to drupal again with gallery2 embedded (using the gallery plugin) started - and it's gone surprisingly quickly.

Within a few days I expect to have the last changes made and the site moved over.

Things left to do

  • Do I like this theme or should I theme it myself?
  • Get the tinymce g2image plugin to work (generate the correct links)

Technical:

Subscribe to RSS - drupal