- 11 Sep 2024
- 3 minutes to read
Upgrade to Totara 18
- Updated on 11 Sep 2024
- 3 minutes to read
Prerequisites
Before upgrading to Totara 18 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.
Note that web upgrade is disabled on sites that do not have an upgrade key configured. In order to upgrade to Totara 18 and future versions of Totara, please use the CLI upgrade script (php server/admin/cli/upgrade.php) or set a value for $CFG->upgradekey in config.php. You will need to enter the same key in the web upgrade form. This upgrade key will also be required for new installs run via the web interface.
Follow these steps to upgrade your Totara site:
- Log in as a Site Administrator.
- 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.
- Run cron.
- Enable maintenance mode in Totara (Quick-access menu > Server > Maintenance Mode).
- Disable cron.
- Log out.
- Back up the Totara database.
- Back up the site data directory.
- Back up the Totara source code directory.
- Make a copy of your config.php and any plugins you have installed.
- Remove the old source code - delete everything.
- Extract the new source code into the source code directory.
- Copy your config.php and any third-party plugins back into the source code directory.
- Modify your config.php as described in the Modifying your config.php section.
- Modify your web server configuration to point to the server directory.
- 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
- Review the information provided and confirm you want to continue.
- 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.
- Purge the caches:
sudo -u www-data php server/admin/cli/purge_caches.php
- Log in as a Site Administrator.
- Review and save changes to new settings (if any).
- Review your theme and test.
- Disable server maintenance mode.
- 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';
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 2024 Totara Learning Solutions. All rights reserved.