2.4.5 upgrade to 3.1.1-2 fails

Greetings!

I am trying to move a journals from OJS 2.4.5 on Ubuntu to 3.1.1-2 in XAMPP on Windows Server 2016 on a test VMWare Workstation. I copied the new OJS files into XAMPP/htdocs/journals, removed the “read only” attribute from the prescribed folders and imported mysqldump into MariaDB.

Server type: MariaDB 10.1.32
Web server: Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.5
PHP extension: mysqli, curl, mbstring

Now, when I run upgrade in a browser, after 45 minutes it shows me:

DB Error: Column ‘user_id’ cannot be null.

After setting “installed” to “on” in config.inc.php, I can see that the journal lost all its visual formatting, but I can login into the admin interface and see that I am still on the same 2.4.5 version. I read through similar upgrade question in the forum, but I am still lost. What should I try to successfully upgrade?

Bellow is the php_error_log:

[18-Jul-2018 19:08:20] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\index.php on line 63
[18-Jul-2018 19:08:20] ojs2: DB Error: Unknown column ‘context_id’ in ‘on clause’
[18-Jul-2018 19:08:55] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\index.php on line 63
[18-Jul-2018 19:08:56] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[18-Jul-2018 19:08:56] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\index.php on line 63
[18-Jul-2018 19:08:56] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[18-Jul-2018 19:08:56] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\xampp\htdocs\journal\lib\pkp\pages\install\InstallHandler.inc.php on line 118
[18-Jul-2018 19:08:57] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\index.php on line 63
[18-Jul-2018 19:08:57] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[18-Jul-2018 19:08:59] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\index.php on line 63
[18-Jul-2018 19:08:59] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[18-Jul-2018 19:09:00] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\journal\cache\t_compile\e8ea13aa559bf8604ca823015b397a28d8666486^%%8B^8BC^8BC56207%%usernav.tpl.php on line 100
[18-Jul-2018 19:09:06] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\index.php on line 63
[18-Jul-2018 19:09:06] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[18-Jul-2018 19:09:06] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\xampp\htdocs\journal\lib\pkp\pages\install\InstallHandler.inc.php on line 118
[18-Jul-2018 19:09:09] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\index.php on line 63
[18-Jul-2018 19:09:09] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[18-Jul-2018 19:09:09] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\journal\cache\t_compile\e8ea13aa559bf8604ca823015b397a28d8666486^%%8B^8BC^8BC56207%%usernav.tpl.php on line 100
[18-Jul-2018 19:09:48] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\index.php on line 63
[18-Jul-2018 19:09:48] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[18-Jul-2018 19:09:48] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\xampp\htdocs\journal\lib\pkp\pages\install\InstallHandler.inc.php on line 118
[18-Jul-2018 19:10:08] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
<… the DBDataXMLParser.inc.php message repeats a dozen times …>
[18-Jul-2018 19:10:13] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[18-Jul-2018 19:51:03] PHP Warning: Declaration of SubmissionLanguageEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionLanguageEntryDAO.inc.php on line 20
[18-Jul-2018 19:51:04] PHP Warning: Declaration of SubmissionKeywordEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionKeywordEntryDAO.inc.php on line 45
[18-Jul-2018 19:51:08] PHP Warning: Declaration of SubmissionDisciplineEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionDisciplineEntryDAO.inc.php on line 44
[18-Jul-2018 19:51:09] PHP Warning: Declaration of SubmissionAgencyEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionAgencyEntryDAO.inc.php on line 44
[18-Jul-2018 19:51:31] PHP Warning: Declaration of SubmissionSubjectEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionSubjectEntryDAO.inc.php on line 44
[18-Jul-2018 19:52:51] ojs2: DB Error: Column ‘user_id’ cannot be null

Hi @Lolekbolek

Hmmm… Did you try to first install 3.1.1-2 anew, so that you are sure that your new server environment is functioning correctly and to exclude that possible errors? When this is all right, then maybe try the upgrade…

Best,
Bozana

Thank you, Bozana. I’ve purged everything and installed 3.1.1.2 from scratch and I can see it in “System Information”.

What steps should I follow now to import my 2.4.5 into this fresh 3.1.1.2 installation?

