To automate our environment we wrote this bash script. It may won't work in your environment, but maybe you get some ideas for your own script.
- Clone this repository.
- Make the script executable (if not cloned):
chmod +x moodle-update - Go to your web directory:
cd /var/www - Rename the moodle directory to:
moodle_x.ylikemoodle_4.05 - Create a link to this directory with the absolute path:
ln -s /var/www/moodle_4.05 moodle - Tell your web server to serve
/var/www/moodle.
The script creates a settings.conf file for a standard Debian/Ubuntu Linux.
But don't worry: If something is not working, the tests will fail before any changes would be performed. Adapt the settings.conf to your needs and re-run the script.
- Without any parameter:
./moodle-update - With target version:
./moodle-update 4.05 - With target version + explicit download file:
./moodle-update 4.05 https://example.com/moodle-x.y.z.zip
For some reason the latest zip file name scheme has changed:
4.1is called401(instead of41)4.2is called402(instead of42)- (future versions may be affected too)
You need to enter 4.01 or 4.02 as version number to use the script for these versions!
-
Within a minor release (3.9.19 -> 3.9.21) you should be fine to use the
copy alloption. -
If you're updating from one minor release to another (3.9 -> 3.11) or upgrading from one major release to another (3.11 -> 4.0) some plugins should not be copied over. Please use a test server to figure out which of your installed plugins cause problems.