To recap: trying to upgrade a 4.6.1 site to 5.0:
Restore a recent backup of the live database as a new development database. (All of this is within PG 7.2.)
Install the 4.6.3 tarball in /var/lib/aolserver/openacs-4.6.3
Edit /var/lib/aolserver/openacs-4.6.3/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.1-4.6.2.sql to read:
-- DRB: Fix the incredibly slow execution of acs_privilege__add_child()
-- JA: to work around naming conflict that breaks this view drop/add:
drop view acs_privilege_descendant_map;
drop view acs_privilege_descendant_map_view;
create view acs_privilege_descendant_map_view
as select distinct h1.privilege, h2.child_privilege as descendant
from acs_privilege_hierarchy_index h1, acs_privilege_hierarchy_index h2
where h2.tree_sortkey between h1.tree_sortkey and tree_right(h1.tree_sortkey)
union
select privilege, privilege
from acs_privileges;
Manually run this upgrade file from psql - success! - thanks Jeff!
Manually run the 4.6.2-4.6.3 kerner upgrade file - success!
Start the web site using the partially upgrade database and 4.6.3 filesystem. Front page fails:
Request Error
Server startup failed: Error during bootstrapping
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
ERROR: Relation "acs_privilege_descendant_map" does not exist
Found that table in a/var/lib/aolserver/openacs-4.6.3/packages/acs-kernel/sql/postgresql/acs-permissions-create.sql, recreated it manually in psql:
aufrecht-dev=# create table acs_privilege_descendant_map (
privilege varchar(100) not null
constraint acs_priv_hier_priv_fk
references acs_privileges (privilege),
descendant varchar(100) not null
constraint acs_priv_hier_child_priv_fk
references acs_privileges (privilege)
);
aufrecht-dev(# aufrecht-dev(# aufrecht-dev(# aufrecht-dev(# aufrecht-dev(# aufrecht-dev(# aufrecht-d\
ev(# aufrecht-dev(# NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
CREATE
aufrecht-dev=# aufrecht-dev=#
Refreshed - no change, so restarted the site.
Front page fails with this error:
Request Error
Server startup failed: Error during bootstrapping
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
ERROR: Relation "acs_privilege_descendant_map" with OID 1305029 no longer exists