I tried to import the journal from the old server by:

  1. importing mysqldump,
  2. copying the ‘files’ directory,
  3. copying ‘public’ directory and removing the ‘read only’ attribute,
  4. merging config.inc.php files.

When I run a web upgrade, I am right away shown “DB Error: Table ‘journals.articles’ doesn’t exist”.

When I run a check in CLI, I have this:

Administrator@OJS c:\xampp\htdocs\journal

php tools/upgrade.php check

Code version: 3.1.1.2
Database version: 2.4.5.0
Latest version: 3.1.1.2
Database version is older than code version
Run “tools/upgrade.php upgrade” to update

When I run an upgrade in CLI, I see this:

Administrator@OJS c:\xampp\htdocs\journal

php tools/upgrade.php upgrade

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

[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]

DB Error: Table 'journals.articles' doesn't exist

Administrator@OJS c:\xampp\htdocs\journal

Finally, I checked my 2.4.5 database and it does have the ‘articles’ table. Mysqldump also has the following:

CREATE TABLE articles (
article_id bigint(20) NOT NULL AUTO_INCREMENT,
locale varchar(5) DEFAULT NULL,
user_id bigint(20) NOT NULL,
journal_id bigint(20) NOT NULL,
section_id bigint(20) DEFAULT NULL,
language varchar(10) DEFAULT ‘en’,
comments_to_ed text,
citations text,
date_submitted datetime DEFAULT NULL,
last_modified datetime DEFAULT NULL,
date_status_modified datetime DEFAULT NULL,
status tinyint(4) NOT NULL DEFAULT ‘1’,
submission_progress tinyint(4) NOT NULL DEFAULT ‘1’,
current_round tinyint(4) NOT NULL DEFAULT ‘1’,
submission_file_id bigint(20) DEFAULT NULL,
revised_file_id bigint(20) DEFAULT NULL,
review_file_id bigint(20) DEFAULT NULL,
editor_file_id bigint(20) DEFAULT NULL,
pages varchar(255) DEFAULT NULL,
fast_tracked tinyint(4) NOT NULL DEFAULT ‘0’,
hide_author tinyint(4) NOT NULL DEFAULT ‘0’,
comments_status tinyint(4) NOT NULL DEFAULT ‘0’,
PRIMARY KEY (article_id),
KEY articles_user_id (user_id),
KEY articles_journal_id (journal_id),
KEY articles_section_id (section_id)
) ENGINE=InnoDB AUTO_INCREMENT=5434 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

That’s pretty much all I could come up with after reading similar error message on this forum. Any advice will be most welcome.

Hi @Lolekbolek

Hmmm… Did you created a totaly new database before you applied the mysqldump?
Are your DB settings in the config.inc.php correct?
Hmmm…

EDIT: every time you try the upgrade anew, you would need to restore the clean backup i.e. do all those steps again: apply mysqldump on an empty/just created database, and copy files and public folder.

Best,
Bozana

Thank you for the suggestions, Bozana.

I reverted back to the snapshot taken right after successfully installing fresh 3.1.1.2 and restarted the upgrade process from scratch. I:

  1. replaced the vanilla 3.1.1.2 “files” directory with the backup from 2.4.5 and removed the “Read Only” attribute.

  2. replaced the vanilla “public” folder with the backup from 2.4.5 and removed the “Read Only” attribute.

  3. merged some info from the 2.4.5 config.inc.php into the 3.1.1.2 version.

  4. removed the “Read Only” attribute from the whole OJS directory (just in case).

  5. created a “journals” database and imported mysqldump from 2.4.5 into it. While there were an “Error code: 200. Error text: OK (rejected) message” shown at the end in phpMyAdmin, it also said “Import has been successfully finished, 1391 queries executed”. My “journals” database now has 157 tables instead of 127 in 2.4.5.

  6. Finally, I turned on debug and ran the web update. After about 45 minutes, it ended up with an error “DB Error: Column ‘user_id’ cannot be null”.

The whole process generated this in php_error_log:

