Upgrading from 3.9.21 to 4.1.15

Upgrading from 3.9.21 to 4.1.15

Salam Sarieddine -
回帖数:3

Hello,

We recently created a test environment to update from PHP 7.4 to PHP 8.0. As i read in the upgrading docs, we can upgrade from 3.9 to 4.1 with no issues, however I'm getting error 500 on the current Moodle version 3.9.21 and when i tried upgrading to 4.1.15 same error persists on PHP 8.0. When i update the config file and link it to let's say a new db, i can access the Moodle setup initialization error 500 is gone, however when i put the actual db which is the db to be upgraded we end up with error 500.

Can you please advise what might be the issue? Can it be a plugin issue for example? Any help is greatly appreciated.

Thanks.

回复Salam Sarieddine

Re: Upgrading from 3.9.21 to 4.1.15

Emma Richardson -
Documentation writers的头像 Particularly helpful Moodlers的头像 Plugin developers的头像

Did you check the release docs for db version?  There was a db upgrade required somewhere along the way in the last few versions...Are you checking that moodle is using the correct php version?  Not sure if you are using an htaccess file but that would need to be fixed..

回复Salam Sarieddine

Re: Upgrading from 3.9.21 to 4.1.15

Ken Task -
Particularly helpful Moodlers的头像

Under 'any help' ...

Please see:
http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases

Rows for 3.9 - LTS PHP min/max: 7.2 7.4 
and for the hyperjump to 4.1 the next LTS PHP min/max 7.4 8.1[6]
Footnote 6
PHP 8.1 since Moodle 4.1.2. See MDL-73016.

Also https://moodledev.io/general/releases
for additional config/requirements
3.9 highest PHP extension mbstring required
https://moodledev.io/general/releases/4.1
Server requirements
PHP extension sodium is recommended. It will be required in Moodle 4.2. For further details, see Environment - PHP extension sodium.
PHP extension exif is recommended.
PHP setting max_input_vars is recommended to be >= 5000 for PHP 7.x installations. It's a requirement for PHP 8.x installations. For further details, see Environment - max input vars.

Same chart above has info on MySQL versions.

Quickie from CLI: mysql -V

And yes, plugins can cause upgrade failure.   Themes are plugins so suggest adding a line to your config.php file to force the use of boost theme as that theme comes with every version of moodle:

$CFG->theme='boost';

If you have command line, handy CLI only tool script:

in code/admin/cli/

uninstall_plugins.php

If executed with the --show-contrib switch will show what additional plugins you have installed.

You'll have to use Moodle plugins site to check compatibility with destination of core, or you could install moosh - a command line utility for moodle - and use it to see highest version of those plugins 

 moosh -n plugin-list |grep [shortnameofplugin]

[shortnameofplugin] seen in the execution of the uninstall_plugins.php script above.

'SoS', Ken

回复Ken Task

Re: Upgrading from 3.9.21 to 4.1.15

Salam Sarieddine -

Hello,

Thank you both for your replies.

We did have PHP 7.4 and moving to PHP 8.0. We'll try to remove the additional plugins and theme one by one and check if the issue comes from a plugin as the server environment looks all good in terms of minimum requirements for Moodle 4.1.

Much appreciated.