Forums | Mahara Community

Support /
Upgrade problem from 1.2.4 to 1.4.1testing


anonymous profile picture
Account deleted
Posts: 6

22 June 2011, 23:10

I'm trying to upgrade mahara from 1.2.4 to 1.4testing, initially it was stopped at mysql charater set error due to column collation was set to swedish, then I converted every single column to utf8_general_ci. Then I got the following error message during the upgrade:

Could not execute command: ALTER TABLE artefact ADD CONSTRAINT arte_aut_fk FOREIGN KEY (author) REFERENCES usr (id)

Call stack (most recent first):
  • execute_sql("ALTER TABLE artefact ADD CONSTRAINT arte_aut_fk FO...", true) at/var/www/html/mahara/lib/dml.php:1394
  • execute_sql_arr(array(size 1), true, true) at/var/www/html/mahara/lib/ddl.php:972
  • add_key(object(XMLDBTable), object(XMLDBKey)) at/var/www/html/mahara/lib/db/upgrade.php:1456
  • xmldb_core_upgrade("2009111013") at /var/www/html/mahara/lib/upgrade.php:301
  • upgrade_core(object(stdClass)) at /var/www/html/mahara/admin/upgrade.json.php:94

There are other posts here in this forum having similar issue, but none of them helped. Could someone point me to the right direction? 

TIA,

Lei

anonymous profile picture
Account deleted
Posts: 808

23 June 2011, 18:04

Hi,

If you're using mysql, make sure you've restored the database back to it's pre-upgrade state before attempting the upgrade again.

If you've done that and you're still getting that error, I guess the most useful thing you could do is try running that SQL command in a console and find out the exact error message so we can find out why it's failing.

It could be that the constraint arte_aut_fk already exists, or it could be that you have some rows in there where the author column has a value that's not in the usr table.

R.

anonymous profile picture
Account deleted
Posts: 6

23 June 2011, 22:00

Hi Richard,

Thanks for your reply. The database has been restored to the pre-upgrade status, and I've also tried to run the sql command in a console, it returns the same error as the browser did.

I'm now trying to upgrade the version from 1.2 to 1.3 first to see if this can resolve my issue...

-Lei

anonymous profile picture
Account deleted
Posts: 6

23 June 2011, 22:49

problem fixed.

Here is what happened, before I got my character set change from "swedish" to "utf8", I did an upgrade attempt from 1.2.4 to 1.3, which add all the new tables introduced in version1.3, it failed half way through with all the new tables added into my database. When I try upgrade to 1.4, this obviously will fail as all new tables already exist in the database.

For mahara dev team, could someone alter the upgrade script to do the requirement check first before attempt do anything else? I have seen few people having similar issue with sweish character set, they'll encounter similar issues if they upgrade their mahara in the future.

The version number in the upgrade script(lib/db/upgrade.php) should be increamented everytime complete any changes to the databse, so upgrade can be carry on if there is any discruptions during the upgrade. 

HTH,

Lei

François Marier's profile picture
Posts: 411

06 July 2011, 22:01

Excellent suggestion Lei. I have created a bug report for it:

  https://bugs.launchpad.net/mahara/+bug/806764

Cheers,

Francois

5 results