Upgrade from OJS 2.8.4-1 to 3.2.1rc1

Hi,

I am testing the upgrade from OJS 2.8.4-1 to 3.2.1rc1.

Mysql 8.0.20
PHP 7.3.16

I got the same error as SQL error on 3.2.0->3.2.1RC upgrade · Issue #5967 · pkp/pkp-lib · GitHub. I have applied the patch but I keep getting the same error.

I have enabled show_stacktrace =On and debug = On

[pre-install]
[load: upgrade.xml]
[version: 3.2.1.0]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::syncSeriesAssocType]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_usageStatistics2.xml (skipped)]

[code: Installer Installer::removeReviewEntries]
[data: dbscripts/xml/upgrade/3.0.0_preupdate.xml]
[data: dbscripts/xml/upgrade/3.0.0_adaptTimedViews.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_adaptReferrals.xml]
[data: dbscripts/xml/upgrade/3.0.0_adaptBooksForReview.xml]
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_preupdate_commentsToEditor.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml]
[data: dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml]

[code: Installer Installer::migrateSubmissionCoverImages]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_email_templates.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning_articleGalleySettings.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_last_activity.xml]
[data: dbscripts/xml/upgrade/3.2.1_preupdate_subeditor_categories.xml]

Warning: assert(): assert(false) failed in E:\web\revistascsic_pru_migracion\loquens321rc1\lib
pkp\classes\db\DBDataXMLParser.inc.php on line 145
ADOConnection._Execute(ALTER TABLE subeditor_submission_group CHANGE COLUMN section_id assoc_id , false)% line 1241, file: E:\web\revistascsic_pru_migracion\loquens321rc1\lib\pkp\lib\vendor\adodb\adodb-php\adodb.inc.php
ADOConnection.Execute(ALTER TABLE subeditor_submission_group CHANGE COLUMN section_id assoc_id )% line 442, file: E:\web\revistascsic_pru_migracion\loquens321rc1\lib\pkp\classes\install\Installer.inc.php
Installer.executeSQL(ALTER TABLE subeditor_submission_group CHANGE COLUMN section_id assoc_id )% line 437, file: E:\web\revistascsic_pru_migracion\loquens321rc1\lib\pkp\classes\install\Installer.inc.php
Installer.executeSQL(Array[1])% line 437, file: E:\web\revistascsic_pru_migracion\loquens321rc1\lib\pkp\classes\install\Installer.inc.php
Installer.executeSQL(Array[7])% line 395, file: E:\web\revista
scsic_pru_migracion\loquens321rc1\lib\pkp\classes\install\Installer.inc.php
ERROR: Upgrade failed: DB: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1

And on php-log:

06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): select version()
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): SHOW INDEXES FROM section_editors
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): SHOW INDEXES FROM section_editors
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): SHOW INDEXES FROM section_editors
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): SHOW INDEXES FROM section_editors
[06-Jun-2020 17:36:56 Europe/Berlin] PHP Warning: assert(): assert(false) failed in E:\web\revistascsic_pru_migracion\loquens321rc1\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 145
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): DROP INDEX section_editors_pkey ON section_editors
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): DROP INDEX section_editors_section_id ON section_editors
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): DROP INDEX section_editors_user_id ON section_editors
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): RENAME TABLE section_editors TO subeditor_submission_group
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: -----
(mysqli): ALTER TABLE subeditor_submission_group CHANGE COLUMN section_id assoc_id
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: Query: ALTER TABLE subeditor_submission_group CHANGE COLUMN section_id assoc_id failed. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1
[06-Jun-2020 17:36:56 Europe/Berlin] PKP-Database-Logger 1591457812.0117: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1

The query is missing the “DataType” of the column:

ALTER TABLE subeditor_submission_group CHANGE COLUMN section_id assoc_id

It should not be like that?

ALTER TABLE subeditor_submission_group CHANGE COLUMN section_id assoc_id BIGINT NOT NULL

If I change the line:

< rename table=“subeditor_submission_group” column=“section_id” to=“assoc_id” />

in “dbscripts\xml\upgrade\3.2.1_preupdate_subeditor_categories.xml”:

By:

< query> ALTER TABLE subeditor_submission_group CHANGE COLUMN section_id assoc_id BIGINT NOT NULL< /query>

The upgrade is successful

Thank you very much
Regards

Hi @juanf.csic,

If you change dbscripts/xml/upgrade/3.2.1_preupdate_subeditor_categories.xml, and reverse the order of the lines:

<rename table="section_editors" to="subeditor_submission_group" />
<rename table="subeditor_submission_group" column="section_id" to="assoc_id" />

…to…

<rename table="subeditor_submission_group" column="section_id" to="assoc_id" />
<rename table="section_editors" to="subeditor_submission_group" />

…does that resolve the issue?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec

If I reverse the order the lines, I would have to change the line:

<rename table = "subeditor_submission_group" column = "section_id" to = "assoc_id" />

to:

<rename table = "section_editors" column = "section_id" to = "assoc_id" />

Because the table “section_editors” has not yet been renamed to “subeditor_submission_group”

It would be this way:

<rename table = "section_editors" column = "section_id" to = "assoc_id" />
<rename table = "section_editors" to = "subeditor_submission_group" />

If I put it like this, the upgrade is successful!

Thank you very much

Regards

Hi @juanf.csic,

Sorry, yes, that’s what I meant. Thanks for confirming!

Regards,
Alec Smecher
Public Knowledge Project Team