Upgrade to Totara 16
  • 28 Feb 2022
  • 3 Minutes to read

Upgrade to Totara 16


Prerequisites

Before upgrading to Totara 16 please ensure your site has been upgraded to at least Totara 13 and check that your server meets the minimum requirements described in the server system requirements. Additionally, there are several factors you will need to consider when upgrading a Totara site.

Upgrade process

Please note that the upgrade process for Totara 14 onwards differs from most previous major releases as the codebase was reorganised for Totara 13, and the distribution now includes Totara Learn, Perform and Engage.

For more information on these changes please see Totara 13 code reorganisation and Totara 13 notable technical changes.

Follow these steps to upgrade your Totara site:

  1. Log in as a Site Administrator.
  2. Check the live logs to check if any users are currently using the site (Quick-access menu > Reports > Live Logs). The site will be offline while the upgrades are performed.
  3. Run cron.
  4. Enable maintenance mode in Totara (Quick-access menu > Server > Maintenance Mode).
  5. Disable cron.
  6. Log out.
  7. Back up the Totara database.
  8. Back up the site data directory.
  9. Back up the Totara source code directory.
  10. Make a copy of your config.php and any plugins you have installed.
  11. Remove the old source code - delete everything.
  12. Extract the new source code into the source code directory.
Do not copy the new code on top of the existing code folder.
  1. Copy your config.php and any third-party plugins back into the source code directory.
  2. Modify your config.php as described in the Modifying your config.php section.
  3. Modify your web server configuration to point to the server directory.
This is a significant change to web server configuration and enables us to present a more secure solution. Failing to change your web server configuration to serve the server directory will compromise the security of your site.
  1. Run the command below in your terminal, replacing www-data with your web user's username (if using a Linux- or Unix-based system), otherwise, you can navigate to the site URL (redirected automatically) to perform the upgrade via the browser.
    sudo -u www-data php server/admin/cli/upgrade.php
  1. Review the information provided and confirm you want to continue.
  2. Carefully check the output in the terminal and ensure no errors were encountered.

If you have encountered an error the site will need to be rolled back, the issue fixed, and then the upgrade attempted again.

If you have encountered an error the site will need to be rolled back, the issue fixed, and then the upgrade attempted again.
  1. Purge the caches:
sudo -u www-data php server/admin/cli/purge_caches.php
  1. Log in as a Site Administrator.
  2. Review and save changes to new settings (if any).
  3. Review your theme and test.
  4. Disable server maintenance mode.
  5. Re-enable cron and let it run.

Congratulations, your site is now upgraded. Read changelog.md for details on what is new.

What to do if the upgrade fails

When an upgrade fails for any reason the best course of action is to roll back to the last known good working state. It is likely you will roll back to the backups you took immediately before the upgrade (steps 7-9 in the upgrade process above). Fix the error, and then proceed through the upgrade again.

If you are unsure why the upgrade failed, or are unsure of how to fix it please reach out to us via our help desk.

Attempting to resume an upgrade that has previously failed should not be attempted unless you fully understand the nature of the failure and are sure that the site data is still in a valid state. If at all unsure we recommend rolling back and restarting the upgrade process.

Modifying your config.php

You need to update your existing config.php file with the following changes.

Remove the following line if it exists near the top of the config.php file:

global $CFG;

Add a flavour declaration specifying which flavour the site should be using:

$CFG->forceflavour = 'flavourname';
For more information and a list of available flavours, see the documentation on changing flavours.

Remove this line (or any similar one) from the bottom of config.php:

require_once(dirname(__FILE__) . '/lib/setup.php');

Your config.php should remain in the top-level folder (do not move it to server/config.php).

© Copyright 2022 Totara Learning Solutions. All rights reserved.


Was this article helpful?

First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.