How to update Moodle

In order to allow a simplified update of Moodle, its installation was done using Git. To update Moodle, perform the following operations, using the command line.

Info

As of MoodleBox version 2.5.1 and later, use sudo -u moodlebox -g www-data git pull instead of sudo -u www-data git pull in the commands indicated below.

Log into the MoodleBox via SSH, with the usual password Moodlebox4$.

ssh moodlebox@moodlebox.home

Update to a minor version

To update to the next minor version of Moodle (3.5.1, 3.5.2, etc.), type the following commands in the terminal:

cd /var/www/moodle/
sudo -u www-data git pull

Visit then in your browser the URL http://moodlebox.home/admin and follow the update instructions, like any Moodle installation (read the documentation).

Update to a major version

To update to the next major version of Moodle (3.6, 3.7, etc.), type the additional following commands:

sudo -u www-data git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
sudo -u www-data git fetch origin
sudo -u www-data git pull
sudo -u www-data git checkout MOODLE_35_STABLE

Then visit the URL http://moodlebox.home/admin and follow the update instructions, just like above.