Upgrade Moodle

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

It is strongly recommended that you create a backup before starting the update process. If you have important data, it is advisable that you create and try to restore a backup to ensure that everything works properly.

Upgrade Moodle following these steps:

  • Move your current Moodle files:

    $ sudo mv installdir/apps/moodle/htdocs/ installdir/apps/moodle/htdocs.backup
  • Download the new Moodle version. An example is shown below (the XX placeholder in the command refers to the Moodle version number).

    $ wget
  • Create a new folder and uncompress the files:

    $ sudo mkdir installdir/apps/moodle/htdocs/
    $ sudo tar -xzvf moodle-latest-XX.tgz -C installdir/apps/moodle/htdocs/ --strip 1
  • Copy your previous configuration file and your modules or themes:

    $ sudo cp -a installdir/apps/moodle/htdocs.backup/config.php installdir/apps/moodle/htdocs/
    $ sudo cp -a installdir/apps/moodle/htdocs.backup/theme/MY_THEME installdir/apps/moodle/htdocs/theme/
    $ sudo cp -a installdir/apps/moodle/htdocs.backup/mod/MY_MOD installdir/apps/moodle/htdocs/mod/

NOTE: Replace the MY_THEME and MY_MOD placeholders with the directory or path names for your downloaded and installed themes and modules (these are different from the ones shipped by Bitnami).

  • Configure file permissions as follows:

    IMPORTANT: To change permissions file, in case you have installed the solution as root, use MYUSER:daemon as system user and group, respectively. Otherwise, simply use MYUSER:MYUSER.

    $ sudo chown bitnami:daemon -R installdir/apps/moodle/htdocs/
    $ sudo find installdir/apps/moodle/htdocs/ -type f -exec chmod 664 {} \;
    $ sudo find installdir/apps/moodle/htdocs/ -type d -exec chmod 775 {} \;
  • Navigate to the application from a browser and follow the steps to upgrade the database to the latest version.

    NOTE: If you want to install modules or plugins from the Moodle administration panel, refer to the migration steps.

Last modification June 5, 2019