Forum OpenACS Development: OpenACS 5.0 Upgrade Experiences

Collapse
Posted by Dave Bauer on
The 4.6.3-5.0 upgrade requires not only manual loading of SQL files, but also execution of Tcl after-install callbacks to allow an administrator to login to complete the upgrade process.

Manual upgrade of:

acs-kernel datamodel
acs-service-contract datamodel

Manual loading of:
acs-authentication datamodel
acs-lang datamodel

In addition acs-land and acs-authenication packages need to be installed and enabled, and acs-lang needs to be mounted for admins to login.

It looks like some code somewhere will need to perform these steps. Any suggestions?

Collapse
Posted by Dave Bauer on
I added this code to a new file zzz-postload under openacs/tcl
if ![apm_package_installed_p acs-lang] {

    apm_package_install -enable -mount_path acs-lang [acs_root_dir]/packages/acs-lang/acs-lang.info

}


if ![apm_package_installed_p acs-authentication] {

    apm_package_install -enable [acs_root_dir]/packages/acs-authentication/acs-authentication.info

}
I think this works ok for an upgrade, but i am not sure how it will interact on a new install of 5.0.
Collapse
Posted by Don Baccus on
First a coding style issue :)  You should always curly-bracket your conditional expressions because otherwise the byte-code isn't saved and the expression is recompiled every time the code's run. (Well, it doesn't matter in this case but ... :)

Upgrading the acs-kernel datamodel by hand won't update the APM version number, will it?  If that's in the script then I bet I can say that it won't be updating the APM version number for acs-bootstrap-installer ... can't you just check that?  The user's going to have to visit the APM to get the version number updated, no, even though there are no upgrade datatmodel files?

Or am I all wet ...

Collapse
Posted by Dave Bauer on
Hmmm, the one time I save 4 keystrokes....

I think you are correct. The package version isn't updated unless you install through the APM. I'll do a test and see how that works.

Yes, the user will have to upgrade those packages through the apm and uncheck the datamodel files.

Collapse
Posted by Joel Aufrecht on
I am attempting to upgrade aufrecht.org to 5.0. My steps are as follows (with dead ends omitted):
  1. Inspect the live system by going to /acs-admin/apm, and discover that the kernel is 4.6.1.
  2. Make a copy of the live database (postgresql), which is PostGreSQL 7.2
  3. On a development machine, run pg_7.2to7.3_upgrade_helper.pl on the dmp file.
  4. Restore the dmp file to a PostGreSQL 7.3.4 database.
  5. Download the OpenACS 4.6.3 tarball and unpack it
  6. tweak the config.tcl file to have correct values
  7. Start aolserver using the 4.6.3 tarball as the homedir and the restored database as the db
  8. Go to the APM and click Install
  9. Select only the kernel for Upgrade. Select both sql/postgresql/upgrade/upgrade-4.6.1-4.6.2.sql sql/postgresql/upgrade/upgrade-4.6.2-4.6.3.sql
  10. Failed to install ACS Kernel, version 4.6.3. The following error was generated:
              Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.") ERROR: pg_atoi: zero-length string SQL: select apm_package_version__new( NULL, 'acs-kernel', '4.6.3', 'https://openacs.org/repository/download/apm/acs-kernel-4.6.3.apm', 'Routines and data models providing the foundation for OpenACS-based Web services.', NULL, NULL, '2002-10-27', 'OpenACS', 'https://openacs.org/', 't', 't' );
    
Collapse
Posted by Dave Bauer on
You need to fix any upgrade scripts that you run to make sure any plpgsql function definitions say "timestamptz" instead of timestamp.

This is only if you are upgrading from a version that did not support postgresql 7.3 to a versison that does support 7.3. Basically any pre-4.6.3 version to any version 4.6.3 or later.

Collapse
Posted by Joel Aufrecht on
I realized that my original plan was doomed, because you can't run OpenACS 4.6.1 on PostgreSQL 7.3.  In other words, if you want to upgrade from OpenACS 4.6.1/Pg 7.2, you have to upgrade OpenACS to pg 4.6.3, and then upgrade the postgres database to 7.3, and then switch to using postgres 7.3 to run the upgraded database, all in that order.  You cannot upgrade from 4.6.1/pg 7.2 to 4.6.3/7.3 via 4.6.1/pg 7.3, because that combination is not valid.

So:
1) Inspect the live system by going to /acs-admin/apm, and discover that the kernel is 4.6.1.
2) Make a copy of the live database (postgresql), which is PostGreSQL 7.2
3) On a development machine, restore the dmp file of the production db
4) Download the OpenACS 4.6.3 tarball and unpack it
5) Start aolserver using the 4.6.3 tarball as the homedir and the restored database as the db (still 7.2!)
6) Go to the APM and click Install
7) Select only the kernel for Upgrade.  Select both
      sql/postgresql/upgrade/upgrade-4.6.1-4.6.2.sql
    sql/postgresql/upgrade/upgrade-4.6.2-4.6.3.sql
8)      Failed to install ACS Kernel, version 4.6.3. The following error was generated:

Installed ACS Kernel, version 4.6.3.

# Installing data model for ACS Kernel 4.6.3...

    * Loading data model /var/lib/aolserver/openacs-4.6.3/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.1-4.6.2.sql...

CREATE
COMMENT
COMMENT
COMMENT
ALTER
UPDATE 47
COMMENT
DROP
DROP
CREATE
CREATE
CREATE
CREATE
CREATE
CREATE
DROP
DROP
CREATE
CREATE
DROP
DROP
CREATE
CREATE
DROP
DROP
CREATE
CREATE
HTTP/1.0 200 OK
Server: AOLserver/3.3.1+ad13
Content-Type: text/html; charset=iso-8859-1
MIME-Version: 1.0
Date: Sat, 13 Dec 2003 19:46:41 GMT
Content-Length: 3211
Connection: close






          Request Error

psql:upgrade-4.6.1-4.6.2.sql:237: ERROR:  view "acs_privilege_descendant_map_view" does not exist
psql:upgrade-4.6.1-4.6.2.sql:244: ERROR:  Attempt to insert rule "_RETacs_privilege_descendant_ma" failed: already exists

Collapse
Posted by Don Baccus on
Well, that's very bizarre.  It is failing while dropping the old version of that view then fails when it tries to create the new one because ... the underlying rule already exists.

Very bizarre.

