Visit NES for Moodle Home Page

NES for Moodle Installation Guide

Learn how to install NES for Moodle by direct download over an existing Moodle 4.3 site.

Installation Method

NES for Moodle is distributed as a downloadable archive that you extract over your existing Moodle 4.3 site. Direct download is the only supported installation method.

Before You Begin

Confirm your platform

Check your PHP and database versions against the Supported Platforms matrix.

Confirm your current Moodle version

NES for Moodle is a drop-in replacement for Moodle 4.3.12, the final release of the 4.3 line, and your site must already be running exactly that version. If you are on an earlier 4.3.x release, upgrade to 4.3.12 through your normal Moodle upgrade process first.

From the admin interface: go to Site administration → Notifications. The Moodle version is shown at the bottom of the page.

From the command line:

sudo -u www-data php admin/cli/cfg.php --name=release

Enable maintenance mode

From the admin interface: go to Site administration → Server → Maintenance mode and set Maintenance mode to Enable.

From the command line:

sudo -u www-data php admin/cli/maintenance.php --enable

Pause scheduled tasks

Maintenance mode blocks web traffic but does not stop a system cron job from invoking admin/cli/cron.php. Stop or disable your cron runner before extracting, and re-enable it once the database update has finished.

Back up

Back up your dirroot or Moodle webroot, your moodledata directory, and your database.

Disable the built-in update checks

Moodle's built-in update check queries download.moodle.org, which does not know about NES for Moodle releases. Left enabled, it reports your site as out of date and can offer to deploy upstream Moodle over your NES files - including from the Notifications page you use later in this guide. Set both of these in config.php before you continue:

$CFG->disableupdatenotifications = true;
$CFG->disableupdateautodeploy = true;

Download and Install

Download the archive

CLI

Download the archive using your NES Access Token as the bearer token. Replace the version with the latest from the release notes:

NES_ACCESS_TOKEN=<your-access-token-beginning-with-"pat-">
curl --header "Authorization: Bearer $NES_ACCESS_TOKEN" --output ~/release.zip \
--location https://registry.nes.herodevs.com/composer/pkg/neverendingsupport/moodle/4.3.14+4.3.12:moodle/release.zip

Browser

Go to the URL for the current release which should be the following, but with the most recent version: https://registry.nes.herodevs.com/composer/pkg/neverendingsupport/moodle/4.3.14+4.3.12:moodle/release.zip

You will be prompted to enter a username and password. Use the email address associated with your NES subscription for the username and your PAT (personal access token) as the password. The file will download to your chosen location.

You can also download through your browser using Basic Authentication. See Direct Downloads for instructions.

Extract over your existing site

Linux/macOS
Windows
unzip -o ~/release.zip -d /path/to/moodle

When in doubt, use the full path to your Moodle installation.

Your own files are left alone. The archive contains Moodle core, so contributed plugins in mod/, local/, blocks/, and auth/, custom themes in theme/, and your config.php are not touched by the extraction. Changes you made inside Moodle core are overwritten - reapply them afterwards.

Apply the database update

From the admin interface: log in as an administrator and go to Site administration → Notifications. Moodle detects the new version on disk and starts the update process - review the version and environment pages, then confirm to apply the database update. Afterwards, purge caches from Site administration → Development → Purge caches.

From the command line:

sudo -u www-data php admin/cli/upgrade.php
sudo -u www-data php admin/cli/purge_caches.php

Disable maintenance mode

From the admin interface: go to Site administration → Server → Maintenance mode and set Maintenance mode to Disable.

From the command line:

sudo -u www-data php admin/cli/maintenance.php --disable

Verify your site works as expected, re-enable your cron runner, then delete the downloaded archive at ~/release.zip.

Rolling Back

If the upgrade fails, or the site does not come back healthy, restore the backups you took in Before You Begin. Restore the codebase and the database together: admin/cli/upgrade.php writes schema changes, so a restored database will not match NES code on disk, and restored code will not match an upgraded database.

Re-enable maintenance mode

sudo -u www-data php admin/cli/maintenance.php --enable

Restore the codebase

Replace dirroot with your pre-install backup. Do not extract the NES archive again.

Restore the database

Restore the database dump you took before the install, into the database your config.php points at.

Purge caches and bring the site back

sudo -u www-data php admin/cli/purge_caches.php
sudo -u www-data php admin/cli/maintenance.php --disable

Your moodledata directory does not normally need to be restored - purging caches is enough. If you do restore an older moodledata, make sure it matches the database you restored.

Tell us what went wrong at support@herodevs.com and we will help you get the install through on the next attempt.

Next Steps

Confirm the install with Verifying an NES for Moodle Installation.

Your site will still compare itself against download.moodle.org and consider itself out of date. That is expected. The settings you applied in Before You Begin stop Moodle from acting on it.

Every NES release ships a new $version. To apply a later release, repeat Before You Begin and Download and Install with the new archive, including the database update. Moodle does not record the new version until the update runs.

The release notes are updated with every NES for Moodle release, and HeroDevs emails customers a monthly release summary. If you are not receiving it, contact support@herodevs.com.