upgrade to version 22 database errors

Im upgade from v20 to 22 and getting these errors, am i doing something wrong? there is more but to much to post

The following SQL statements caused errors: INSERT INTO gibbonAction (gibbonModuleID, name, precedence, category, description, URLList, entryURL, entrySidebar, menuShow, defaultPermissionAdmin, defaultPermissionTeacher, defaultPermissionStudent, defaultPermissionParent, defaultPermissionSupport, categoryPermissionStaff, categoryPermissionStudent, categoryPermissionParent, categoryPermissionOther) VALUES ((SELECT gibbonModuleID FROM gibbonModule WHERE name=‘Roll Groups’), ‘View Roll Groups_myChildren’, 0, ‘Roll Groups’, 'View the roll groups in which a user\‘s children study.’, ‘rollGroups.php,rollGroups_details.php’, ‘rollGroups.php’, ‘Y’, ‘Y’, ‘N’, ‘N’, ‘N’, ‘N’, ‘N’, ‘N’, ‘N’, ‘Y’, ‘N’)
SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘gibbonModuleID’ cannot be null

INSERT INTO gibbonSetting (scope, name, nameDisplay, description, value) VALUES (‘Application Form’, ‘applicationProcessFee’, ‘Application Processing Fee’, ‘An optional fee that is paid before processing the application form. Sent by staff via the Manage Applications page.’, ‘0’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Application Form-Application Processing Fee’ for key ‘scope’

INSERT INTO gibbonSetting (scope, name, nameDisplay, description, value) VALUES (‘Application Form’, ‘applicationProcessFeeText’, ‘Application Processing Fee Text’, ‘A custom message sent to applicants by email when a processing fee needs to be paid.’, ‘Thank you for your application submission. Please pay the following processing fee before your application is complete. Payment can be made by credit card, using our secure PayPal payment gateway. Click the button below to pay now.’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Application Form-Application Processing Fee Text’ for key ‘scope’

ALTER TABLE gibbonApplicationForm ADD paymentMade2 ENUM(‘N’,‘Y’,‘Exemption’) NOT NULL DEFAULT ‘N’ AFTER paymentMade
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘paymentMade2’

ALTER TABLE gibbonApplicationForm ADD gibbonPaymentID2 INT(14) UNSIGNED ZEROFILL NULL DEFAULT NULL AFTER gibbonPaymentID
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘gibbonPaymentID2’

ALTER TABLE gibbonMessenger ADD gibbonSchoolYearID INT(3) UNSIGNED ZEROFILL NULL DEFAULT NULL AFTER gibbonMessengerID
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘gibbonSchoolYearID’

INSERT INTO gibbonAction (gibbonModuleID, name, precedence, category, description, URLList, entryURL, entrySidebar, menuShow, defaultPermissionAdmin, defaultPermissionTeacher, defaultPermissionStudent, defaultPermissionParent, defaultPermissionSupport, categoryPermissionStaff, categoryPermissionStudent, categoryPermissionParent, categoryPermissionOther) VALUES((SELECT gibbonModuleID FROM gibbonModule WHERE name=‘System Admin’), ‘System Overview’, 0, ‘System’, ‘’, ‘systemOverview.php’, ‘systemOverview.php’, ‘Y’, ‘Y’, ‘Y’, ‘N’, ‘N’, ‘N’, ‘N’, ‘Y’, ‘N’, ‘N’, ‘N’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘System Overview-0003’ for key ‘moduleActionName’

INSERT INTO gibbonAction (gibbonModuleID, name, precedence, category, description, URLList, entryURL, entrySidebar, menuShow, defaultPermissionAdmin, defaultPermissionTeacher, defaultPermissionStudent, defaultPermissionParent, defaultPermissionSupport, categoryPermissionStaff, categoryPermissionStudent, categoryPermissionParent, categoryPermissionOther) VALUES((SELECT gibbonModuleID FROM gibbonModule WHERE name=‘System Admin’), ‘Manage Services’, 0, ‘Extend & Update’, ‘’, ‘services_manage.php’, ‘services_manage.php’, ‘Y’, ‘Y’, ‘Y’, ‘N’, ‘N’, ‘N’, ‘N’, ‘Y’, ‘N’, ‘N’, ‘N’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Manage Services-0003’ for key ‘moduleActionName’

INSERT INTO gibbonSetting (scope, name, nameDisplay, description, value) VALUES (‘Planner’, ‘parentDailyEmailSummaryIntroduction’, ‘Parent Daily Email Summary Introduction’, ‘Information to display at the beginning of the email’, ‘’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Planner-Parent Daily Email Summary Introduction’ for key ‘scope’

INSERT INTO gibbonSetting (scope, name, nameDisplay, description, value) VALUES (‘Planner’, ‘parentDailyEmailSummaryPostScript’, ‘Parent Daily Email Summary PostScript’, ‘Information to display at the end of the email’, ‘’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Planner-Parent Daily Email Summary PostScript’ for key ‘scope’

INSERT INTO gibbonNotificationEvent (event, moduleName, actionName, type, scopes, active) VALUES (‘Parent Daily Email Summary’, ‘Planner’, ‘Parent Daily Email Summary’, ‘CLI’, ‘All’, ‘Y’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Parent Daily Email Summary-Planner’ for key ‘event’

INSERT INTO gibbonNotificationEvent (event, moduleName, actionName, type, scopes, active) VALUES (‘Tutor Daily Email Summary’, ‘Planner’, ‘Tutor Daily Email Summary’, ‘CLI’, ‘All’, ‘Y’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Tutor Daily Email Summary-Planner’ for key ‘event’

INSERT INTO gibbonAction (gibbonModuleID, name, precedence, category, description, URLList, entryURL, entrySidebar, menuShow, defaultPermissionAdmin, defaultPermissionTeacher, defaultPermissionStudent, defaultPermissionParent, defaultPermissionSupport, categoryPermissionStaff, categoryPermissionStudent, categoryPermissionParent, categoryPermissionOther) VALUES((SELECT gibbonModuleID FROM gibbonModule WHERE name=‘School Admin’), ‘Email Summary Settings’, 0, ‘Other’, ‘’, ‘emailSummarySettings.php’, ‘emailSummarySettings.php’, ‘Y’, ‘Y’, ‘Y’, ‘N’, ‘N’, ‘N’, ‘N’, ‘Y’, ‘N’, ‘N’, ‘N’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Email Summary Settings-0001’ for key ‘moduleActionName’

UPDATE gibbonSetting SET scope=‘School Admin’ WHERE scope=‘Planner’ AND (name=‘parentWeeklyEmailSummaryIncludeBehaviour’ OR name=‘parentWeeklyEmailSummaryIncludeMarkbook’ OR name=‘parentDailyEmailSummaryIntroduction’ OR name=‘parentDailyEmailSummaryPostScript’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘School Admin-Parent Daily Email Summary Introduction’ for key ‘scope’

UPDATE gibbonNotificationEvent SET moduleName = ‘School Admin’ WHERE moduleName = ‘Planner’ AND (event=‘Parent Weekly Email Summary’ OR event=‘Parent Daily Email Summary’ OR event=‘Tutor Daily Email Summary’)
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘Parent Daily Email Summary-School Admin’ for key ‘event’

INSERT INTO gibbonAction (gibbonModuleID, name, precedence, category, description, URLList, entryURL, entrySidebar, menuShow, defaultPermissionAdmin, defaultPermissionTeacher, defaultPermissionStudent, defaultPermissionParent, defaultPermissionSupport, categoryPermissionStaff, categoryPermissionStudent, categoryPermissionParent, categoryPermissionOther) VALUES((SELECT gibbonModuleID FROM gibbonModule WHERE name=‘School Admin’), ‘Manage Medical Conditions’, 0, ‘Other’, ‘Manage the list of medical conditions that can be attached to student medical records.’, ‘medicalConditions_manage.php,medicalConditions_manage_add.php,medicalConditions_manage_edit.php,medicalConditions_manage_delete.php’, ‘medicalConditions_manage.php’, ‘Y’, ‘Y’, ‘Y’, ‘N’, ‘N’, ‘N’, ‘N’, ‘Y’, ‘N’, ‘N’, ‘N’)

Hello, it looks like a lot of these commands have been run already: have you previously tried to run this update and received some errors? Did you backup your database before updating? Can you share the final error message with me? This might tell us where to pick things up from. Ross.

This is unusual, because as of v21+, the updater will halt on the first error rather than continuing to update. If the code base was fully updated to v22, then the updater should have not continued after the first error. Odd! It does seem like perhaps a previous update was not fully completed.

Ross and Sandra, I had a similar problem with the upgrade from v21 to v22 shortly after v22 was released. The only problem was with the modules Free Learning and Trip Planner. They did not upgrade correctly. After trying the module upgrade again, neither of them worked. After the original edition of the Trip Planner module, COVID-19 stopped any planned trips, so was no data attached. Similarly with the the Free Learning as it was still in an evaluation stage. I finally turned off the modules and didn’t select the removal of the Free Learning files. When I reactivated the modules, both worked fine and the Free Learning lesson content was still there.
I’m not sure if this info would help you or not. I didn’t let you know months ago because I thought it was unique to us and possibly related to our hosting company having updated MariaDB to a version beyond what Gibbon was certified to work with. It definitely started with those two modules messing up on the first upgrade and trying again. I hope this info helps.
– Glenn

Hi Glenn, with a large release like v22, which included many database changes, we released updates for each of the modules so that they work with v22. Did you check the Extend page to ensure you have the latest versions of those modules downloaded and installed before updating them?

I did actually wait until an updated module could be released and installed. Even the later version didn’t undo the problem of the previous version of the modules partially installing. Most errors shown were constraint and duplicate entry violations similar to those in RPrice1978’s listing. Fortunately, we had no important data stored by those modules and deactivating the modules and reactivating them solved it without incident. I was happy! I was also happy I had the data backed up but didn’t have to use it!

sorry was away, Sandra did you want me to send you more details?

Hi rprice1978, if you don’t have a backup or its not feasable to restore from it, it gets a little tricky to proceed but not impossible.

It looks like the update failed when updating from v20 to v21, which happens sequentially before v21 to v22. The database lines you’ve shared are causing errors because they must have already been run on the database.

The first thing to try and identify is the last database update that went through successfully. If you open the CHANGEDB.php file, you will find that it is broken up into large sections of database commands, one section per version. The final command for the v21 update is a “INSERT INTO gibboni18n” command that adds a uk_UA українська мова - Україна locale to the gibboni18n table. Can you check your gibboni18n table and look to see if the uk_UA locale is there (eg: SELECT * FROM gibboni18n WHERE code=‘uk_UA’;).

If this line has indeed run, then you may be able to skip over the remainder of the v21 update. To do this, go into your gibbonSetting table and manually change the version` to 21.0.00. Then, backup your database one more time, and you may be able to then attempt a fresh update from v21 to v22 via the updater.

Hope this helps!