Upgrading from 1.2 not working correctly

upgrade.php isn't working entirely for me.  It doesn't seem to be making any changes to the database, including the creation of new tables such as elggriver (I had to start a fresh install of elgg to see that one). So, when I click on Administration or Settings, it gives me a 500 error. All of my widgets are broken too. Any advice?

  • Edit: please see my post below. This post's advice won't help you, I've realised, although I'm leaving it up as it may assist others with db difficulties.

    Upgrade has been tested on a variety of different environments and has worked flawlessly. This implies a couple of things to test:

    • Make sure your database user has correct modification privileges (not just read/write and create tables)
    • The database username and password have not accidentally been overwritten in the settings file

    Failing all of these, see if you can see anything coming up in either your web server or MySQL error logs.

  • Ah! How odd, I have just posted on a similar topic! I have to dash now but will investigate further next week :)

  • Apologies for misreading your original post.

    A 500 error doesn't imply database issues; your server is taking exception to the .htaccess rules that Elgg provides. This thread - http://community.elgg.org/mod/groups/topicposts.php?topic=24487&group_guid=23300 - contains potential fixes for the issue.

  • Thanks for the quick response.

    I've triple-checked the settings file and all the information is correct, and my db user has full privileges on the elgg schema. Perhaps I should give full privileges over the INFORMATION_SCHEMA and mysql databases as well?

    I got this PHP error in my logs when I try to go to the Admin page:


    Undefined property: stdClass::$language in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\elgg15\html\engine\lib\languages.php on line 87.

    Any further assistance would be appreciated. What I saw of 1.5 when I tried a fresh install looked exceedingly great.

  • Hmm, ok I'll try the .htaccess modification, but what about the missing database tables like elggriver?

  • Hi Cina,

    The PHP error you report is just a minor warning and is not related to the db / .htaccess problems you are having.

  • The .htaccess issue will have prevented the database upgrade from taking place - in other words, your 500 error takes place before the database upgrade code can run.

  • Ok, I removed that line from .htaccess, restarted apache, and tried to run upgrade.php again, but it still did the same thing (my database is still missing the new tables).

  • Are there any references to database errors in your PHP log?

  • Yes (hooray!). I just restored a copy of my database before I started the upgrade to 1.5 and tried running upgrade.php again and some errors showed up.

    Here they are:

    The following information is part of the event: php[6140], There were a number of issues:  Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys QUERY: ALTER TABLE `elggusers_entity` ADD  KEY `code` (`code`(50)); Unknown table 'elggprivileged_paths' QUERY: DROP TABLE `elggprivileged_paths`;.

    The following information is part of the event: php[6140], There were a number of issues:  Duplicate column name 'object_type' QUERY: ALTER TABLE `elggsystem_log` ADD COLUMN `object_type` varchar(50) NOT NULL AFTER `object_class`; Duplicate column name 'object_subtype' QUERY: ALTER TABLE `elggsystem_log` ADD COLUMN `object_subtype` varchar(50) NOT NULL AFTER `object_type`; Unknown column 'object_event' in 'elggsystem_log' QUERY: ALTER TABLE `elggsystem_log` MODIFY  `object_event` varchar(50) NOT NULL;.

    The following information is part of the event: php[6140], There were a number of issues:  Duplicate column name 'access_id' QUERY: ALTER TABLE `elggsystem_log` ADD COLUMN `access_id` int(11) NOT NULL AFTER `performed_by_guid`; Duplicate column name 'enabled' QUERY: ALTER TABLE `elggsystem_log` ADD COLUMN `enabled` enum ('yes', 'no') NOT NULL default 'yes' AFTER `access_id`; Can't DROP 'enabled'; check that column/key exists QUERY: ALTER TABLE `elggsystem_log` DROP KEY `enabled`;.

    The following information is part of the event: php[6140], There were a number of issues:  Duplicate column name 'owner_guid' QUERY: ALTER TABLE `elggsystem_log` ADD COLUMN `owner_guid` int(11) NOT NULL AFTER `performed_by_guid`; Can't DROP 'owner_guid'; check that column/key exists QUERY: ALTER TABLE `elggsystem_log` DROP KEY `owner_guid`;.

    The following information is part of the event: php[6140], There were a number of issues:  Can't DROP 'code'; check that column/key exists QUERY: ALTER TABLE `elggusers_entity` DROP KEY `code`;.

    The following information is part of the event: php[6140], There were a number of issues:  Can't DROP 'name'; check that column/key exists QUERY: ALTER TABLE `elggdatalists` DROP KEY `name`; Multiple primary key defined QUERY: ALTER TABLE `elggdatalists` ADD PRIMARY KEY `name` (`name`);.

    The following information is part of the event: php[6140], There were a number of issues:  Unknown table '__upgrade_2008112001' QUERY: DROP TABLE __upgrade_2008112001;;.