Why wouldn't you update from 4.6 to 5.0 easily?

I am that adventurous type to try to update weblabor.hu from Drupal 4.6 to Drupal 5.0 directly. This type of update is not recommended, because it is not ensured that everything will work fine. Unfortunately this time the direct update is not possible without some tweaking of the system.install files, but it seems to be doable.

The problem lies in the fact that Drupal 4.6 (and 4.7) supports only code defined node types, so there is a hook to ask modules about node types they define. That hook is called in two updates to fix variables and other changes in Drupal (between 4.6 and 4.7). For this to work correctly, one needs all modules he used in 4.6 (in 4.7) for the update script to query all node types.

A nice feature of Drupal 5 is that now it stores a cache of node types in the database, which is only refreshed when module changes are detected. Unfortunately this means that the update tries to pull the list of node types from the database before the node types or even the node type table is available in the database, so all you got are errors.

I thought about some fix for this update issue, because I have good memories of making Drupal capable of updating from 4.5 to 4.7 directly (that was for drupal.hu), for which I provided core patches, which got accepted, so everything was fine. But there is no way we can detect all possible node types in update time (since that would require those node type defining modules being set up which can only happen after the update). We could use a distinct list of node types available from the node table, but that would only cover updates for used node types, and not for all possible types.

It seems that your only possibility is to wire in the node type list used on the site, as returned by the old Drupal 4.6 setup (the node_list() function actually). By the way otherwise (putting aside some Hungarian collation related MySQL acknowledged bugs), the direct update from Drupal 4.6 to 5.0 works fine.

Add new comment