Thursday, June 21, 2012

Upgrading Mahara to version 1.5.1

Upgrade from 1.4.1 to 1.5.1

To be on the safe side backup up the database before proceding with the upgrade:

[root@vle bin]# pg_dump -U mahara mahara > ../mahara_dump_June12

I used the following modified script for the upgrade:

[root@vle bin]# cat upgrademahara
cd /root
echo "Please put Mahara into maintenance mode before performing the upgrade
"echo "Press any key when ready"
read dummy
echo "Enter new version number of Mahara (must be 1.5 series) to upgrade to e.g. 1.5.1"
read newver
echo "Enter existing version number of Mahara to backup e.g. 1.4.1"
read oldver
mv /var/www/html/mahara /root/mahara_old_$oldver
tar -xzvf mahara-$newver.tar.gz
cd mahara-$newver
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_$oldver/config.php /var/www/html/mahara
cp -pr /root/mahara_old_$oldver/artefact/outcome /var/www/html/mahara/artefact
echo "Please visit to complete the upgrade"

On visiting the upgrade page two errors appeared

Your PHP session.entropy_length setting is too small. Set it to at least 16 in your php.ini to ensure that generated session IDs are random and unpredictable enough.
No site-wide password salt has been set. Edit your config.php and set the "passwordsaltmain" parameter to a reasonable secret phrase.

It was necessary to edit /etc/php.ini and set the session.entropy_length parameter as follows

session.entropy_length = 16

[root@vle bin]# nano /etc/php.ini

After which Apache was restarted for the changes to take effect:

[root@vle bin]# service httpd restart

A number of additional lines needed to be added to the existing config.php file:

// If set, this email address will be displayed in the error message if a form
// submission is suspected of being spam. This reduces the frustration for the
// user in the event of a false positive.
$cfg->emailcontact = '';

// Set this to enable a secondary hash that is only present in the config file
$cfg->passwordsaltmain = 'some long random string here with lots of characters'';

// When changing the salt (or disabling it), you will need to set the current salt as an alternate salt
// There are up to 20 alternate salts
$cfg->passwordsaltalt1 = 'another long random string here with lots of characters'';

// closing php tag intentionally omitted to prevent whitespace issues

The following commands were used to edit config.php

[root@vle bin]# cd /var/www/html/mahara/
[root@vle mahara]# nano config.php

On refreshing the Mahara admin screen the error messages had gone away and I was able to login as the administrator

No comments:

Post a Comment