Please see and read/comprehend:
http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releasesFrom 3.3.1 - requires a 'march' of Moodle to supported versions (goal of LTS versions of Moodle is good) and in-between upgrades of Moodle, upgrades to PHP + extensions and MariaDB *before* hops.
The following:
https://docs.moodle.org/403/en/Moodle_migrationdid not cover what you are attempting to do.
On new server one might have to install and run lower versions of PHP/MariaDB just
to restore older site. Then 'march' the moodle upwards, again upgrading PHP + extensions and MariaDB *before* hops.
The version of PHP/MariaDB upgraded such that they meet supports for the marched moodles.
If your old site is still up, go to Server, Admin Menu, Environment check and update the component. Then use the moodle version dropdown pick list to see requirements needed.
Also, if you have any 3rd party addons to Moodle, research those to see if they have a compatible version for your destination version.
That includes themes ... also advised you force the theme to boost via config.php file so theme's won't be an issue with upgrades during the march .. worry about how it looks only after the march ends!
Each successfull hop upwards, check and update plugins and then strongly suggest doing a site backup so that if the next hop fails for some reason, you've not lost what you have gained by restoring the last working hop.
Basically, one cannot do a 'hyperjump' - not with code and not with DB. :|
'SoS', Ken