View Issue Details

IDProjectCategoryView StatusLast Update
08675Bug reports[All Projects] Installationpublic2014-02-12 21:20
Reporteratisne 
Assigned Toc_schmitz 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Target VersionFixed in Version2.05+ 
Summary08675: Migration issue from 1.90 to 2.05
DescriptionI've experienced issues during the migration of limesurvey 1.90 to 2.05 with the postgresql DB update. (It seems to be the same as CrystalBlood [https://www.limesurvey.com/en/forum/installation-a-update-issues/95371-possible-bug-on-migrating-database-to-2-05].)
Steps To ReproduceInstructions of http://manual.limesurvey.org/Upgrading_from_a_previous_version
We use the admin web pages.
Issues are raised during the database update.
Additional InformationI fix the three errors as follow :

1- I deleted (and restore) primary key for the table 'labels' before alter column (because column 'language' is part of primary key).

+ dropPrimaryKey('labels');
             alterColumn('{{labels}}','language',"{$sVarchar}(20)",false , 'en');
+ addPrimaryKey('labels', array('lid', 'sortorder', 'language'));

2- I added TransactionBookmark when dropping index 'email' on table 'users' (because postgresql does not suffer failing during a transaction).

             try{
+ setTransactionBookmark();
                 $oDB->createCommand()->dropIndex('email','{{users}}');
             }
             catch(Exception $e)
             {
                 // do nothing
+ rollBackToTransactionBookmark();
             }

3- 1- I deleted primary key for the table 'user_in_groups' before alter column (because columns 'ugid' and 'uid' are part of primary key). Primary key are created some lines after.

+ dropPrimaryKey('user_in_groups');
             alterColumn('{{user_in_groups}}','ugid',"integer",false);
             alterColumn('{{user_in_groups}}','uid',"integer",false);

It works for me, but, as I am not sure this fix is relevant in all cases, I just provide a patch and not a pull request.
TagsNo tags attached.
Complete LimeSurvey version number (& build)140204
I will donate to the project if issue is resolvedNo
BrowserFireFox
Database & DB-VersionPostgresql 8.3
Operating System (Server)centOS
Webserver software & versionapache 2.2.3
PHP Version5.4.24

Relationships

Activities

atisne

2014-02-06 17:07

reporter  

patch (1,805 bytes)
--- updatedb_helper.php.orig	2014-02-06 14:17:19.000000000 +0100
+++ updatedb_helper.php	2014-02-06 15:04:08.000000000 +0100
@@ -502,7 +502,9 @@
 
             alterColumn('{{groups}}','group_name',"{$sVarchar}(100)",false , '');
             alterColumn('{{labels}}','code',"{$sVarchar}(5)",false , '');
+	    dropPrimaryKey('labels');
             alterColumn('{{labels}}','language',"{$sVarchar}(20)",false , 'en');
+	    addPrimaryKey('labels', array('lid', 'sortorder', 'language'));
             alterColumn('{{labelsets}}','label_name',"{$sVarchar}(100)",false , '');
             alterColumn('{{questions}}','parent_qid','integer',false ,'0');
             alterColumn('{{questions}}','title',"{$sVarchar}(20)",false , '');
@@ -572,11 +574,13 @@
             alterColumn('{{users}}','htmleditormode',"{$sVarchar}(7)",true,'default');
             alterColumn('{{users}}','dateformat','integer',false , 1);
             try{
+		setTransactionBookmark();
                 $oDB->createCommand()->dropIndex('email','{{users}}');
             }
             catch(Exception $e)
             {
                 // do nothing
+		 rollBackToTransactionBookmark();
             }
 
             $oDB->createCommand()->update('{{user_groups}}',array('name'=>''),"name is NULL");
@@ -892,6 +896,7 @@
             alterColumn('{{users}}','parent_id','integer',false);
             try { setTransactionBookmark(); alterColumn('{{surveys_languagesettings}}','surveyls_survey_id',"integer",false); } catch(Exception $e) { rollBackToTransactionBookmark(); }
             alterColumn('{{user_groups}}','owner_id',"integer",false);
+	    dropPrimaryKey('user_in_groups');
             alterColumn('{{user_in_groups}}','ugid',"integer",false);
             alterColumn('{{user_in_groups}}','uid',"integer",false);
 
patch (1,805 bytes)

c_schmitz

2014-02-07 15:08

administrator   ~28552

Thank you very much!

c_schmitz

2014-02-07 15:09

administrator   ~28553

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=13857

c_schmitz

2014-02-12 21:20

administrator   ~28684

2.05+ Build 140212 released

Related Changesets

LimeSurvey: master fc74fd2c

2014-02-07 14:08:33

c_schmitz

Details Diff
Fixed issue 08675: Migration issue from 1.90 to 2.05 if using Postgres - patch by atisne
mod - application/helpers/update/updatedb_helper.php Diff File

Issue History

Date Modified Username Field Change
2014-02-06 17:07 atisne New Issue
2014-02-06 17:07 atisne File Added: patch
2014-02-07 15:08 c_schmitz Assigned To => c_schmitz
2014-02-07 15:08 c_schmitz Status new => assigned
2014-02-07 15:08 c_schmitz Status assigned => resolved
2014-02-07 15:08 c_schmitz Fixed in Version => 2.05+
2014-02-07 15:08 c_schmitz Resolution open => fixed
2014-02-07 15:08 c_schmitz Note Added: 28552
2014-02-07 15:09 c_schmitz Changeset attached => LimeSurvey master fc74fd2c
2014-02-07 15:09 c_schmitz Note Added: 28553
2014-02-12 21:20 c_schmitz Note Added: 28684
2014-02-12 21:20 c_schmitz Status resolved => closed