I thought I might document a few of the upgrade gotchas I encountered when upgrading from OpenACS 4.6.3 to 5.2.3. People may want to use some of the information here (maybe it is documented elsewhere?), and perhaps criticise some of the hacks I put in place to fix things. Some of the items I fix may be fixed in OpenACS 5.3.x (I stopped upgrading at OpenACS 5.2.3 as I am using Postgresql 7.4).
When upgrading, make backups of the db and filesystem as you reach significant points in the upgrade.
Take note of what software is required as you upgrade (AOLServer 4.0 and Postgres 7.2 will allow you to upgrade from OpenACS 4.6.3 to 5.2.3):
https://openacs.org/xowiki/openacs-compatibility-matrix
The upgrade from OpenACS 4.6.3 to 5.0.3 is reasonably well documented:
http://www.openacs.org/doc/current/upgrade-4.6.3-to-5.html
A couple of threads also help:
https://openacs.org/forums/message-view?message_id=152200
https://openacs.org/forums/message-view?message_id=201394
#I had to delete some duplicate files:
rm packages/acs-templating/tcl/0-procs.tcl
rm packages/acs-lang/tcl/lang-init.tcl
rm packages/acs-lang/tcl/lang-procs*
rm packages/acs-templating/resources/forms/standard-lars.adp
#I dropped no longer used file-related data :
psql -c "drop table apm_package_file_types"
#And update some kernel parameters to allow url posting:
Site-Wide Administration -> Kernel Parameters -> Antispam -> AllowedAttribute
Add href (to src and target)
After upgrading to OpenACS 5.0.3, templating upgrades had broke the appearance of some of the pages (comment/forum posting). In most cases this was fixed by my later upgrade to 5.2.3 (except for the Directory).
I then updated my OpenACS 5.0.3 sites to 5.2.3.
I installed the 5.2.3 updates from the OpenACS Repository. This was done by altering the install URL to allow me to install the kernel files: "acs-admin/install/install?repository".
Is there a standard way of upgrading OpenACS 5.n to 5.n+1 via the repository?
When upgrading the ACS Messaging to 5.2.3 I had problems with old acs_message_revisions that had parent_id=0, I manually altered that to parent_id=-4:
#The specific scripts reporting errors were packages/acs-messaging/sql/postgresql/upgrade/upgrade-5.1.0d1-5.1.0d2.sql and
#packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.1.0d2-5.1.0d3.sql
psql
update cr_items set parent_id=-4 where parent_id=0 and content_type='acs_message_revision' and storage_area_key ='CR_FILES';
\q
When upgrading the Content Repository to 5.2.3 I had problems with pre-existing functions.
#Try to upgrade content repository packages from remote files (it will fail)
#fix the problems in the files you have downloaded locally:
perl -pi -e "s/create function/create or replace function/g" packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.1.0d2*.sql
#Comment out includes from line 88 onwards:
vi packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.1.0d2-5.1.0d3.sql
#Upgrade content repository packages from locally downloaded files
After upgrading to OpenACS 5.2.3, I discovered that the upgraded general-comments module allowed anonymous posting (I saw 1600 automated spam posts). To fix this I altered the comment-add.tcl files to require login:
#add "set user_id [auth::require_login]" to the top of the contract function:
vi packages/general-comments/www/comment-add.tcl
vi packages/general-comments/www/comment-add-2.tcl
vi packages/general-comments/www/comment-add-3.tcl
In the upgraded forum module I also found that older forum posts weren't listing authors. I fixed this with some SQL:
psql
update forums_messages set last_poster=user_id where last_poster is null and parent_id is null and posting_date =last_child_post;
\q
The upgraded directory had problems with templating on the index page. I added ";noquote" after search_vars, alpha_nav_bar, row_range_html, name_header
vi packages/directory/www/index.adp
Hopefully this will help someone, or inform me as to how I _should_ have performed the upgrade.