[23-Jul-2018 16:51:14] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[23-Jul-2018 16:51:18] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\xampp\htdocs\journal\lib\pkp\pages\install\InstallHandler.inc.php on line 118
[23-Jul-2018 16:53:41] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[23-Jul-2018 16:53:41] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\xampp\htdocs\journal\lib\pkp\pages\install\InstallHandler.inc.php on line 118
[23-Jul-2018 16:53:42] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[23-Jul-2018 16:53:52] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[23-Jul-2018 16:53:53] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\journal\cache\t_compile\e8ea13aa559bf8604ca823015b397a28d8666486^%%8B^8BC^8BC56207%%usernav.tpl.php on line 100
[23-Jul-2018 16:54:15] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[23-Jul-2018 16:54:15] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\xampp\htdocs\journal\lib\pkp\pages\install\InstallHandler.inc.php on line 118
[23-Jul-2018 16:54:18] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[23-Jul-2018 16:54:18] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\journal\cache\t_compile\e8ea13aa559bf8604ca823015b397a28d8666486^%%8B^8BC^8BC56207%%usernav.tpl.php on line 100
[23-Jul-2018 16:54:44] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[23-Jul-2018 16:54:44] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\xampp\htdocs\journal\lib\pkp\pages\install\InstallHandler.inc.php on line 118
[23-Jul-2018 16:55:15] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:15] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:15] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:16] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:16] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:16] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:16] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:16] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:17] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:17] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:17] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:17] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:18] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:18] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:23] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:24] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:25] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 16:55:26] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[23-Jul-2018 17:44:20] PHP Warning: Declaration of SubmissionLanguageEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionLanguageEntryDAO.inc.php on line 20
[23-Jul-2018 17:44:28] PHP Warning: Declaration of SubmissionKeywordEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionKeywordEntryDAO.inc.php on line 45
[23-Jul-2018 17:44:51] PHP Warning: Declaration of SubmissionDisciplineEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionDisciplineEntryDAO.inc.php on line 44
[23-Jul-2018 17:44:56] PHP Warning: Declaration of SubmissionAgencyEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionAgencyEntryDAO.inc.php on line 44
[23-Jul-2018 17:45:39] PHP Warning: Declaration of SubmissionSubjectEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionSubjectEntryDAO.inc.php on line 44
[23-Jul-2018 17:47:12] ojs2: DB Error: Column ‘user_id’ cannot be null
[23-Jul-2018 17:52:07] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[23-Jul-2018 17:52:09] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in C:\xampp\htdocs\journal\lib\pkp\pages\install\InstallHandler.inc.php on line 118
[23-Jul-2018 17:52:24] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[23-Jul-2018 17:52:25] PHP Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\journal\cache\t_compile\e8ea13aa559bf8604ca823015b397a28d8666486^%%8B^8BC^8BC56207%%usernav.tpl.php on line 100

What should I try next?

Hi @Lolekbolek

Hmmm… It seems that something strange is happening in the step 5, when you apply the mysqldump. Are the DB versions the same? What are those additional tables, that actually do not exist in your 2.4.5 installation? Your new DB should look exactly the same as your 2.4.5 after applying the mysqldump.
Could you somehow check/investigate what is happening there?
Maybe your new DB also contains the tables from the earlier installed OJS 3.1.1-2 version? That should not be the case – you would need to drop the DB and create it a new.

Once this is fixed and the DBs are the same, you would need to do all the steps 1.-4. again. Then, could you use the CLI upgrade i.e. run the command “php tools/upgrade.php upgrade” in your console? That could give us better information where the upgrade fails.

Best,
Bozana

Thank you, @bozana.

To clarify, I dumped the “journals” database and imported mysqldump from the 2.4.5 machine. By the way, 2.4.5 has MySQL 5.5.60 on Ubuntu, while the 3.1.1.2 has MariaDB 10.1.32 on Windows Server 2016. Also, the Apache on the old machine and on the new one have mysqli PHP extension, but 2.4.5 machine’s config.inc.php has database driver = mysql, while the 3.1.1.2 has driver = mysqli. Not sure if that matters, but just in case.

After importing the mysqldump, both databases on Ubuntu and on Windows have 127 tables.

Now, I ran mysql_upgrade and got this:

Administrator@OJS c:\xampp\mysql\bin

mysql_upgrade.exe

This installation of MySQL is already upgraded to 10.1.32-MariaDB, use --force if you still need to run mysql_upgrade

Then I ran upgrade.php and got this:

Administrator@OJS c:\xampp\htdocs\journal

php tools\upgrade.php upgrade

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

[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]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/submissionFiles.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/libraryFiles.xml]
[schema: lib/pkp/xml/schema/navigationMenus.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]

