Miscellaneous

Upgrading to 2.4.x from 2.3.x

Upgrading to 2.4.x from 2.3.x

by Robert Byerly -
Number of replies: 2
I thought before the new semester started I would upgrade our server to the latest version of WeBWorK. I backed up the old webwork2 and pg subdirectories, as well as the mysql data directory before starting so I can back out if necessary. I then updated from CVS, updated perl modules, fixed global.conf and database.conf.

wwdb_upgrade fails with a message
Upgrading database from version 12 to 13...
(Version 13 fixes KEY length, adds UNIQUE KEY for set_user table)

An error occured while running the course upgrade code for version 13 on course modelCourse:
DBD::mysql::db do failed: Specified key was too long. Max key length is 500 at ./wwdb_upgrade line 171.
Ignore this error and go on to the next course? [y/N]

I've tried both the obvious things: answering "y" and answering "n" to all such questions (starting from a fresh copy of the mysql database each time) but don't wind up with a usable database in either case. (When I try to log in, webwork complains about missing columns. Unfortunately I didn't write down which ones, although I could redo this if this information would help.)

Finally I tried the following. I deleted all tables from the webwork database (thus giving me, in effect, a new webwork installation), moved all exising directories out of the "courses" subdirectory, and tried to create a new course using the "addcourse" utility. This gave me a similar error:

DBD::mysql::db do failed: Specified key was too long. Max key length is 500 at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 665.


I'm going to restore our existing installation so we will WeBWorK back up, but I have some questions:

1. Could this be due to our mysql version? We're using mysqld 4.0.24 on a debian based linux distribution. I notice from the installation manual that 4.1.x is recommended for some experimental features. I don't really want to upgrade the whole OS right now.

2. Any other ideas what could be going wrong?

3. If I can't upgrade WeBWorK right now, would it be possible to upgrade just the pg subdirectory or would this cause problems?

Thanks,
Bob Byerly


In reply to Robert Byerly

Re: Upgrading to 2.4.x from 2.3.x

by Michael Gage -
3. If I can't upgrade WeBWorK right now, would it be possible to upgrade just the pg subdirectory or would this cause problems?

It is possible to upgrade pg independently -- there is seldom any trouble with upgrading pg since it is almost completely independent of the rest of the webwork2 code and there is no need to update a configuration file.

I just consulted with Sam Hathaway on your other problem:

looks like it's trying to make a key that's 510 characters long, but mysql 4.0 limits key length to 500

these are internal table indexes, to speed up database access

the quick fix is to reduce the lengths of the key components at lines 171 and 181 of bin/wwdb_upgrade

so it looks likely that if you make those two changes you should be able to use the older mysql version. I can't make any guarantees however. Presumably the key length was increased in later versions but I haven't checked into that.

--Mike

In reply to Michael Gage

Re: Upgrading to 2.4.x from 2.3.x

by Robert Byerly -
Thanks Mike. If I can't easily upgrade mysql (I'll check on this first), for now I'll probably just go back to the previous version and then upgrade pg.