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