Upgrade from 3.2

This document provides the steps to upgrade from TAO 3.2 to 3.3.

For TAO 3.3 you will need to upgrade your system to PHP 7.2. This PHP version upgrade can be done either before the upgrade to TAO 3.3 or after.

Prepare your system

To perform the upgrade, you will need to download _TAO_3.3.0_composersupdate.zip and _configtemplates.zip to your server:

sudo wget https://adminguide.taotesting.com/3.3/resources/installation/TAO_3.3.0_composers_update.zip
sudo wget https://adminguide.taotesting.com/3.3/resources/installation/config_templates.zip

Note: You should perform a full backup of your TAO after the maintenance mode is enabled.

Before you begin, extract the TAO_3.3.0_composers_update.zip package into a temporary folder which will be referred to as in this document. These composer files will be used during the 2-step upgrade process to TAO 3.3.

You will need to change to the directory where you have installed TAO which we will refer to as . In this guide we have used /var/www/html/tao but you may be in a different subdirectory under /var/www/html/:

cd <tao_root>

The current path ‘.’ will now refer to ‘.’ .

Before you begin the upgrade you will want to put your TAO installation into maintenance mode:

sudo -u www-data php index.php 'oat\tao\scripts\tools\maintenance\Disable'

Begin the upgrade

The first step of the upgrade requires you to overwrite the composer files (composer.json and composer.lock) located at the TAO root with the composer files in the temporary folder /TAO_3.3.0_sprint-80_transition:

cp <tmp>/TAO_3.3.0_sprint-80_transition/composer.{json,lock} .

Now run a composer install so that all extensions can be updated accordingly:

composer install

*Note: When executing this command, there may be an issue related to generated files in the /taoQtiItem, /taoQtiTest, or /tao subfolders. Should this occur, remove the subfolder and rerun the command.

When the command has finished, reset the permissions:

sudo chown -R www-data:www-data . && sudo chmod -R ug+rwX .

To continue the upgrade, you will need to make some configuration changes utilizing the contents of the config_templates.zip package.

Create the taoTestTaker folder in the config directory:

sudo -u www-data mkdir config/taoTestTaker

If you previously had the taoDacSimple extension installed, you will need to copy the configuration file templates for that extension:

cp -r config_templates/config/taoDacSimple/ config/ -v

If you previously had the taoEventLog extension installed you will need to copy the configuration file templates for that extension:

cp -r config_templates/config/taoEventLog/ config/ -v

If the taoDacSimple extension is installed, please remove this reference at this step by removing the corresponding block from config/generis/installation.conf.php:

nano config/generis/installation.conf.php

and remove this section:

'taoDacSimple' => array(
    'installed' => '2.0.3',
    'enabled' => true
)

Note: Keeping this reference would make the update attempt fail though you will be able to reinstall it later.

To monitor the upgrade, you can use the config_templates/config/generis/log.conf.php file provided so that the UDP logger will be active if you have not already logged in. To run the UDP listener you will need to open another session and run the following:

php UDPListener.php

Note: You can get the UDPListener.php file from here if you do not have extension-tao-devtools installed.

You are now ready to run the TAO update script:

sudo -u www-data php tao/scripts/taoUpdate.php

Once completed your TAO installation should be updated to a transitional version halfway between TAO 3.2 and TAO 3.3.

Continue the upgrade

To proceed with the second part of the upgrade, you will need to overwrite the composer files located at the TAO root with the composer files in the temporary folder /TAO_3.3.0_sprint-96-97_final:

cp <tmp>/TAO_3.3.0_sprint-96-97_final/composer.{json,lock} .

You will now run composer install so that all extensions can be updated:

composer install

Once completed reset permissions:

sudo chown -R www-data:www-data . && sudo chmod -R ug+rwX .

You may now need to remove references to the taoOpenWebItem and taoTestLinear extensions which are deprecated as of TAO 3.3.0:

nano config/generis/installation.conf.php

and remove these sections:

'taoOpenWebItem' => array(
       'installed' => '3.0.0',
       'enabled' => true
   ),
   [...]
   'taoTestLinear' => array(
       'installed' => '3.0.0',
       'enabled' => true
   )

*Note: It is necessary to drop these references and not set the ‘enabled’ parameter to false.

You are now ready to run the TAO update script again:

sudo -u www-data php tao/scripts/taoUpdate.php

Your TAO should now be updated to the final TAO 3.3.0 version.

Final steps

You may now turn off maintenance mode with the following:

sudo -u www-data php index.php 'oat\tao\scripts\tools\maintenance\Enable'

If taoDacSimple was installed prior to this update, reinstall it using the following command:

sudo -u www-data php tao/scripts/taoExtensions.php -a install -u <user> -p <password> -e taoDacSimple -vvv

Optional installation of locales

To fully migrate TAO so that it matches a freshly installed version, you may want to install the 21 missing locales added with TAO 3.3 by running the following script:

locales=("ar-arb" "ca-ES-valencia" "ca" "cs-CZ" "el-GR" "fa-IR" "fi-FI" "fr-CA" "gl" "hu-HU" "id-ID" "lb-LU" "lt-LT" "mn-MN" "nb-NO" "nl-BE" "pl-PL" "pt-BR" "ru-RU" "sk-SK" "th-TH" "vi-VN")
TAO_LOGIN=<user>
TAO_PWD=[<password>
for i in ${!locales[*]}; do
    sudo -u www-data php tao/scripts/taoRDFImport.php -v -n -u=${TAO_LOGIN} -p=${TAO_PWD} http://www.tao.lu/Ontologies/TAO.rdf# -i tao/locales/${locales[$i]}/lang.rdf
    done

Note: Do not run this script more than once or you may get duplicate locales.