In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
779 [In-Portal CMS] Install / Upgrages bug report always 2010-06-15 12:02 2010-07-22 15:07
alex  
alex  
normal  
closed 5.1.0-B2  
fixed  
 
none 5.1.0-RC1  
http://groups.google.com/group/in-portal-bugs/browse_thread/thread/e2637a0da4f53bdb
0
0000779: Upgrade from 4.3.9 to 5.1.0-RC1 of In-Portal fails
I have all modules (even paid) installed and I was trying to upgrade from 4.3.9 to 5.1.0-RC1. This all failed with large SQL error, that LanguageId column was missing in Phrase table, when upgrade script was trying to set index on it.

That's how we are performing upgrade through 2 or more versions now (e.g. from 5.0.0 to 5.0.2):

   1. run "before" php upgrade script for 5.0.1 version
   2. run "before" php upgrade script for 5.0.2 version
   3. run sqls from 5.0.1 to 5.0.2 version
   4. run "after" php upgrade script for 5.0.1 version
   5. run "after" php upgrade script for 5.0.2 version


This process is repeated for each upgradeable module.

I thought at first, that wrapping version upgrade scripts (php + sql) together will solve the problem:

   1. run "before" php upgrade script for 5.0.1 version
   2. run 5.0.1 version sqls
   3. run "after" php upgrade script for 5.0.1 version
   4. run "before" php upgrade script for 5.0.2 version
   5. run 5.0.2 version sqls
   6. run "after" php upgrade script for 5.0.2 version

But this wasn't helping. Because when 1st module upgrade scripts will delete column, that is used by 2nd module upgrade script, then we also got sql error.


And so another idea approached my mind: you all know, that don't have problems, when we upgrade for 1 version only (e.g. from 5.0.0 to 5.0.1 or from 5.0.1 to 5.0.2). I've created dependency list for each module, where I've listed what "Core" module version is required to perform successful upgrade to each of given module versions.
What's in the patch:

1. upgrade system failure, when large version range is used for upgrade
2. sql error on 5.0.3-B1 upgrade of In-Portal
3. empty "Cache Handler" configuration variable dropdown after upgrade to 5.1.0-RC1
4. skin upgrade system
5. incomplete orders were not deleted, when In-Commerce 5.0.1 upgrade was made
patch upgrade_system_fix_core.patch (47,269) 2010-06-15 12:02
http://tracker.in-portal.org/file_download.php?file_id=643&type=bug
patch upgrade_system_fix_modules.patch (11,645) 2010-06-15 12:02
http://tracker.in-portal.org/file_download.php?file_id=644&type=bug
patch normalizing_510_upgrade_sql.patch (1,234) 2010-06-15 12:18
http://tracker.in-portal.org/file_download.php?file_id=645&type=bug
Issue History
2010-07-22 15:07 alex Note Added: 0002585
2010-07-22 15:07 alex Status resolved => closed
2010-06-15 15:36 alex Note Added: 0002467
2010-06-15 15:36 alex Status reviewed and tested => resolved
2010-06-15 15:36 alex Fixed in Version => 5.1.0-RC1
2010-06-15 15:36 alex Resolution open => fixed
2010-06-15 15:36 alex Assigned To !COMMUNITY => alex
2010-06-15 15:36 alex Changeset attached 5.1.x r13780
2010-06-15 15:29 alex Changeset attached 5.1.x r13779
2010-06-15 15:29 alex Changeset attached 5.1.x r13778
2010-06-15 15:28 alex Changeset attached 5.1.x r13777
2010-06-15 15:28 alex Changeset attached 5.1.x r13776
2010-06-15 15:27 alex Changeset attached 5.1.x r13775
2010-06-15 15:26 alex Changeset attached 1.1.x r13774
2010-06-15 15:06 Dmitry Note Edited: 0002464 bug_revision_view_page.php?bugnote_id=0002464#r525
2010-06-15 15:06 Dmitry Note Added: 0002464
2010-06-15 15:06 Dmitry Status needs testing => reviewed and tested
2010-06-15 12:23 alex Note Added: 0002459
2010-06-15 12:20 alex Note Added: 0002458
2010-06-15 12:18 alex File Added: normalizing_510_upgrade_sql.patch
2010-06-15 12:02 alex Assigned To => !COMMUNITY
2010-06-15 12:02 alex Developer => alex
2010-06-15 12:02 alex Status active => needs testing
2010-06-15 12:02 alex File Added: upgrade_system_fix_modules.patch
2010-06-15 12:02 alex New Issue
2010-06-15 12:02 alex File Added: upgrade_system_fix_core.patch
2010-06-15 12:02 alex Reference => http://groups.google.com/group/in-portal-bugs/browse_thread/thread/e2637a0da4f53bdb

