#2 above ...
"Moodle updates fine, but afterwards all custom plugins are missing"
Indicates you are not using git for updates/upgrades, but what I'll call the old way which required the server operator to copy back into new code directory, all the addons ... like one would do config.php.
If one has many, prone to human error ... unless one maintains a list of those plugins and their locations.
There is no utility for admin to check 'environment' ... for plugins.
Thus, I've turned to CLI and the use of moosh to help.
First, I create an 'addons.txt' file manually that contains one liners of the addons for a site by addon shortname. Example ... looks like:
Then create a bash shell script that will use moosh to check on those addons. Called 'checkaddons' ... it looks like:
echo 'Add-on listing: ';
for i in `cat ./addons.txt`
echo "Addon in que: $i";
moosh -n plugin-list |grep $i
Executable and executed via ./checkaddons output looks like this:
Addon in que: mod_hvp
Addon in que: mod_questionnaire
Addon in que: mod_customcert
At this point I can see which plugins do have a version for my destination version on updates or upgrades.
Prior to pulling the trigger on updating/upgrading, I can acquire the plugins (via wget) in advance and put them in a 'addedplugins' directory for manually upgrading.
create a getlist file of urls ... like
can then use wget -i ./getlist
and wget will acquire just those zips.
Now that I have them, I can copy the zips to appropriate location of code directory and manually hide the plugin directory ... in /mod of code ... mv mod_hvp .mod_hvp ... apache/moodle can't see them.
And then unzip the zip ... which creates the mod_hvp directory with new code. Check ownerships/permisisons on the unzipped code directory and set them correctly.
Once having done the above for each addon, can go to admin/cli/ and issue php upgrade.php
No apache is in the loop ... just php and the scripts. It updates the db tables.
I'll check site to make sure all is working, then go back and 'clean up' the zips and hidden directories I created to make the backups of code directory cleaner/meaner ... more accurate. Perfect time to make a backup of code directory. Might then be done for some time if on LTS of a moodle.
So my overall process is to acquire moodle core code with git and once that. is done and checked then do the plugins.
Yes, takes some time ... but .... works for me!