Before running the upgrade script (on a new restore of the dump of course) could you see what happens if you try selecting from the view?

There are problems going to PG 7.2->PG 7.3 if you use the default limits on identifier length because the PG group bumped it from 32 to 64.  About time, but it means they can't guarantee a dump from 7.2 will reload correctly into 7.3.  But that's not the problem you're seeing (there are some threads for getting around that problem when you get that far).

Hmmm ... did you check the output of the dump?  Are you sure there were no errors when the view was created on the restore?  It sure looks like the underlying rule was created but the view itself was not.

Collapse
Posted by Joel Aufrecht on
My steps this time:
  1. Inspect the current, live database:
    select * from acs_privilege_descendant_map_view;
    ERROR:  Relation "acs_privilege_descendant_map_view" does not exist
    
    \dv  acs_privilege_descendant_map_view
    No matching relations found.
    \dv acs_privilege_descendant_map_view
    No matching relations found
    
    drop rule _RETacs_privilege_descendant_ma;
    ERROR:  Rule or view "_retacs_privilege_descendant_ma" not found
    
  2. Restore a recent backup of the live database as a new development database. (All of this is within PG 7.2.)
  3. connect to the new dev database via psql
  4. Manually run the commands in /packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.1-4.6.2.sql via cut-paste. Everything works until
    drop view acs_privilege_descendant_map_view;
    NOTICE:  identifier "acs_privilege_descendant_map_view" will be truncated to "acs_privilege_descendant_map_view"
    ERROR:  view "acs_privilege_descendant_map_view" does not exist
    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;
    NOTICE:  identifier "acs_privilege_descendant_map_view" will be truncated to "acs_privilege_descendant_map_view"
    ERROR:  Attempt to insert rule "_RETacs_privilege_descendant_ma" failed: already exists
    
    select * from acs_privilege_descendant_map_view;
    NOTICE:  identifier "acs_privilege_descendant_map_view" will be truncated to "acs_privilege_descendant_map_view"
    ERROR:  Relation "acs_privilege_descendant_map_view" does not exist
    
