Hey guys,
so I have taken on the challenge to finally upgrade an ancient LimeSurvey installation from version 1.90+ Build 9118 to the most recent one (v4.1.13). This means a db upgrade from 143 to 425.
As I feared not everything went by smoothly.
First problems encountered:
Code:
mymachine:/srv/www/htdocs # php application/commands/console.php updatedb
Update mysql:host=localhost;port=3306;dbname=limesurvey; with prefix :lime_ from 143 to 425
Error: Call to undefined function dbExecuteAssoc() in /srv/www/htdocs/application/helpers/update/updatedb_helper.php:4427
Stack trace:
#0 /srv/www/htdocs/application/helpers/update/updatedb_helper.php(364): upgradeSurveys145()
#1 /srv/www/htdocs/application/commands/UpdateDbCommand.php(44): db_upgrade_all(143)
#2 /srv/www/htdocs/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run(Array)
#3 /srv/www/htdocs/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run(Array)
#4 /srv/www/htdocs/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
#5 /srv/www/htdocs/application/commands/console.php(64): CApplication->run()
I could solve this by fixing a few SQL queries in the source file:
vim /srv/www/htdocs/application/helpers/update/updatedb_helper.php
There were a few occurences of dbExecuteAssoc() which seem to have been replaced everywhere else by something along the lines of: Yii::app()->getDb()->createCommand($sSurveyQuery)->queryAll();
So I have replaced a few occurences in the source with things like that:
Code:
$oSurveyResult = Yii::app()->getDb()->createCommand($sSurveyQuery)->queryAll();
//$oSurveyResult = dbExecuteAssoc($sSurveyQuery);
foreach ( $oSurveyResult as $aSurveyRow )
See affected functions:
upgradeSurveys145(), upgradeQuestionAttributes148()
which may have to be fixed. Or just search the code for occurences of "dbExecuteAssoc".
Alright, with that fixed I reset the db to the old backup and restarted again:
Code:
mymachine:/srv/www/htdocs # php application/commands/console.php updatedb
Update mysql:host=localhost;port=3306;dbname=limesurvey; with prefix :lime_ from 143 to 425
PHP Error[2]: include(LimeExpressionManager.php): failed to open stream: No such file or directory
in file /srv/www/htdocs/framework/YiiBase.php at line 463
#0 /srv/www/htdocs/framework/YiiBase.php(463): include()
#1 unknown(0): autoload()
#2 /srv/www/htdocs/application/helpers/update/updatedb_helper.php(948): spl_autoload_call()
#3 /srv/www/htdocs/application/commands/UpdateDbCommand.php(44): db_upgrade_all()
#4 /srv/www/htdocs/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run()
#5 /srv/www/htdocs/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#6 /srv/www/htdocs/framework/base/CApplication.php(185): ConsoleApplication->processRequest()
#7 /srv/www/htdocs/application/commands/console.php(64): ConsoleApplication->run()
Taking a closer look:
vim /srv/www/htdocs/application/helpers/update/updatedb_helper.php
Around line 948:
Code:
if ($iOldDBVersion < 158)
{
$oTransaction = $oDB->beginTransaction();
LimeExpressionManager::UpgradeConditionsToRelevance();
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>158),"stg_name='DBVersion'");
$oTransaction->commit();
}
This is where it seems to break apart:
It seems to invoke LimeExpressionManager.php, which I can not find anywhere...
That's as far as I have come. Can you guys help out in any way?
Thank you very much in advance!
Best regards
Martin