The directions for upgrading using the method you are using said to move the old code out of the way, install new code, then copy back into new code config.php and any addons/plugins.
https://docs.moodle.org/39/en/Upgrading
Step 4:
"As mentioned above, if you had installed any plugins on your site you
should add them to the new code tree (Moodle directory structure) now.
It is important to check that you get the correct version for your new
version of Moodle. Be particularly careful that you do not overwrite any
code in the new version of Moodle and that you place the plugin folders
in the correct directory (the same directory that they are in in the
current installation.)"
So do you have that old code directory still?
If so, search the old code directory ... like /course/format/ for something that doesn't exist in new code directory. Copy ... note that's copy ... not move ... those directories into same locations in new code folder.
Yes, you could take the approach of installing any/all you find and see if something goes away, but then you've added a lot more than you had before ... and there is potential for un-installing the one you really wanted to keep/use.
No one here in community forums can do Vulcan Mind Melds with your server!
'SoS', Ken