CentOS Server - Moodle Update

Moodle Update Checklist

Moodle Update Checklist

Moodle Update Checklist

Moodle Update Checklist

  √ To Do
   

Preparation

1   Downloading Moodle
2   Adding plugins
3   Moodle maintenance mode
   

Backups

4   Backup the Moodle database
5   Backup the Moodle data folder
6   Backup Moodle config.php
   

Upgrading Moodle

7   Upgrading Moodle
8   Post upgrade tasks

 

Preparation

Preparation

Downloading Moodle

Getting the latest version of Moodle

  1. Go to the download page of Moodle

    https://download.moodle.org/releases/latest/

  2. Check and ensure that the server meets the minimum requirements for the latest version of Moodle
  3. Update the server if necessary
  4. Download the latest version of Moodle
  5. Unzip/untar the download package

    unzip file.zip -d /path/to/directory

    or

    tar -C /path/to/directory -zxvf file.tar.gz
Preparation

Adding plugins

Adding plugins

  1. Log in to the current version of Moodle as an administrator
  2. Expand the Site Administrator menu

    026.PNG

  3. Expand the Plugins menu

    027.PNG

  4. Click Plugins Overview

    028.PNG
  5. Click Additional Plugins

    029.PNG

  6. Make a note of all the additional plugins
  7. Navigate to Moodle plugins directory

    https://moodle.org/plugins/

  8. Search and download each of the plugins
  9. Extract and add to the plugin to one of the correct common paths below
/path/to/moodle/theme/ - themes
/path/to/moodle/mod/ - activity modules and resources
/path/to/moodle/blocks/ - sidebar blocks
/path/to/moodle/question/type/ - question types
/path/to/moodle/course/format/ - course formats
/path/to/moodle/admin/report/ - admin reports
Preparation

Moodle Maintenance Mode

Moodle Maintenance Mode

  1. Log in as an administrator
  2. Expand the Administrator panel

    026.PNG

  3. Expand the Server sub-menu and click Maintenance Mode

    030.PNG

  4. Enable Maintenance mode, add an addition message if necessary and save the changes

    031.PNG

Backups

Backups

Backup The Moodle Database

Moodle Database Backup

MySQL Database Dump

  1. Backup Moodle database with the command below
mysqldump -u [username] –p[password] [database_name] > [dump_file.sql]

The parameters of the said command as follows:

  [username] - A valid MySQL username
  [password] - A valid MySQL password for the user (leave empty to be prompted for password)
  [database_name] - A valid Database name you want to take backup
  [dump_file.sql] - The name of backup dump file you want to generate

Downloading the file

  1. Download the file a backup medium for safekeeping
Backups

Backup The Moodle Data Folder

Backing Up The Moodle Data Folder

Compress the data folder

  1. Compress the Moodle data folder with the command below
tar -czvf name-of-archive.tar.gz /path/to/moodle-data-folder

Here’s what those switches actually mean:

  -c: Create an archive.
  -z: Compress the archive with gzip.
  -v: Display progress in the terminal while creating the archive, also known as “verbose” mode. 
      The v is always optional in these commands, but it’s helpful.
  -f: Allows you to specify the filename of the archive.

Downloading the file

  1. Once the folder is compressed, download to a backup medium for safekeeping
Backups

Backup Moodle Config.php

Although not necessary, you can also backup the Moodle directory and not just the config.php file.

Follow the same steps set out in Backup the Moodle Data Folder

Backing Up Moodle's Config File

  1. Copy the config.php found in the root directory of the Moode installation to a safe medium backup medium

Upgrading Moodle

Upgrading Moodle

Upgrading Moodle

Upgrading Moodle

  1. Rename the current production Moodle folder

    mv /path/to/current/moodle-folder/ /path/to/current/moodle-folder_old

  2. Upload/copy/move the new installation folder and rename to current Moodle production folder, i.e. if the production folder was named learn.azandi.co.za then rename the new folder to learn.azandi.co.za
  3. Restore the permissions/ownership of the folder and files

    chowen -R apache:apache /path/to/current/moodle-folder

  4. Navigate to the Moodle platform website in a browser and follow the onscreen prompts
Upgrading Moodle

Post Upgrade Tasks

Post Upgrade Tasks

  1. Check and restore all custom settings where necessary
  2. Check Moodle to ensure site is functioning as at it should and rectify any issues
  3. Take Moodle out of maintenance mode