Upgrading from 2.8.5 to 3.3

Upgrading from 2.8.5 to 3.3

by Nikki Macfarlane -
Number of replies: 5

I am testing an upgrade to 3.3 and coming across a couple of errors.

1. The tables mdl_user_tours and mdl_user_tour_steps are not being created

I can create these manually to get past that error. I think this is related to MDL-58857 in the tracker but I cannot see how to fix it and it does not appear to have been corrected in the latest download. Is there some manual change I can make to fix this?

2. The mdl_feedback_values table does not have the new column course_id added during upgrade

Again, I can create it manually to get past the error but not sure why it was not added during the upgrade process.

3. The upgrade is failing when trying to create mdl_auth_oauth2_linked_login

See error message below. I cannot get any further past this step so unable to see if there are other problems. I have created a copy of my production database to test this on, and a fresh set of files from the latest download 1 day ago. 

I would appreciate any guidance!

Thanks,

Nikki

ERROR MESSAGE FOR ISSUE #3

Debug info: Specified key was too long; max key length is 767 bytes
CREATE TABLE mdl_auth_oauth2_linked_login (
id BIGINT(10) NOT NULL auto_increment,
timecreated BIGINT(10) NOT NULL,
timemodified BIGINT(10) NOT NULL,
usermodified BIGINT(10) NOT NULL,
userid BIGINT(10) NOT NULL,
issuerid BIGINT(10) NOT NULL,
username VARCHAR(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
email LONGTEXT COLLATE utf8mb4_general_ci NOT NULL,
confirmtoken VARCHAR(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
confirmtokenexpires BIGINT(10),
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_authoautlinklogi_iss_ix (issuerid, username)
, KEY mdl_authoautlinklogi_use_ix (usermodified)
, KEY mdl_authoautlinklogi_us2_ix (userid)
, KEY mdl_authoautlinklogi_is2_ix (issuerid)
, UNIQUE KEY mdl_authoautlinklogi_us_uix (userid, issuerid, username)
)
ENGINE = InnoDB
DEFAULT COLLATE = utf8mb4_general_ci ROW_FORMAT=Dynamic
COMMENT='Accounts linked to a users Moodle account.'
Error code: ddlexecuteerror
×Stack trace:
  • line 492 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
  • line 1000 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 77 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
  • line 425 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
  • line 370 of /lib/ddl/database_manager.php: call to database_manager->install_from_xmldb_structure()
  • line 526 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
  • line 1754 of /lib/upgradelib.php: call to upgrade_plugins()
  • line 699 of /admin/index.php: call to upgrade_noncore()

Average of ratings: -
In reply to Nikki Macfarlane

Re: Upgrading from 2.8.5 to 3.3

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hello Nikki,

if your upgrade fails at some point, the steps that were supposed to be executed AFTER the failure were not executed, this could be an explanation why db changes from #1 and #2 were not done.

I have created MDL-58949 to investigate the index failure.

In reply to Nikki Macfarlane

Re: Upgrading from 2.8.5 to 3.3

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hello Nikki

It looks like you do not have

innodb_large_prefix
as recommended in https://docs.moodle.org/en/MySQL_full_unicode_support#Steps_to_upgrade


In reply to Marina Glancy

Re: Upgrading from 2.8.5 to 3.3

by Nikki Macfarlane -

Thanks Marina - I had missed this step when I was reading through the upgrade instructions.

In the instructions it says to add this line:

innodb_file_format = Barracuda 

I have not yet switched to Barracuda. What should this be? Antelope?

Also, my .my.cnf file is in the root directory. If I add these lines there is this going to affect anything that reads other databases that are not converted to utf8mb4_unicode_ci or will it only affect new databases and tables?

Thanks,

Nikki

In reply to Nikki Macfarlane

Re: Upgrading from 2.8.5 to 3.3

by Nikki Macfarlane -

OK I managed to install most of the large prefix info directly through phpmyadmin. I did not want it to affect my other databases so chose to do it this way instead. 

However, I am still getting the error telling me:

Table 'moodletest.mdl_tool_usertours_tours' doesn't exist

It is just not installing tool_usertours. I am guessing this is because it did not install initially and now not getting an opportunity to install again. Is there any work around for this? I cannot find anyone else having he same problem with usertours not working.

Any suggestions appreciated. Thanks.

Nikki

In reply to Nikki Macfarlane

Re: Upgrading from 2.8.5 to 3.3

by Nikki Macfarlane -

I resolved this by going back to the beginning and upgrading one version of moodle at a time from 2.8 through to 3.3 which worked. I did have to manually add the field course_id to the mdl_feedback_values table at the upgrade from 3.0 to 3.1 but once that was done it all worked fine. Making the changes suggested (adding the large prefix info) did not fix the problem when I upgraded directly from 2.8.5 to 3.3 so there must have been something in that direct upgrade that skipped something important in an earlier version. 


Average of ratings: Useful (1)