I made 2 attempts to upgrade from 3.6.1 to 3.10.3. This first attempt was botched, resulting in either the error regarding code/database mismatch or an "error/generalexceptionmessage".
(system config at bottom of posting)
I fell back to 3.6.3 (renamed moodle.backup back to moodle, and ran the mysqldump sql file against the DB to restore it.
The system came back up and appeared to worked normally (I was able to poke around in moodle and ran a few courses)
I have now restarted the process:
1) placed moodle into maintenance mode
2) downloaded 3.10 latest
3) rename moodle to moodle.backup and extracted the tgz file
4) copied the config.php, changed ownership and permissions of moodle/*
5) Ran the upgrade script:
# php admin/cli/upgrade.php
== Upgrading Moodle database from version 3.6.1+ (Build: 20181220) (2019032200.02) to 3.10.3+ (Build: 20210330) (2020110903.01) ==
Your Moodle files have been changed, and you are about to automatically
upgrade your server to this version:
3.10.3+ (BUILD: 20210330) (2020110903.01)
Once you do this you can not go back again. Please note that this process
can take a long time.
Are you sure you want to upgrade this server to this version?
type y (means yes) or n (means no)
: y
-->System
Default exception handler: Table "badge_alignment" already exists Debug: can not rename table
Error code: ddltablealreadyexists
* line 514 of /lib/ddl/database_manager.php: ddl_exception thrown
* line 1189 of /lib/db/upgrade.php: call to database_manager->rename_table()
* line 1862 of /lib/upgradelib.php: call to xmldb_main_upgrade()
* line 187 of /admin/cli/upgrade.php: call to upgrade_core()
!!! Table "badge_alignment" already exists !!!
!! can not rename table
Error code: ddltablealreadyexists !!
!! Stack trace: * line 514 of /lib/ddl/database_manager.php: ddl_exception thrown
* line 1189 of /lib/db/upgrade.php: call to database_manager->rename_table()
* line 1862 of /lib/upgradelib.php: call to xmldb_main_upgrade()
* line 187 of /admin/cli/upgrade.php: call to upgrade_core()
!!
-----------------------------------------------------------------
I attempted to rename the table (as recommended in another post):
MariaDB [moodle]> rename table badge_alignment to badge_alignment_old;
ERROR 1146 (42S02): Table 'moodle.badge_alignment' doesn't exist
--------------------------------------------------------------------
SYSTEM CONFIGURATION:
Linux: Ubuntu 20.04.2 LTS
php: PHP 7.4.16 (cli) (built: Mar 5 2021 07:54:38) ( NTS )
(there is also php7.0 available to moodle 3.6.3: PHP 7.0.33-47+ubuntu20.04.1+deb.sury.org+1 (cli) (built: Feb 23 2021 15:04:06) ( NTS ) )
DB: Server version: 10.3.27-MariaDB-1:10.3.27+maria~bionic-log mariadb.org binary distribution
-----------------------------------------------------------------------
How can I resolve this issue? Have I missed a step in the fall-back procedure? Is there something I missed in the upgrade?