Collapse
Posted by Jeff Davis on
Joel, I suspect the acs_privilege_descendant_map view needs to be dropped as well (I think the problem is that the end result is to have acs_privilege_descendant_map as a table and acs_privilege_descendant_map_view fails to create since the truncated name collides with one on the original view).
Collapse
Posted by Joel Aufrecht on
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
  • Collapse
    Posted by Jeff Davis on
    Joel, I looked at where acs_privilege_descendant_map gets turned into a table (instead of a view), its in upgrade-4.6-4.6.1.sql so I think you somehow missed that update which might explain why this is not working...
    Collapse
    Posted by Joel Aufrecht on
    New starting assumption: my database thinks it holds acs-kernel 4.6.1 but it is actually 4.6.
    1. Restore a recent backup of the live database as a new development database. (All of this is within PG 7.2.)
    2. Install the 4.6.3 tarball in /var/lib/aolserver/openacs-4.6.3
    3. Run /packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6-4.6.1.sql via psql
    4. Start the server, using the 4.6.3 tarball file tree and database-in-progress
    5. (Site home page loads okay!) Go to the APM and click Install
    6. Select only the kernel for Upgrade. Select both sql/postgresql/upgrade/upgrade-4.6.1-4.6.2.sql sql/postgresql/upgrade/upgrade-4.6.2-4.6.3.sql
    7. both scripts are run without errors. restart server.
    8. Site loads. At this point I have the choice of upgrading my other packages, upgrading the database to 7.3, or upgrading the kernel to 5.0. I back up the database.
    9. I decided to upgrade to PG 7.3 first, but the upgrade script failed with a bunch of errors like:
      ==================================================================
      looking for function party_approved_member__remove_o in oacs
      grep result:
      WARNING: unable to find the real function name of party_approved_member__remove_o
      so I moved on to upgrading the other packages instead. Several packages upgraded cleanly but Edit This page failed with:
      psql:upgrade-1.1d-1.2.sql:195: ERROR:  Cannot insert a duplicate key into unique index acs_object_types_pk
    Collapse
    Posted by Caroline Meeks on
    Here are my results so far. My problem seems to be in acs-lang.  The log file is showing error messages for queries but when I try the same query in psql it runs fine.

    Steps

    1.Inspect at acs-admin/apm found acs-kernal to be version 4.6.2
    2.made a dump of the database
    3.Upgraded the code for acs-kernal to 4.6.3
    4.upgraded the kernal from the apm
    5.made a dump of the database
    6.loaded the dump into pg 7.3 – I did not need to run the upgrade_helper script because my hosting provider (zill.net) has set the 7.2 character limit to 64 so it did not truncate the function names.
    7.Sanity check the import by looking at number of users or objects
    8.Made a copy of the code
    9.Used this cvs command to get the code cvs -z3 -d :pserver:mailto:anonymous@openacs.org:/cvsroot co -r oacs-5-0 acs-core
    My 5.0 code is now in the directory /home/aristoi/openacs-4
    10.$cd openacs-4/packages/acs-kernel/sql/postgresql/
    11.psql -f postgresql.sql – This generated a lot of already exist errors and some create functions
    12.cd upgrade/
    13. psql -f upgrade-4.6.3-4.6.4.sql
    14.psql -f upgrade-4.6.4-4.6.5.sql
    15.psql -f upgrade-4.6.5-4.6.6.sql
    16.psql -f upgrade-4.6-4.6.1.sql  - This was a mistake I am already at 4.6.3
    17.psql -f upgrade-4.7d-4.7.2d.sql
    18.psql -f upgrade-4.7.2d-5.0d.sql
    19.psql -f upgrade-5.0d-5.0d2.sql
    20.psql -f upgrade-5.0d2-5.0d3.sql
    21. psql -f upgrade-5.0d6-5.0d7.sql
    22.psql -f upgrade-5.0d7-5.0d9.sql
    psql:upgrade-5.0d7-5.0d9.sql:12: NOTICE:  rule _RETURN on view apm_file_info depends on table apm_package_files
    psql:upgrade-5.0d7-5.0d9.sql:12: NOTICE:  view apm_file_info depends on rule _RETURN on view apm_file_info
    psql:upgrade-5.0d7-5.0d9.sql:12: ERROR:  Cannot drop table apm_package_files because other objects depend on it
    24)psql -f upgrade-5.0d11-5.0d12.sql
    25)psql -f upgrade-5.0.0a4-5.0.0a5.sql
    26)psql -f upgrade-5.0.0b1-5.0.0b2.sql
    27)psql -f upgrade-5.0.0b2-5.0.0b3.sql
    28)psql -f upgrade-5.0.0b3-5.0.0b4.sql
    psql:upgrade-5.0.0b3-5.0.0b4.sql:788: ERROR:  Cannot change number of columns in view
    psql:upgrade-5.0.0b3-5.0.0b4.sql:802: ERROR:  Cannot change number of columns in view
    29) cd ~/openacs-4/packages/acs-service-contract/sql/postgresql/upgrade/
    30)psql -f upgrade-4.7d2-4.7d3.sql
    31)cd ~/openacs-4/packages/acs-authentication/sql/postgresq
    32)psql -f acs-authentication-create.sql
    33) cd ~/openacs-4/packages/acs-lang/sql/postgresql/
    34) psql -f acs-lang-create.sql
    BEGIN
    psql:ad-locales.sql:44: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'ad_locale_abbrev_pk' for table 'ad_locales'
    psql:ad-locales.sql:44: NOTICE:  CREATE TABLE / UNIQUE will create implicit index 'ad_locale_name_unq' for table 'ad_locales'
    psql:ad-locales.sql:44: ERROR:  Relation 'ad_locales' already exists
    psql:ad-locales.sql:56: ERROR:  current transaction is aborted, queries ignored until end of transaction block
    psql:ad-locales.sql:60: ERROR:  current transaction is aborted, queries
    many more of theseLooking in my dump file I see that yes ad_locals does exist so I probably installed it at some point. I will try running the upgrade scripts.
    33)cd upgrade/
    34)psql -f upgrade-4.1-4.7d2.sql
    35)psql -f upgrade-4.7d2-4.7d3.sql psql -f upgrade-4.7d2-4.7d3.sql
    36)psql -f upgrade-4.7d3-4.7d4.sql
    37)psql -f upgrade-4.7d4-4.7d5.sql
    38)psql -f upgrade-4.7d6-4.7d7.sql
    psql:upgrade-4.7d6-4.7d7.sql:3: ERROR:  Cannot drop table ad_locales because other objects depend on it
          Use DROP ... CASCADE to drop the dependent objects too
    psql:upgrade-4.7d6-4.7d7.sql:28: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'ad_locale_abbrev_pk' for table 'ad_locales'
    psql:upgrade-4.7d6-4.7d7.sql:28: NOTICE:  CREATE TABLE / UNIQUE will create implicit index 'ad_locale_name_unq for table 'ad_locales'
    psql:upgrade-4.7d6-4.7d7.sql:28: ERROR:  Relation 'ad_locales' already exists
    psql:upgrade-4.7d6-4.7d7.sql:29: ERROR:  Cannot insert a duplicate key into unique index ad_locale_name_unq
    DROP TABLE
    39)psql -f upgrade-4.7d7-4.7d8.sql
    Same errors as 4.7d6 to d7 above
    40)psql -f upgrade-4.7d8-4.7d9.sql
    41)psql -f upgrade-4.7d9-5.0d1.sql
    42) created zzz-postload.tcl according to Dave;s instructions here. https://openacs.org/projects/openacs/5.0/upgrade-463-50

    43)Added ns_param  tdom                ${bindir}/tdom.so to the ns_section "ns/server/${
    44)Restarted server
    45)error on trying to show a page
    Error: tclop: invalid return code from filter proc 'invalid command name "parameter::get"': must be filter_ok, filter_return, or filter_break
    Error durring load is
    13/Dec/2003:22:56:11][18708.1024][-main-] Debug: PgBindCmd: sql =
          select locale
        from  ad_locales
            where  enabled_p = 't'

    [13/Dec/2003:22:56:11][18708.1024][-main-] Error: Ns_PgExec: result status: 7 message: ERROR:  Attribute 'enabled_p' not found

    [13/Dec/2003:22:56:11][18708.1024][-main-] Error: Error sourcing /home/aristoi/openacs-4/packages/acs-templating/tcl/acs-templating-init.tcl:
    Database operation "select" failed (exception NSDB, "Query was not a statement returning rows.")
    But when I try the query in psql it works fine.

    Collapse
    Posted by Joel Aufrecht on
    Figured out why the upgrade script stopped working - I left out an argument to the script.
    Collapse
    Posted by Don Baccus on
    Did you upgrade from 4.6 to an interim 4.6.1 development release, an alpha or beta perhaps?  That would explain why the APM thought you were at 4.6.1 even though you didn't have all the changes in your instance ...
    Collapse
    Posted by Caroline Meeks on
    I found my previous problem. PGHOST was not set correctly and it was still pointing to my old database.

    Now my issue is here:

    [14/Dec/2003:22:58:18][12594.1024][-main-] Debug: PgBindCmd: query with bind variables sub\
    stituted =

          select apm_package__new(
            NULL,
            'Authentication',
            'acs-authentication',
            'apm_package',
            now(),
            null,
            null,
            NULL
          );

    WARNING:  Error occurred while executing PL/pgSQL function apm_package__singleton_p
    WARNING:  line 5 at select into variables
    [14/Dec/2003:22:58:18][12594.1024][-main-] Error: Ns_PgExec: result status: 7 message: ERR\
    OR:  pg_atoi: error in "t": can't parse "t"

    Collapse
    Posted by Caroline Meeks on
    Ok I fixed that problem by running  upgrade-5.0.0b3-5.0.0b4.sql. I must have missed it.

    Next problem is when I go to look at acs-admin it tries to log me in. From register/index e its doing the select_authority query with authority_id = NULL so the error is:

    Query did not return any rows.
        while executing
    "db_1row select_authority "
            select    [join $columns ",\n                  "]
            from      auth_authorities
            where      authorit..."

    Collapse
    Posted by Jeff Davis on
    Caroline, the apm_package__singleton_p proc was wrong in the upgrade script, I updated the upgrade-5.0.0b3-5.0.0b4.sql to fix it (I had already fixed the create script) so you might want to replace it with a correct one or suffer the consequences down the road :)

    Also, I applied a couple patches to the upgrade scripts so anyone trying to work through upgrading might want to do a cvs update...

    Collapse
    Posted by Dave Bauer on
    ETP page in progress to attempt to document the upgrade process:

    https://openacs.org/projects/openacs/5.0/upgrade-463-50

    Collapse
    Posted by Robert Gaszewski on

    In my case I had to import acs-lang messages for locale en_US so my openacs-5/tcl/ zzz-postload.tcl contains:

    if {![apm_package_installed_p acs-lang]} {
        apm_package_install -enable -mount_path acs-lang [acs_root_dir]/packages/acs-lang/acs-lang.info
        lang::catalog::import -locales [list "en_US"]
    }
    
    if {![apm_package_installed_p acs-authentication]} {
        apm_package_install -enable [acs_root_dir]/packages/acs-authentication/acs-authentication.info
        apm_parameter_register "UsePasswordWidgetForUsername" \
         "Should we hide what the user types in the username
          field, the way we do with the password field? Set
          this to 1 if you are us ing sensitive information
          such as social security number for username." \
         acs-kernel 0 number \
         security 1 1
        parameter::set_value -package_id [ad_acs_kernel_id] -parameter UsePasswordWidgetForUsername -value 0
    }
    
    Collapse
    Posted by Dave Bauer on
    It seems that authority_id and username need to be set for upgrades.

    Where should these queries go?

    Collapse
    Posted by Dave Bauer on
    Nevermind that, its in acs-kernel, upgrade-5.0d2-5.0d3.sql.
    Collapse
    Posted by Caroline Meeks on
    I've been working through problems that seem to stem from that fact that acs-lang was installed on my old site and doesn't upgrade cleanly. I had to force it to mount. Now that I have it mounted I am getting the following error at acs-lang/admin

    Request Error
    expected integer but got "MESSAGE"
        while executing
    "string repeat $num_re $group"
        (procedure "lc_sepfmt" line 13)
        invoked from within
    "lc_sepfmt $out $grouping $sep"
        (procedure "lc_numeric" line 20)
        invoked from within
    "lc_numeric $num $fmt en_US"
        (procedure "lc_numeric" line 15)
        invoked from within
    "lc_numeric $num_translated"
        invoked from within
    "set num_translated_pretty [lc_numeric $num_translated]"
        ("uplevel" body line 10)
        invoked from within
    "uplevel 1 $code_block "

    Any ideas?

    Collapse
    Posted by Robert Gaszewski on

    Caroline,
    looks your acs-lang message catalog isn't imported properly.
    Try create file foo.tcl with one line:

    lang::catalog::import -locales [list "en_US"]

    and put in under openacs-5/www directory.

    Next go to address http://yourserver.com/foo and it should import missing messages.
    I had the same problem, as you and this is a reason I put line

    lang::catalog::import -locales [list "en_US"]
    into Dave's zzz-postload.tcl file

    Collapse
    Posted by Caroline Meeks on
    Thanks Robert,

    I had seen your earlier post and put it in my zzz file but missed the error it threw.  When I put it into its own tcl file I was able to track down the problem.

    I had thought I had dropped acs-lang and recreated it but due to a bug in the message-catalog-drop.sql I hadn't deleted and recreated the lang_messages table.  It looks great now.

    I submitted a bug report on message-catalog-drop.

    Collapse
    Posted by Jeff Davis on
    Bug 1294 looks like it might be pretty ugly to fix.

    Basic summary is that you don't seem to be able to manipulate named constraints on a db migrated from 7.2 which means a number of the upgrade scripts will fail.

    The right answer would seem to be to put properly named constraints in place but that might be pretty hard to do. Fortunately I am leaving on vacation and can't help :)

    Collapse
    Posted by Joel Aufrecht on
    Progress report: I have upgraded a 4.6.0 database to 4.6.3 and from PG 7.2 to 7.3, apparently successfully.  I am now trying to upgrade to 5.0, following Caroline's path in this thread.
    1) It's fairly unpleasant to have to run each of the ~20 upgrade files manually.  How will we know when this is stable enough to run automatically from the APM?

    2) What is the correct order of upgrade scripts to run for 4.6.3 to 5.0?  Do we need any of the 4.6.4 through 4.7 files?

    upgrade-4.2-4.5.sql
    upgrade-4.5.1-4.5.2.sql
    upgrade-4.5.1-4.6.sql
    upgrade-4.5-4.5.1.sql
    upgrade-4.6.1-4.6.2.sql
    upgrade-4.6.1-4.7d.sql
    upgrade-4.6.2-4.6.3.sql
    upgrade-4.6.3-4.6.4.sql
    upgrade-4.6.4-4.6.5.sql
    upgrade-4.6-4.6.1.sql
    upgrade-4.6.5-4.6.6.sql
    upgrade-4.7.2d-5.0d.sql
    upgrade-4.7d-4.7.2d.sql
    upgrade-5.0.0a4-5.0.0a5.sql
    upgrade-5.0.0b1-5.0.0b2.sql
    upgrade-5.0.0b2-5.0.0b3.sql
    upgrade-5.0.0b3-5.0.0b4.sql
    upgrade-5.0d11-5.0d12.sql
    upgrade-5.0d2-5.0d3.sql
    upgrade-5.0d-5.0d2.sql
    upgrade-5.0d6-5.0d7.sql
    upgrade-5.0d7-5.0d9.sql

    3) I ran

    psql -f upgrade-4.6.3-4.6.4.sql
    psql -f upgrade-4.6.4-4.6.5.sql
    psql -f upgrade-4.6.5-4.6.6.sql

    The first two worked fine but the third hung until I hit control-c:

    psql -f upgrade-4.6.5-4.6.6.sql aufrecht-dev
    UPDATE 1
    psql:upgrade-4.6.5-4.6.6.sql:11: ERROR:  users_user_id_fk referential integrity violation - key referenced from users not found in persons

    Cancel request sent
    psql:upgrade-4.6.5-4.6.6.sql:12: WARNING:  Error occurred while executing PL/pgSQL function acs_objects_context_id_up_tr
    psql:upgrade-4.6.5-4.6.6.sql:12: WARNING:  line 11 at SQL statement
    psql:upgrade-4.6.5-4.6.6.sql:12: ERROR:  Query was cancelled.

    Collapse
    Posted by Lars Pind on
    Re the 4.6.>4 / 4.7.* upgrade scripts:

    These version numbers are not directly related to releases. For example, I'm not certain that the 4.6.3 release actually has an acs-kernel version 4.6.3, it might have been 4.6.4 or 4.6.5.

    As for the 4.7 series, this was the original name HEAD, until we decided to rename it 5.0 instead, so yes, I'm pretty sure you need all of those as well.

    Of course, thanks to branches, there's no obvious way to tell what the order should be for the 4.6.* and 4.7.* upgrade scripts, or whether they're all needed. We'll have to manually inspect each one of them. And cvs.openacs.org is currently down.

    /Lars

    Collapse
    Posted by Joel Aufrecht on
    People who have successfully upgraded: exactly which order of acs-kernel upgrade scripts did you use?
    Collapse
    Posted by Vinod Kurup on
    These are the calls I ran (verbatim).
    cd
    pg_dump kurup > mydb.dmp
    dropdb dev-kurup
    createdb dev-kurup
    psql -f mydb.dmp dev-kurup
    cd web/dev-kurup/packages/acs-kernel/sql/postgresql/upgrade/
    psql dev-kurup < upgrade-4.6.4-4.6.5.sql 
    psql dev-kurup < upgrade-4.6.5-4.6.6.sql 
    psql dev-kurup < upgrade-4.7d-4.7.2d.sql 
    psql dev-kurup < upgrade-4.7.2d-5.0d.sql 
    psql dev-kurup < upgrade-5.0d-5.0d2.sql 
    psql dev-kurup < upgrade-5.0d2-5.0d3.sql 
    psql dev-kurup < upgrade-5.0d6-5.0d7.sql 
    psql dev-kurup < upgrade-5.0d7-5.0d9.sql 
    psql dev-kurup < upgrade-5.0d11-5.0d12.sql 
    psql dev-kurup < upgrade-5.0.0a4-5.0.0a5.sql 
    psql dev-kurup < upgrade-5.0.0b1-5.0.0b2.sql 
    psql dev-kurup < upgrade-5.0.0b2-5.0.0b3.sql 
    psql dev-kurup < upgrade-5.0.0b3-5.0.0b4.sql 
    cd ../../../../acs-service-contract/sql/postgresql/upgrade/
    psql dev-kurup < upgrade-4.7d2-4.7d3.sql 
    cd ../../../../acs-authentication/sql/postgresql/
    psql dev-kurup < acs-authentication-create.sql 
    cd ../../../acs-lang/sql/postgresql/
    psql dev-kurup < acs-lang-create.sql 
    dev-kurup-start.sh
    
    Collapse
    Posted by Joel Aufrecht on
    Did you run upgrade-4.6.3-4.6.4.sql?

    My upgrade is currently failing on the second command in, upgrade-4.6.4-4.6.5.sql:

    insert into users (user_id) values (0);
    ERROR:  users_user_id_fk referential integrity violation - key referenced from users not found in persons
    aufrecht-dev=# select * from users where user_id=0;
     user_id | password | salt | screen_name | priv_name | priv_email | email_verified_p | email_bouncing_p | no_alerts_until | last_visit | second_to_last_visit | n_sessions | password_question | password_answer | password_changed_date 
    ---------+----------+------+-------------+-----------+------------+------------------+------------------+-----------------+------------+----------------------+------------+-------------------+-----------------+-----------------------
    (0 rows)
    
    aufrecht-dev=# select * from persons where person_id=0;
     person_id | first_names | last_name 
    -----------+-------------+-----------
    (0 rows)
    
    aufrecht-dev=# insert into persons values (0,'Unregistered','Visitor');
    ERROR:  persons_person_id_fk referential integrity violation - key referenced from persons not found in parties
    aufrecht-dev=# 
    
    At this point it looks like some of the stuff in upgrade-4.6-4.6.1.sql didn't get run on my database, so I guess I'll start over at that point and watch more closely.
    Collapse
    Posted by Vinod Kurup on
    My site was already around 4.6.4, so I didn't run the 4.6.3-4.6.4 upgrade script.

    I just loaded up my before-upgrade DB and got this:

    testkurup=# select * from persons where person_id=0;
     person_id | first_names  | last_name
    -----------+--------------+-----------
             0 | Unregistered | Visitor
    (1 row)
     
    testkurup=# select * from parties where party_id=0;
     party_id | email | url
    ----------+-------+-----
            0 |       |
    (1 row)
    
    So, I think you're right - you need to start around 4.6-4.6.1 where the party with party_id 0 gets created.
    Collapse
    Posted by Vinod Kurup on
    Just found a problem with the upgrade. apm_package_version__delete and apm_package_version__copy were changed around 5.0d9, but the changes didn't get into an upgrade script. I've committed the changes to the upgrade script on the 5.0 branch, but if you've already upgraded, you need to 'create or replace' those 2 functions.
    Collapse
    Posted by Vinod Kurup on
    Another problem: ref_timezones is now required by acs_lang, but didn't get installed on my system, so this bug shows up. acs_lang gets installed in the special zzz-postload.tcl script:
    if {![apm_package_installed_p acs-lang]} {
    
        apm_package_install -enable -mount_path acs-lang [acs_root_dir]/packages/acs-lang/acs-lang.info
     
        lang::catalog::import -locales [list "en_US"]
    
    }
    
    But apparently, apm_package_install doesn't automatically resolve dependencies, so ref-timezones (and acs-reference) never got installed. Should we add 2 more checks to zzz-postload.tcl, checking for and installing acs-reference and ref-timezones if needed? or is there a better way to automatically install required dependencies?
    Collapse
    Posted by Vinod Kurup on
    Sorry to flood this thread, but found another one. Running the auth_driver_get_param_values test (in acs-authentication) fails with this error:
    ERROR:  duplicate key violates unique constraint "auth_driver_params_authority_id_key"
     
    SQL:             
                insert into auth_driver_params (authority_id, impl_id, key, value)
                values ('12797', '12891', 'SnapshotURL', '0639DC91D')
    
    My auth_driver_params table has a unique constraint on (authority_id, impl_id) whereas the version in 5.0 has a pk constraint on (authority_id, impl_id, key). The change is here. I only discovered this error by running the automated test - the system works fine otherwise.

    I think this change happened between 5.0d4 and 5.0d5, but there's no upgrade script with that name. Here's the change that needs to be made:

    alter table auth_driver_params drop constraint auth_driver_params_authority_id_key;
    alter table auth_driver_params add constraint auth_driver_params_pk primary key (authority_id,impl_id,key)
    
    Is it OK for me to create an upgrade-5.0d4-5.0d5 script?
    Collapse
    Posted by Andrei Popov on
    In my upgrade experience, several upgrade scripts generated errors, but none seemed to be too dangerous -- mostly either attempts to add already existing columns, or to insert duplicate keys.
    Collapse
    Posted by Don Baccus on
    party_id 0 got created with the "fast permissions" changes, whichever version introduced them, and those upgrade scripts were run by a bunch of people so, yes, I think Joel must've missed a step at some point ...

    Better make sure all the new perms stuff gets run on your site because otherwise you'll break the permissions system.

    Collapse
    Posted by Don Baccus on
    Sure, create the script ...
    Collapse
    Posted by Vinod Kurup on
    Done. I named the upgrade script 5.0.0a1-5.0.0a2 since there was an oracle upgrade script with that name that had the same changes. I also noticed that there was an upgrade script for oracle which reloaded the apm_package_version__delete and apm_package_version__copy scripts. So the only remaining issue is to make sure that acs-reference and ref-timezones get installed. This isn't a crucial issue, at least not as crucial as making sure that acs-lang and acs-auth get loaded, so I think we can just add a note to DaveB's document to load ref-timezones (which requires acs-reference).
    Collapse
    Posted by Hazi Gharagozlou on
    While upgrading a 4.6.3 oracle site to 5.0b4 I found the following ordre of upgrade scripts work best.
    -- kernel
    
    @acs-kernel/sql/oracle/upgrade/upgrade-4.6.3-4.6.4.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-4.6.4-4.6.5.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-4.6.5-4.6.6.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-4.7d-4.7.2d.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-4.7.2d-5.0d.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-5.0d-5.0d2.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-5.0d2-5.0d3.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-5.0d6-5.0d7.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-5.0d7-5.0d9.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-5.0d9-5.0d13.sql
    @acs-kernel/sql/oracle/upgrade/upgrade-5.0.0b1-5.0.0b2.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-5.0.0b2-5.0.0b3.sql;
    @acs-kernel/sql/oracle/upgrade/upgrade-5.0.0b3-5.0.0b4.sql;
    
    -- Service Contract
    
    @acs-service-contract/sql/oracle/upgrade/upgrade-4.5-4.5.1.sql;
    @acs-service-contract/sql/oracle/upgrade/upgrade-4.5.1-4.6.sql
    @acs-service-contract/sql/oracle/upgrade/upgrade-4.7d2-4.7d3.sql;
    @acs-service-contract/sql/oracle/upgrade/upgrade-4.7d3-5.0d1.sql;
    
    -- Acs Authentication
    
    @acs-authentication/sql/oracle/acs-authentication-create.sql
    
    -- Acs Lang
    @acs-lang/sql/oracle/acs-lang-create.sql
    
    
    Collapse
    Posted by Vinod Kurup on
    Hazi,

    Did you also load upgrade-5.0.0a1-5.0.0a2.sql? It's important, as mentioned in my post above, but it can be loaded out-of-order, if needed.

    Collapse
    Posted by Joel Aufrecht on
    I renamed this thread to be more accurate.
    Collapse
    Posted by Joel Aufrecht on
    I put in another 20 hours this weekend, and managed to get my personal site to a workably 5.0 condition.  A fair amount of that time was wrestling with CVS branches and merging and whatnot.  In the two months that I've been working on it, I've repeated some steps of the process up to 20 or 30 times, so I finally caved and wrote up a script to make trial and error debugging easier.  I put it in /contrib/misc - it does most of the steps that I'm aware of in a basic upgrade.  http://cvs.openacs.org/cvs/openacs-4/contrib/misc/upgrade_4.6_to_5.0.sh?only_with_tag=HEAD
    Collapse
    Posted by Carl Robert Blesius on

    I put some time aside this weekend to do the 4.6.3 -> 5.0.0 upgrade on my peronal site. I got pretty far (note to anyone else atempting this: look at and use the script -> upgrade with documentation alone does not work at all).

    Was able to get through a lot of errors, but not this one: When I try to login (step 8: If you can login, visit /acs-admin/apm and upgrade acs-kernel and acs-service-contract and uncheck the data model scripts) I get a request error and this is was the error.log says:

    [21/Mar/2004:09:04:39][30040.5126][-conn2-] Error: GET http://blesius.org/register/?return%5furl=%2f
    referred by "http://blesius.org/"
    no value given for parameter "key" to "_"
        while executing
    "_ acs-subsite.Log_In"
        invoked from within
    "list [_ acs-subsite.Log_In] ok"
        invoked from within
    "list [list [_ acs-subsite.Log_In] ok]"
        invoked from within
    "set login_button [list [list [_ acs-subsite.Log_In] ok]]"
        ("uplevel" body line 77)
        invoked from within
    "uplevel {
              # Present a login box
    #
    # Expects:
    #   subsite_id - optional, defaults to nearest subsite
    #   return_url - optional, defaults to Your..."
        (procedure "code::tcl::/web/crb/packages/acs-subsite/lib/login" line 2)
        invoked from within
    "code::tcl::$__adp_stub"
        invoked from within
    "if { [file exists $__adp_stub.tcl] } {
    
          # ensure that data source preparation procedure exists and is up-to-date
          adp_init tcl $__adp_stub
    ..."
        ("uplevel" body line 3)
        invoked from within
    "uplevel {
    
        if { [file exists $__adp_stub.tcl] } {
    
          # ensure that data source preparation procedure exists and is up-to-date
          adp_init t..."
        (procedure "adp_prepare" line 2)
        invoked from within
    "adp_prepare "
        (procedure "template::adp_parse" line 30)
        invoked from within
    "template::adp_parse [template::util::url_to_file "/packages/acs-subsite/lib/login" "$__adp_stub"] [list return_url "${return_url}" no_frame_p "1" auth..."
        invoked from within
    "append __adp_output [template::adp_parse [template::util::url_to_file "/packages/acs-subsite/lib/login" "$__adp_stub"] [list return_url "${return_url}..."
        ("uplevel" body line 17)
        invoked from within
    "uplevel {
              set __adp_output ""
    
        set __adp_master [template::util::url_to_file "[ad_parameter -package_id [ad_conn subsite_id] DefaultMaster ..."
        (procedure "template::code::adp::/web/crb/packages/acs-subsite/www/regis..." line 2)
        invoked from within
    "template::code::${template_extension}::$__adp_stub"
        (procedure "template::adp_parse" line 68)
        invoked from within
    "template::adp_parse [file root [ad_conn file]] {}"
        (procedure "adp_parse_ad_conn_file" line 7)
        invoked from within
    "$handler"
        ("uplevel" body line 2)
        invoked from within
    "uplevel $code"
        invoked from within
    "ad_try {
                    $handler
                } ad_script_abort val {
                    # do nothing
                }"
        invoked from within
    "rp_serve_concrete_file [ad_conn file]"
        (procedure "rp_serve_abstract_file" line 60)
        invoked from within
    "rp_serve_abstract_file "$root/$path""
        ("uplevel" body line 2)
        invoked from within
    "uplevel $code"
        invoked from within
    "ad_try {
            rp_serve_abstract_file "$root/$path"
            set tcl_url2file([ad_conn url]) [ad_conn file]
            set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."
    

    Suggestions?

    Collapse
    Posted by Malte Sussdorff on
    This looks like an acs-lang problem. Visit http://yoursite.com/acs-lang/admin/load-catalog-files before loging in for the first time to load the keys.
    Collapse
    Posted by Carl Robert Blesius on

    It is hard to visit /acs-lang/admin/load-catalog-files when I can not login.

    I already tried what Robert mentioned above (loading /foo.tcl with lang::catalog::import -locales [list "en_US"] in it).

    Just to make sure I removed the "-locales [list "en_US"]" part so it more closely resembles /acs-lang/admin/load-catalog-files and tried it again. No luck, same error on registration.

    Collapse
    Posted by Jeff Davis on
    you could do something like this
    rename _ original_
    proc _ {{key {}}} {
      if {[string is space $key]} { 
         return NULL_KEY
      }
      return [original_ $key]
    }
    
    in a file like SERVERROOT/tcl/zz-hack.tcl. That should allow you to at least log in.
    Collapse
    Posted by Jeff Davis on
    actually, I guess you would have to handle the substitution variables as well (I should have looked at the proc before I
    wrote that I guess).
    Collapse
    Posted by Malte Sussdorff on
    I know this is a horible security risk, but find out your user_id and login using a page which uses "ad_user_login -forever=0 $user_id" to log you into the system. Maybe this can help your loging in problem.
    Collapse
    Posted by Carl Robert Blesius on

    Thanks, but I aborted the upgrade and restored from backups.

    Going to put the two postgres versions up on different ports in parallel so I can tool with it as I have time.

    Here is an improved script from Jeff (for posterity)

    rename _ original_
    proc _ {{key {}} {vars {}}} {
      if {[string is space $key]} {
        return NULL_KEY
      }
        return [uplevel [list original_ $key $vars]]
    }
    

    Round two, coming soon to a forum near you.

    Collapse
    Posted by Jon Griffin on
    Services are still not showing up as able to mount on upgraded sites. I just checked 2 sites that had OpenFTS installed and I am not able to add it to sitemap.

    This is using /admin/site-map/.

    I fixed this in my instance by changing the query in acs-tcl:

    
    apm-procs-postgresql.xql
    
    select package_key,
           pretty_name
    from apm_package_types
    where (apm_package__singleton_p(package_key) = 1 and
               apm_package__num_instances(package_key) <= 1)
    order by pretty_name
    
    
    Notice that the original query assumes ALL singleton packages shouldn't be mounted. This is not a correct assumption.

    this is not the best way to deal with this as it only gets you the singleton packages, but it allows you to mount the packages and stop the errors in your log from openfts not being initialized.

    Collapse
    Posted by Michael Bluett on
    I am testing upgrading my site. I am currently not able to log in. Is thisstill due to acs-lang not being installed correctly (I had zz-postload.tcl in place). The error is:

    [12/Apr/2004:00:57:24][29728.114696][-conn4-] Error: GET http://myserver.com/register/?return%5furl=%2facs%2dadmin%2f
    referred by ""
    no value given for parameter "key" to "_"
        while executing
    "_ acs-subsite.Log_In"
        invoked from within
    "list [_ acs-subsite.Log_In] ok"
        invoked from within
    "list [list [_ acs-subsite.Log_In] ok]"
        invoked from within
    "set login_button [list [list [_ acs-subsite.Log_In] ok]]"
        ("uplevel" body line 77)
        invoked from within
    "uplevel {
        	  # Present a login box
    #
    # Expects:
    #   subsite_id - optional, defaults to nearest subsite
    #   return_url - optional, defaults to Your..."
        (procedure "code::tcl::service0/packages/acs-subsite/lib/..." line 2)
        invoked from within
    "code::tcl::$__adp_stub"
        invoked from within
    "if { [file exists $__adp_stub.tcl] } {
    
          # ensure that data source preparation procedure exists and is up-to-date
          adp_init tcl $__adp_stub
    ..."
        ("uplevel" body line 3)
        invoked from within
    "uplevel {
    
    I have also noticed a couple of files that appear to deserve manual deletion as hangovers from 4.6.3:
    /packages/acs-templating/tcl/0-procs.tcl
    /packages/acs-lang/tcl/lang-init.tcl
    
    Collapse
    Posted by Michael Bluett on
    I managed to work past my problem, using Robert Gaszewski's amendment in his post above (Dec 15 2003 11:59:44).

    I have found more files that need to be deleted when upgrading from 4.6.3 (some for duplicate proc definitions on initialisation):

    • acs-templating/resources/lists
    • acs-templating/tcl/list-procs.tcl
    • acs-lang/tcl/lang-procs*
    • acs-templating/resources/forms/standard-lars.adp
    That last file was preventing me from logging in on my system. Now I'm going to try and upgrade some of the packages on my system.

    From what I have seen so far, any older files lying around the file system in the core directories result from files moving, being split up or renamed, and they probably shouldn't be there. They are the files with the old dates (if you just copied the new OpenACS on top of your old installation).

    Collapse
    Posted by Chris Davies on
    I just followed the instructions, had to use this post and the zz-hack.tcl to get my system to operate, however, when I go to upgrade the packages, I get the following: Request Error
    error "Unterminated element" at position 672
    "56"&
            <br />
            <input type=submit value="Search" name="t">
          </f <--Error-- orm>
        
    <hr noshade>
        <address><a href="mailto:webmaster@openacs.org">"
        while executing
    "dom parse -simple [lindex $args 1]"
        (procedure "xml_parse" line 4)
        invoked from within
    "xml_parse -persist $manifest"
        (procedure "apm_get_package_repository" line 30)
        invoked from within
    "apm_get_package_repository -repository_url $repository_url -array repository"
        ("uplevel" body line 30)
        invoked from within
    "uplevel {
        	  ad_page_contract {
        Install from local file system
    } {
        {package_type "apm_application"}
        {upgrade_p 0}
        {repository_url ..."
        (procedure "code::tcl::/var/www/aolserver4/lal.com/packages/..." line 2)
        invoked from within
    "code::tcl::$__adp_stub"
        invoked from within
    "if { [file exists $__adp_stub.tcl] } {
    
          # ensure that data source preparation procedure exists and is up-to-date
          adp_init tcl $__adp_stub
    ..."
        ("uplevel" body line 3)
        invoked from within
    "uplevel {
    
        if { [file exists $__adp_stub.tcl] } {
    
          # ensure that data source preparation procedure exists and is up-to-date
          adp_init t..."
        (procedure "adp_prepare" line 2)
        invoked from within
    "adp_prepare "
        (procedure "template::adp_parse" line 30)
        invoked from within
    "template::adp_parse [file root [ad_conn file]] {}"
        (procedure "adp_parse_ad_conn_file" line 7)
        invoked from within
    "$handler"
        ("uplevel" body line 2)
        invoked from within
    "uplevel $code"
        invoked from within
    "ad_try {
                    $handler
                } ad_script_abort val {
                    # do nothing
                }"
        invoked from within
    "rp_serve_concrete_file [ad_conn file]"
        (procedure "rp_serve_abstract_file" line 60)
        invoked from within
    "rp_serve_abstract_file "$root/$path""
        ("uplevel" body line 2)
        invoked from within
    "uplevel $code"
        invoked from within
    "ad_try {
    	rp_serve_abstract_file "$root/$path"
    	set tcl_url2file([ad_conn url]) [ad_conn file]
    	set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."
    
    Ironically, this is the same error I get in another 5.0 site that was installed new from 5.0-beta.

    What did I miss?

    Collapse
    Posted by Cathy Sarisky on
    Chris, did you install tDOM?
    Collapse
    Posted by Chris Davies on
    already had tdom -- that machine was running openacs 5 already.

    basically, somewhere in acs-lang, there was a drop that didn't cascade, which didn't allow en_US to be inserted.  Had to manually go through the upgrade scripts and find the two drops that didn't cascade, and paste in the creates.

    I needed the acs-lang patch in zz-postload.tcl, and the zz-hack.tcl that is mentioned above.

    The other gotcha was the fact that I hit page-down twice, and missed the 'upgrade via /acs-admin/apm/' text.

    Also, I had to create a file with this in it to reimport the message catalogs since en_US didn't exist.

    lang::catalog::import -locales "en_US"

    Once Dave set me straight, it was pretty smooth.  All told, roughly 9 hours of actual time were spent.  Being an OpenACS novice, that's probably slow compared to someone comfortable with OpenACS.  I only had 6 packages and had no custom code on the 4.6.3 site.

    After that upgrade, I cleaned up two 5.0-beta* and a 5.0.1 install, moved two from a chroot, eliminated AOLServer 3 on that machine and now have 5 sites running 5.0.4.

    A direct comparision puts 5.0.4 noticably faster than the same site when it was running 4.6.3.

    Collapse
    Posted by Michael Bluett on
    I have managed to get to 5.0.0 (from 4.6.3) on my test server at least. Not sure whether I want to go to 5.0.4 - not sure there's any reason for me to upgrade.

    Some things to note:

    • I couldn't find a link to /acs-admin/apm/ on the acs-admin page, just a link to /acs-admin/install/, which appears to have different options.
    • I had to untick the 4.6.2-4.6.3 upgrade sql script when updating acs-messaging to v5.0.0.
    The "install tarball over the top of existing directory" advice in the docs (if you aren't using CVS) isn't the most subtle of approaches, and I did some pruning as above. Probably the best thing to do would be prune the directories that have replacement files first (effectively doing what CVS does). Ideally you'd use CVS.
    Collapse
    Posted by Joel Aufrecht on
    Dot releases are always recommended upgrades - they contain only bug fixes, not new features, and we try hard to make them very low risk upgrades.

    Changelog for 5.0.x:
    https://openacs.org/doc/openacs-5-0-0/release-notes.html

    Collapse
    Posted by Michael Bluett on
    Thanks for that comment, having upgraded to 5.0.4, blogger is no longer displaying html entries as text.

    I am now having problems putting links in general comments on my test server, is this a known bug?:

    Problem with Your Input
    We had a problem processing your entry:
    
        * The attribute 'href' is not allowed for a tags
    
    Collapse
    Posted by Jade Rubick on
    Michael,

    Someone else had that problem as well. I posted on that thread, as did Lars. So you might be able to find it by searching our postings. Or actually, I think it was in bug-tracker.

    We eventually added href back in to the set of allowed attributes. I didn't think that error was present in 5.0.4, but maybe it is...?

    Collapse
    Posted by Chris Davies on
    Not allowing href.

    I had the same problem.....

    Kernel Parameters
    Antispam
    AllowedAttribute

    Add href.  I also added src and target.

    Collapse
    Posted by Jade Rubick on
    My upgrade took a while, but went fairly smoothly. The only problem I'm running into is that edit-this-page doesn't seem to work any longer.

    It works for viewing pages, but when you try to save an edit you make:

    Request Error

    Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

    ERROR:  function etp__create_new_revision("unknown", "unknown", "unknown", "unknown") does not exist
    HINT:  No function matches the given name and argument types. You may need to add explicit type casts.

    SQL:
    select etp__create_new_revision('1096', 'co2', '292', '7716');

    I'm on Postgres 7.4, and still on OpenACS 5.0

    Collapse
    Posted by Jade Rubick on
    I fixed this problem by manually loading the 1.3-1.5 and 1.5-1.6 scripts in the sql/postgresql/upgrade directory.
    Collapse
    Posted by Matt Counte on
    Has anyone compiled a complete list of all of the steps required to upgrade an oracle system from openacs 4.6.3 to 5.0?
    Collapse
    Posted by Miguel Marin on
    Here are the steps that I took to upgrade on Oracle.
    https://openacs.org/forums/message-view?message_id=201394