[code: Installer Installer::installDefaultNavigationMenus]

[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]

[code: Installer Installer::migrateSRLocale]

[code: Installer Installer::concatenateIntoAbout]

[code: Installer Installer::concatenateIntoMasthead]

[code: Installer Installer::migrateCounterPluginUsageStatistics (skipped)]

[code: Installer Installer::migrateTimedViewsUsageStatistics (skipped)]

[code: Installer Installer::migrateDefaultUsageStatistics (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postUsageStatsMigration2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postCounterMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postTimedViewsMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type.xml]
[data: dbscripts/xml/upgrade/3.0.0_change_assoc_type_metrics.xml]
[data: dbscripts/xml/upgrade/3.0.0_settings.xml]

[code: Installer Installer::installDefaultGenres]

[code: Installer Installer::migrateArticleMetadata]
[data: dbscripts/xml/upgrade/3.0.0_update.xml]

[code: Installer Installer::clearDataCache]

[code: Installer Installer::migrateUserRoles]

DB Error: Column 'user_id' cannot be null

Administrator@OJS c:\xampp\htdocs\journal

As the result of this process, the database now has 157 tables. The 127 tables in the database before the upgrade included 10 tables that are absent from the upgraded version.

Tables only present before upgrade:

articles
article_comments
article_html_galley_images
article_search_keyword_list
article_search_keyword_list
article_search_objects
article_search_object_keywords
article_settings
article_xml_galleys
published_articles

The upgraded database has 41 new tables.

Tables only present after upgrade:

articles_migration
article_files_migration
article_galleys_migration
genres
genre_settings
item_views
library_files
library_file_settings
navigation_menus
navigation_menu_items
navigation_menu_item_assignments
navigation_menu_item_assignment_settings
navigation_menu_item_settings
notes_tmp
published_submissions
queries
query_participants
review_assignments_tmp
review_files
review_round_files
stage_assignments
submissions
submissions_tmp
submission_artwork_files
submission_comments
submission_files
submission_file_settings
submission_galleys
submission_galley_settings
submission_html_galley_images
submission_search_keyword_list
submission_search_objects
submission_search_object_keywords
submission_settings
submission_supplementary_files
submission_tombstones
submission_xml_galleys
user_groups
user_group_settings
user_group_stage
user_user_groups

php_error_log shows this:

[24-Jul-2018 15:57:18] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\journal\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[24-Jul-2018 15:57:50] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:51] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:56] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:56] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:57] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 15:57:57] PHP Notice: Only variables should be assigned by reference in C:\xampp\htdocs\journal\lib\pkp\classes\db\DBDataXMLParser.inc.php on line 122
[24-Jul-2018 16:21:15] PHP Warning: Declaration of SubmissionLanguageEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionLanguageEntryDAO.inc.php on line 20
[24-Jul-2018 16:21:20] PHP Warning: Declaration of SubmissionKeywordEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionKeywordEntryDAO.inc.php on line 45
[24-Jul-2018 16:21:25] PHP Warning: Declaration of SubmissionDisciplineEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionDisciplineEntryDAO.inc.php on line 44
[24-Jul-2018 16:21:25] PHP Warning: Declaration of SubmissionAgencyEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionAgencyEntryDAO.inc.php on line 44
[24-Jul-2018 16:21:35] PHP Warning: Declaration of SubmissionSubjectEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in C:\xampp\htdocs\journal\lib\pkp\classes\submission\SubmissionSubjectEntryDAO.inc.php on line 44
[24-Jul-2018 16:22:08] ojs2: DB Error: Column ‘user_id’ cannot be null

Hi @Lolekbolek

Ah, OK. That all then seems to be OK, and the main problem and information is this:

I’ll take a look at that function, what could be causing the problem… will then come back…

Best,
Bozana

Hi @Lolekbolek

Hmm…
Could you take a look in your DB tables articles and roles if the values in the column user_id look OK i.e. are a normal number? Could you also take a look in the DB table edit_assignments if the values for the column editor_id are OK? And finally, how are the values for the column user_id in the DB table signoffs? – there he user_id can also be = 0.

If I cannot figure out anything from those results, I would maybe ask you to either enable DB general logging, so that we see the exact SQL when the error occurs, or to add some output to that function migrateUserRoles, so that we can find the exact place in the code when it happens…