Notes
(0002458)
alex   
2010-06-15 12:20   
I've compared database structure of In-Portal (+ all modules) upgraded from 4.3.9, that was upgraded to 5.1.0-RC1 and In-Portal (+ all modules) thats was cleanly installed from 5.1.0-RC1.

Patch "normalizing_510_upgrade_sql.patch" contains minor fixes to make both database structure look same.
(0002459)
alex   
2010-06-15 12:23   
Also line:
ALTER TABLE Events
    ADD AllowChangingSender TINYINT NOT NULL DEFAULT '0' AFTER ReplacementTags ,

should be changed to
ALTER TABLE Events
    ADD AllowChangingSender TINYINT NOT NULL DEFAULT '0' AFTER MessageType ,

In upgrade_system_fix_core.patch patch.
(0002464)
Dmitry   
2010-06-15 15:06   
Tested UPGRADE from 4.3.9 to 5.1.0-RC1 good, but had to adjust install/upgrades.php

Moved this part:
=============
// migrate email events
                $table_structure = $this->Conn->Query('DESCRIBE ' . TABLE_PREFIX . 'Events', 'Field');

                if (!array_key_exists('Headers', $table_structure)) {
                    $sql = 'ALTER TABLE ' . TABLE_PREFIX . 'Events
                            ADD `Headers` TEXT NULL AFTER `ReplacementTags`,
                            ADD `MessageType` VARCHAR(4) NOT NULL default "text" AFTER `Headers`';
                    $this->Conn->Query($sql);
                }
=============

Before this part:

=============
// alter here, because kMultiLanguageHelper::createFields
// method, called after will expect that to be in database
                $sql = 'ALTER TABLE ' . TABLE_PREFIX . 'Events
                            ADD AllowChangingSender TINYINT NOT NULL DEFAULT "0" AFTER MessageType ,
                            ADD CustomSender TINYINT NOT NULL DEFAULT "0" AFTER AllowChangingSender ,
                            ADD SenderName VARCHAR(255) NOT NULL DEFAULT "" AFTER CustomSender ,
                            ADD SenderAddressType TINYINT NOT NULL DEFAULT "0" AFTER SenderName ,
                            ADD SenderAddress VARCHAR(255) NOT NULL DEFAULT "" AFTER SenderAddressType ,
                            ADD AllowChangingRecipient TINYINT NOT NULL DEFAULT "0" AFTER SenderAddress ,
                            ADD CustomRecipient TINYINT NOT NULL DEFAULT "0" AFTER AllowChangingRecipient ,
                            ADD Recipients TEXT AFTER CustomRecipient,
                            ADD INDEX (AllowChangingSender),
                            ADD INDEX (CustomSender),
                            ADD INDEX (SenderAddressType),
                            ADD INDEX (AllowChangingRecipient),
                            ADD INDEX (CustomRecipient)';
                $this->Conn->Query($sql);

(0002467)
alex   
2010-06-15 15:36   
Fix committed to 5.1.x branch. Commit Message:

Fixes 0000779: Upgrade from 4.3.9 to 5.1.0-RC1 of In-Portal fails
(0002585)
alex   
2010-07-22 15:07   
Closing, since 5.1.0 release has been released.