googlemoodle

Upgrade Bitnami LMS powered by Moodle(TM) LMS

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

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 Bitnami LMS powered by Moodle™ LMS following these steps, depending on your installation type:

Approach A: Bitnami installations using system packages

  • Move your current Moodle LMS files:

    $ sudo mv /bitnami/moodle /bitnami/moodle.backup
    
  • Download the new Moodle LMS version. See the example below (the X.Y placeholder in the command refers to the Moodle LMS version number).

    $ wget http://download.moodle.org/download.php/direct/stableX.Y/moodle-latest-X.y.tgz
    
  • Create a new folder and uncompress the files:

    $ sudo mkdir /bitnami/moodle
    $ sudo tar -xzvf moodle-latest-X.Y.tgz -C /bitnami/moodle --strip 1
    
  • Copy your previous configuration file and your modules or themes:

    $ sudo cp -a /bitnami/moodle.backup/config.php /bitnami/moodle/
    $ sudo cp -a /bitnami/moodle.backup/theme/MY_THEME /bitnami/moodle/theme/
    $ sudo cp -a /bitnami/moodle.backup/mod/MY_MOD /bitnami/moodle/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:

    $ sudo chown daemon:daemon -R /opt/bitnami/moodle
    $ sudo chmod -R g+rwX /opt/bitnami/moodle
    $ sudo chown root /opt/bitnami/moodle/config.php
    $ sudo chmod 640 /opt/bitnami/moodle/config.php
    
  • 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.

Approach B (Self-contained Bitnami installations

  • Move your current Moodle LMS files:

    $ sudo mv /opt/bitnami/apps/moodle/htdocs/ /opt/bitnami/apps/moodle/htdocs.backup
    
  • Download the new Moodle LMS version. See the example below (the X.Y placeholder in the command refers to the Moodle LMS version number).

    $ wget http://download.moodle.org/download.php/direct/stableX.Y/moodle-latest-X.Y.tgz
    
  • Create a new folder and uncompress the files:

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

    $ sudo cp -a /opt/bitnami/apps/moodle/htdocs.backup/config.php /opt/bitnami/apps/moodle/htdocs/
    $ sudo cp -a /opt/bitnami/apps/moodle/htdocs.backup/theme/MY_THEME /opt/bitnami/apps/moodle/htdocs/theme/
    $ sudo cp -a /opt/bitnami/apps/moodle/htdocs.backup/mod/MY_MOD /opt/bitnami/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:

    $ sudo chown bitnami:daemon -R /opt/bitnami/apps/moodle/htdocs/
    $ sudo find /opt/bitnami/apps/moodle/htdocs/ -type f -exec chmod 664 {} \;
    $ sudo find /opt/bitnami/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 November 17, 2020