Best,
Bozana

Hi @bozana,

I looked at the four tables you listed in my 2.4.5 database (before the upgrade).

articles.user_id: 3010 records from 2 to 2489
edit_assignments.editor_id: 673 records from 0 to 2725
roles.user_id: 3439 records from 7 to 2734
signoffs.user_id: 22246 records from 0 to 2489.

The database on the new machine after the attempted upgrade does not have the “articles” table, but the other three tables have similar records.

Should I revert to the snapshot before I ran the php tools\upgrade.php upgrade and re-run it with debug = on? If yes, will I be able to collect the output in CLI?

And/or should I add some output? I’ll be happy to, just need some instructions :slight_smile:

Hi @Lolekbolek

Hmmm… The editor_id = 0 in edit_assignments table seems strange – I think this should not happen. Could you select those rows from the table:
SELECT * FROM edit_assignments WHERE editor_id = 0

Lets investigate this first, then we will see later what next, if we would need to add some output.

When we solved this, than you would need to apply a clean 2.4.8 dump, and to copy the original 2.4.8 files and public folder again, and then start the upgrade via CLI again. But, first lets see why editor_id is 0…

Best,
Bozana

Thank you, @bozana. Here is what got selected (one record only):

Table structure for table edit_assignments
Column Type Null Default
edit_id bigint(20) No
article_id bigint(20) No
editor_id bigint(20) No
can_edit tinyint(4) No 1
can_review tinyint(4) No 1
date_assigned datetime Yes NULL
date_notified datetime Yes NULL
date_underway datetime Yes NULL

Dumping data for table edit_assignments
edit_id 446
article_id 3864
editor_id 0
can_edit 1
can_review 1
date_assigned NULL
date_notified NULL
date_underway 2016-09-19 13:58:30

Hi @bozana,

Is there something else you would recommend me to try?

Hi @Lolekbolek

Sorry for such a delay! I was seriously sick, so that I couldn’t do anything…

Could you go to you 2.4.5 installation and see what is with the article with ID = 3864? In what state is it? How come it seems to be assigned to an editor, but the editor ID is 0?

Thanks!
Bozana

Hi All,

Don’t know if this will help anyone, here’s what I had to do to upgrade from 2.4.8-3 to 3.1.1-2. But, first some background.

Every time I tried to upgrade, I would see errors. The one that impacted the upgrade was the last message:

ojs2: Invalid File

There were other errors that I believe had no impact on the upgrade failure. One such error that appeared multiple times but for different PHP files:

PHP Warning: Invalid argument supplied for foreach() in /var/www/html/jstem3/classes/install/Upgrade.inc.php on line 2085

But, the Invalid File error was the one that killed the upgrade.

The solution: I had previously tried to perform an upgrade from 2.4.8-3 to 3.1.0-1. That had gone-off with a few hitches (menu items had disappeared but that was repairable!). However, the message at the end was that ojs had upgraded successfully. So, this is what I did again: first perform an upgrade to 3.1.0-1 (or another interim version), then update to 3.1.1-2. The menu items returned with the latter update.

I don’t know why this process works but I hope it can help someone who’s facing a similar problem.

As always, be cautious. FIRST, BACK-UP files, folders, and database MULTIPLE times. And, if in doubt, set-up a Linux Server VM and work with OJS on it to sharpen your process.

Thank you, Bozana! I hope you are feeling better!

Sorry for a stupid question, but where should I look for the details you mentioned? The article with ID = 3864 was published in 2016 and I can go to File Browser → Articles → 3864 and see “public”, “submission” and “supp” folders there with sub-folders and PDFs in them, but should I be looking elsewhere (the Admin interface in a browser)?

Also, when I looked more closely at the verbose debug output of the upgrade, it looks like I have user_id = 0 in my signoffs table, and 3864 is mentioned there too (see below). Should I delete this article and ask my editor to resubmit it later?

============================================================

(mysqli): SELECT ugs.stage_id AS stage_id, sa.* FROM stage_assignments sa

                    JOIN user_group_stage ugs ON sa.user_group_id = ugs.user_group_id WHERE sa.submission_id = 3864 AND sa.user_group_id = 14 AND sa.user_id = 2029

