Install multiple plugins or smart way to upgrade

Install multiple plugins or smart way to upgrade

by Richard van Iwaarden -
Number of replies: 4
Picture of Particularly helpful Moodlers

In following the manual on updating Moodle, I found it very time consuming to install all the plugins.

Is there a quicker way to do this?

I would think making a plugin directory in public_html/moodle/plugin and put all the plugins in there would make things a lot quicker?


Right now I'm just uploading the zip files one by one and installing them... through the web interface. Is that how it normally goes?

Average of ratings: -
In reply to Richard van Iwaarden

Re: Install multiple plugins or smart way to upgrade

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

I've done it different ways in the past

Keeping the plugins in a separate directory with a matching structure (themes, blocks, mods, folders etc) and copying from there. 

Right now, because I use git to manage them all, I have 2 scripts. One that installs all my plugins, so if I create a new test site I can run the script and pull everything in exactly the same. The other runs a git pull on all of them, and I've actually been testing putting that into cron on my development environment and seems to be have been fine. 

I know there are all sorts of dependency manager tools, but this simple script works exactly the way I want it to smile 

Richard (O) 

In reply to Richard van Iwaarden

Re: Install multiple plugins or smart way to upgrade

by Darko Miletić -

You should look into scripting this.

For example for initial setup:

#!/bin/bash

BRANCHNAME='MOODLE_33_STABLE'
# Initial setup of Moodle
git clone https://github.com/moodle/moodle.git /path/to/moodle
git --git-dir="[/path/to/moodle]/.git/" --work-tree="[/path/to/moodle]" checkout -b "$BRANCHNAME" "origin/$BRANCHNAME"
# Initial setup of some plugin
git clone https://github.com/itamart/moodle-mod_dataform [/path/to/moodle]/mod/dataform
git --git-dir="[/path/to/moodle]/mod/dataform/.git/" --work-tree="[/path/to/moodle]/mod/dataform" checkout -b "$BRANCHNAME" "origin/$BRANCHNAME"

# install

cd /path/to/moodle
php admin/cli/install.php [various params]


And than for update:

#!/bin/bash

git --git-dir="[/path/to/moodle]/.git/" --work-tree="[/path/to/moodle]" pull
git --git-dir="[/path/to/moodle]/mod/dataform/.git/" --work-tree="[/path/to/moodle]/mod/dataform" pull

# upgrade
cd /path/to/moodle
php admin/cli/upgrade.php




Average of ratings: Useful (2)
In reply to Darko Miletić

Re: Install multiple plugins or smart way to upgrade

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

That's for upgrading Moodle right? But that's not my concern. Upgrading Moodle is quite easy, the problem is the many (custom) plugins that are installed.

In reply to Richard van Iwaarden

Re: Install multiple plugins or smart way to upgrade

by Darko Miletić -

Please reread my message again focusing on the actual script examples. I gave you the response you asked for there.