Forum OpenACS Development: Experiences with Upgrading OpenACS from 5.4 to 5.8

Collapse
Posted by Michael Aram on
Dear Agustín,

some weeks ago, I have upgraded an outdated OpenACS instance to the latest and greatest versions; these are my notes. The starting point was an OpenACS instance with mixed version numbers, but most core packages were actually very close to 5.4.3. It was running under Ubuntu 10.04 and Postgres 8.2, using Tcl 8.5.11 and NaviServer 4.99.4.

Based on the information in the wiki, the plan was to upgrade to OpenACS 5.5.1, then switch to PG8.4, then proceed to OpenACS 5.8 and finally to Postgres 9.3.

OpenACS ~5.4.* to 5.5

I did a careful inspection of differences between the actual code, and upstream code. In order to stay on top of things, I upgraded the packages one by one, even the core packages, and all non-proprietary packages (e.g. assessment, categories, …). Eventually everything worked very well.

Postgres 8.2 to 8.4

Dumping and restoring the database between PG8.2 and PG8.4 did work, too. However, one cannot use the flags „stop on error“ or „single transaction“, because of tsearch2, which will throw errors, as documented here.

OpenACS 5.5 to 5.8

Trying to upgrade from OpenACS 5.5 to 5.8 gave me some smaller trouble:

  • First, I stumbled across a bug, which is fixed now - just make sure you have the newest version of the file /packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.7.0d3-5.7.0d4.sql.
  • Starting the server with the 5.5 code, then replacing the core packages with the new 5.8 code does not work, in particular because the new acs-admin package installer web files (sourced on each request) will already require the new "package embedding“ to be there. Hence, one should start up the server with the new 5.8 code. This may lead to (ignorable) errors, as XOTcl-Core is not prioritized „hardcoded" in the load order any more - the new APM recognizes package dependencies, but not at this point in time (new code, but not yet upgraded)
  • Developer support must be upgraded at the same time, as the new core seems to need a new developer support version as well. (invalid command name ::ds_profiling_enabled_p)
  • If you want to stick to NaviServer 4.99.4d, you will encounter errors when upgrading to 5.8 as this code expects the command ns_driversection to be provided by NaviServer already, which is not the case in this version. Hence, strictly speaking, OpenACS 5.8 requires NaviServer 4.99.5 (although this command is defined on the Tcl level and might be added ex post easily.) I have updated the compatibility matrix. Hence, you have to hack /packages/acs-tcl/tcl/security-procs.tcl accordingly. Probably, there, we should not check for „NaviServer“, but for the availability of the proc.
  • If you encounter 'can't read "::acs::rootdir": no such variable‘, be sure to update the files in /tcl as well.
  • There are queries in packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.8.0d2-5.8.0d3.sql (3 times "delete from cr_item_publish_audit") which run incredibly long on bigger systems and are not necessary „per se“, but should only ensure that the foreign keys can be created later. On larger systems like ours, where these queries can take many many hours, its better to deactivate them and see, if the FKs can be created without them.

Upgrading to NaviServer 4.99.6 with XOTcl 2.0

  • There were a couple of warnings which are now fixed in CVS.
  • Previously, parameter value checking for „integer“ was Tcl-"string is"-based and was not „strict“, i.e. the empty string was allowed. Now the default behavior is „strict“, i.e. to allow the empty string as well, one has to add the multiplicity 0..1, e.g. {-item_id:integer,0..1 "“}.
  • Previously, CrAttribute Slots defined as „required“ were not required upon object instantiation; this is now the case.

Postgres 8.4 to 9.3

Unfortunately, I have no notes with respect to this upgrade. But AFAIR, there were no issues with this...

I hope, some of this helps for doing your upgrade... All the best...