(mysqli): INSERT INTO stage_assignments

                                    (submission_id, user_group_id, user_id, date_assigned, recommend_only)

                            VALUES

                                    ('3864', 14, 2029, '2018-08-03 16:56:38', 0)

(mysqli): UPDATE authors SET user_group_id = 14 WHERE submission_id = ‘3864’

(mysqli): SELECT e.* FROM submissions s, edit_assignments e, users u, roles r WHERE r.user_id = e.editor_id AND r.role_id = 256 AND e.article_id = ‘3864’ AND r.journal_id = s.context_id AND s.submission_id = e.article_id AND e.editor_id = u.user_id

(mysqli): SELECT e.* FROM submissions s LEFT JOIN edit_assignments e ON (s.submission_id = e.article_id) LEFT JOIN users u ON (e.editor_id = u.user_id)

                                                    LEFT JOIN roles r ON (r.user_id = e.editor_id AND r.role_id = 256 AND r.journal_id = s.context_id) WHERE e.article_id = '3864' AND s.submission_id = e.article_id

                                                    AND r.role_id IS NULL

(mysqli): SELECT ugs.stage_id AS stage_id, sa.* FROM stage_assignments sa

                    JOIN user_group_stage ugs ON sa.user_group_id = ugs.user_group_id WHERE sa.submission_id = 3864 AND sa.user_group_id = 5 AND sa.user_id = 0

(mysqli): INSERT INTO stage_assignments

                                    (submission_id, user_group_id, user_id, date_assigned, recommend_only)

                            VALUES

                                    ('3864', 5, NULL, '2018-08-03 16:56:38', 0)

Query: INSERT INTO stage_assignments

                                    (submission_id, user_group_id, user_id, date_assigned, recommend_only)

                            VALUES

                                    ('3864', 5, NULL, '2018-08-03 16:56:38', 0) failed. Column 'user_id' cannot be null

1048: Column ‘user_id’ cannot be null

                                                                    ADOConnection._Execute(INSERT INTO stage_assignments                                    (submission_id, user_group_id, user_id, date_assigned, recommend_only)                          VALUES                                  ('3864...)% line 1032, file: C:\xampp\htdocs\journal\lib\pkp\lib\adodb\adodb.inc.php

                                                            ADOConnection.Execute(INSERT INTO stage_assignments                                     (submission_id, user_group_id, user_id, date_assigned, recommend_only)                          VALUES                                  ('3864..., Array[1])% line  228, file: C:\xampp\htdocs\journal\lib\pkp\classes\db\DAO.inc.php

                                                    DAO.update(INSERT INTO stage_assignments                                        (submission_id, user_group_id, user_id, date_assigned, recommend_only)                          VALUES                                  (?, ?,..., Array[4])% line  188, file: C:\xampp\htdocs\journal\lib\pkp\classes\stageAssignment\StageAssignmentDAO.inc.php

                                            StageAssignmentDAO.insertObject(Object:StageAssignment)% line  139, file: C:\xampp\htdocs\journal\lib\pkp\classes\stageAssignment\StageAssignmentDAO.inc.php

                                    StageAssignmentDAO.build(3864, 5, 0)% line  462, file: C:\xampp\htdocs\journal\classes\install\Upgrade.inc.php

<h1>DB Error: Column ‘user_id’ cannot be null</h1>

Administrator@OJS c:\xampp\htdocs\journal

adodb.inc.php (line 1032/1033):

$ret = $this->_Execute($sql);

if (!$ret) return $ret;

Hi @Lolekbolek

The stage_assignmetns seems not to be a problem – there could be 0 values and they are considered in the upgrade script.
I think the problem is that one entry where editor_id = 0.
I thought: if you could take a look at that article via the Web UI. Log in as editor and then go to that article and see in what stadium it is and if there is any editor assigned to it and…
Maybe you could take that look via Web UI first, before deleting/removing it – maybe we will be able to fix it…

Best,
Bozana

Thank you, @bozana.

I looked at the article and it has 3 section editors listed, one of which has no name (see screenshot). When I click on the envelop icon to see what email it goes to, I see “Errors occurred processing this form. The email address <> is invalid”.

Shall I delete this editor from this article and try the whole process again?

Snag_9551aa81

Thank you, @pkahai, but it looks like troubleshooting suggested by @bozana applies better to my specific situation, judging by the errors I receive.