Plugins lost on update

Plugins lost on update

by Anton Pøsen -
Number of replies: 7

Hi

We have a self hosted Moodle instance. I just updated from 4.5 to 5.1 using git. The plugins are of course gone. I did not add sub-repositories like described here:

The plugins overview is complaining now:

image.png

I am thinking about adding submodules to the git repository. The two first plugins I installed myself. Not shore about the last 9 yet.

cd /var/www/moodle/

Sub-repositories are new to me. I really do not want to get fancy beyond the commands bellow for updates. How would you make shore that the plugins are updated?

git fetch origin
git checkout v5.x.x
Average of ratings: -
In reply to Anton Pøsen

Plugins lost on update

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

You wrote:
> The plugins are of course gone.

Do you really think, Moodle is designed that way? I have done many upgrades. The plug-ins go, only if I removed them.

To investigate what has happened, could you tell us:
1. How did you install Moodle core the first time. What version? You seem to be a CLI person, then give us the exact commands.

2. How did you add the plug-ins? Again with a precise example.

3. Did you upgrade (over versions 4.2 > 4.5 etc) before this? If so, what were the commands? Or did you start with Moodle 4.5 LTS?

4. How did you upgrade this time, 4.5 LTS > 5.1? Following Upgrading to the dot? If so, when did you notice that the plug-ins were gone?
In reply to Anton Pøsen

Plugins lost on update

by Ken Task -
Picture of Particularly helpful Moodlers

Am like Mr. V ... one doesn't expect lost plugins using git for the code directory doesn't move!!!

So the 4.5 version you had ... was it under git control?  or when you decided to upgrade to 5.1 you also acquired the 5.1 code via git at the same time?

Do still have a moodle.old code directory still?   If so, look in that directory (mods/blocks/themes/ - where ever you had addons installed.   You'll find the old code directories in there as the upgrade from 4.5 to 5.1 is a change of structure and did not try to move plugins - just core.  To fix all you have to do is copy the moodle.old/mod/someplugin directories to newmoodlecode/public/samelocation.

As far as using git for plugins ... (submodules) ... my method of madness ... I don't.   I'll let the moodle admin interface handle that for me.   One of the discoveries about submodules made earlier ... not all plugin makers have a git repo that's 'standard'. :|

My 2 cents!

'SoS', Ken

 

In reply to Ken Task

Plugins lost on update

by Ken Task -
Picture of Particularly helpful Moodlers

Correction ... rather than looking in moodlecode.old, look for a /mod/block/theme/ directory in current code move the contents of those to public/mod/ ... public/blocks/ ... public/theme/ 

The only things you should see at code root of a 5.1 are:

├── admin
├── composer.json
├── composer.lock
├── config-dist.php
├── config.php
├── CONTRIBUTING.md
├── COPYING.txt
├── Gruntfile.js
├── index.php
├── INSTALL.txt
├── lib
├── npm-shrinkwrap.json
├── package.json
├── phpcs.xml.dist
├── phpunit.xml.dist
├── public - * move 5.0.x/4.x plugins to same dirs here
├── README.md
├── TRADEMARK.txt
├── UPGRADING.md
└── vendor

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Plugins lost on update

by Anton Pøsen -
Thanks for your feedback Guys. I simply did a git clone from https://github.com/moodle/moodle.git without thinking about plugins. Moving the plugins in to the new repository worked fine.

public/admin/tool/certificate/
public/mod/coursecertificate/

I understand that you do not like the git way of updating. I can se a benefit for security by not trusting the www-data user with writing these files. But I can also see the bigger risk of me messing up updates.

How do you like to perform updates for the site and for plugins?
In reply to Anton Pøsen

Plugins lost on update

by Ken Task -
Picture of Particularly helpful Moodlers

If you are talking to me ...

"I understand that you do not like the git way of updating."

Incorrect.  For core I use git to install/update/and upgrade ... 100%.

What I don't use git for ... plugins (third party addons).   For reasons given before, but I'll repeat here again ... authors of plugins may not provide git ready updates to their plugins.  I have seen some that require one to download the zip and unzip it locally.   After unzipping, one would find a mod and a compatible block that one would install one at a time,but they were both required.

It is for that reason, I do core first, login to check things, go to notifications, check updates, then go to plugins to see if any of those say there is an update available.   If so, I get them.   If not, I'll wait a couple of days and check again.

CLI way of checking addons:

Install moosh

Build a list of plugin - short names (addons.txt file mentioned below).    Shortname list created using the admin/cli/uninstall_plugins.php with switch to show contribs:

php uninstall_plugins.php --show-contrib

Redirected output to > addons.txt

Then edit addons.txt leaving only the shortnames.

Script: checkaddons

Contains:

#!/bin/bash
#
cd /var/www/html/lms/;
echo 'Add-on listing: ';
cat ./addons.txt;
echo '---------------------';
for i in `cat ./addons.txt`
do
   echo "Addon in que: $i";
moosh -n plugin-list |grep $i
done

When executed it looks like (clips not full):

./checkaddons
Add-on listing: 
mod_checklist
mod_questionnaire
block_checklist
filter_wiris
atto_wiris

Then shows links to the addons in Moodle plugins site ... most recent available ... again clip of just the first shortname above (mod_checklist):

---------------------
Addon in que: mod_checklist
mod_checklist,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.10,3.11,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,https://moodle.org/plugins/download.php/38287/mod_checklist_moodle51_2025101800.zip

IF, I wanted to, in a 5.1, I could acquire the zip linked above and install it manually.   But, I am lazy ... I use the admin interface to install the updates to plugins.

Since I have used method above, I've not had any issues with incompatible plugins.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Anton Pøsen

Plugins lost on update

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> I understand that you do not like the git way of updating.

I don't know, whom you are talking to. If you are talking to me, please quote me saying that.
 
I would say, I understand that you do not like answering my questions https://moodle.org/mod/forum/discuss.php?d=473355#p1896443.

I'm out. Take Git_for_Administrators for your journey.