2.4.8.1 => 3.0.2 Some Upgrade issues

upgrade
ojs3

#1

Hi :slight_smile:
I try out OJS3 currently, so I’ve copied the working 2.4.8.1 to a test server and adapted the whole config to reflect all OJS3 changes.

I’m stuck at php tools/upgrade.php upgrade:

$ php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.0.2.0]
[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]
[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)]
[code: Installer Installer::migrateCounterPluginUsageStatistics]
<h1>DB Error: Unknown column 'pkp_section_id' in 'field list'</h1>ojs2: DB Error: Unknown column 'pkp_section_id' in 'field list'

I have absolutely no idea. Whats wrong here?

Thanks in advance!

EDIT:

Stacktrace:

<h1>DB Error: Unknown column 'pkp_section_id' in 'field list'</h1><h4>Stack Trace:</h4>
<strong>File:</strong> /var/www/ojs3.jki.intern/lib/pkp/classes/statistics/PKPMetricsDAO.inc.php line 331<br />
<strong>Function:</strong> DAO->update("INSERT INTO metrics (load_id, assoc_type, assoc_id, metric_type,...", Array(13))<br />
<br/>
<strong>File:</strong> /var/www/ojs3.jki.intern/classes/install/Upgrade.inc.php line 498<br />
<strong>Function:</strong> PKPMetricsDAO->insertRecord(Array(7))<br />
<br/>
<strong>File:</strong> (unknown) line (unknown)<br />
<strong>Function:</strong> Upgrade->migrateCounterPluginUsageStatistics(Object(Upgrade), Array(2))<br />
<br/>
<strong>File:</strong> /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php line 415<br />
<strong>Function:</strong> call_user_func(Array(2), Object(Upgrade), Array(2))<br />
<br/>
<strong>File:</strong> /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php line 265<br />
<strong>Function:</strong> Installer->executeAction(Array(3))<br />
<br/>
<strong>File:</strong> /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php line 186<br />
<strong>Function:</strong> Installer->executeInstaller()<br />
<br/>
<strong>File:</strong> /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 88<br />
<strong>Function:</strong> Installer->execute()<br />
<br/>
<strong>File:</strong> /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 64<br />
<strong>Function:</strong> UpgradeTool->upgrade()<br />
<br/>
<strong>File:</strong> /var/www/ojs3.jki.intern/tools/upgrade.php line 34<br />
<strong>Function:</strong> UpgradeTool->execute()<br />
<br/>
ojs2: DB Error: Unknown column 'pkp_section_id' in 'field list'

Database error on upgrade OJS 2.4.8.1 to OJS 3.0.2
#2

Hi @Commifreak

There was a bug that is fixed after the 3.0.2 release. Here is the patch you will need for this issue, I think: https://github.com/bozana/ojs/commit/fc73c76729c724d90d6afa4a40e51d57520484a2.
Some bugs were fixed since the release and they can be found in the GitHub:
OJS: https://github.com/pkp/ojs/tree/ojs-stable-3_0_2
PKP-LIB: https://github.com/pkp/pkp-lib/tree/ojs-stable-3_0_2
So if there is any chance for you to use the GitHub, it would be great. Else, maybe you will have to patch those you need…

Best,
Bozana


#3

Thanks. I’ll look into this soon.


Gruß,
R. Kluth


#4

So, I downloaded pkp-lib @ ojs_3.0.2 and ojs at 3.0.2 stable.

I combined both zip’s by putting the pkp-lib into lib of ojs.

But something is missing:

php tools/upgrade.php upgrade
PHP Warning:  require_once(/var/www/ojs3.jki.intern/lib/pkp/lib/vendor/ircmaxell/password-compat/lib/password.php): failed to open stream: No such file or directory in /var/www/ojs3.jki.intern/lib/pkp/classes/security/Validation.inc.php on line 16
PHP Stack trace:
PHP   1. {main}() /var/www/ojs3.jki.intern/tools/upgrade.php:0
PHP   2. require() /var/www/ojs3.jki.intern/tools/upgrade.php:19
PHP   3. require() /var/www/ojs3.jki.intern/tools/bootstrap.inc.php:17
PHP   4. require() /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/CliTool.inc.php:32
PHP   5. Application->__construct() /var/www/ojs3.jki.intern/lib/pkp/includes/bootstrap.inc.php:58
PHP   6. PKPApplication->__construct() /var/www/ojs3.jki.intern/classes/core/Application.inc.php:38
PHP   7. import() /var/www/ojs3.jki.intern/lib/pkp/classes/core/PKPApplication.inc.php:137
PHP   8. require_once() /var/www/ojs3.jki.intern/lib/pkp/includes/functions.inc.php:25
PHP Fatal error:  require_once(): Failed opening required '/var/www/ojs3.jki.intern/lib/pkp/lib/vendor/ircmaxell/password-compat/lib/password.php' (include_path='.:/var/www/ojs3.jki.intern/classes:/var/www/ojs3.jki.intern/pages:/var/www/ojs3.jki.intern/lib/pkp:/var/www/ojs3.jki.intern/lib/pkp/classes:/var/www/ojs3.jki.intern/lib/pkp/pages:/var/www/ojs3.jki.intern/lib/pkp/lib/adodb:/var/www/ojs3.jki.intern/lib/pkp/lib/phputf8:/var/www/ojs3.jki.intern/lib/pkp/lib/pqp/classes:/var/www/ojs3.jki.intern/lib/pkp/lib/smarty:.:/usr/share/php:/usr/share/pear') in /var/www/ojs3.jki.intern/lib/pkp/classes/security/Validation.inc.php on line 16
PHP Stack trace:
PHP   1. {main}() /var/www/ojs3.jki.intern/tools/upgrade.php:0
PHP   2. require() /var/www/ojs3.jki.intern/tools/upgrade.php:19
PHP   3. require() /var/www/ojs3.jki.intern/tools/bootstrap.inc.php:17
PHP   4. require() /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/CliTool.inc.php:32
PHP   5. Application->__construct() /var/www/ojs3.jki.intern/lib/pkp/includes/bootstrap.inc.php:58
PHP   6. PKPApplication->__construct() /var/www/ojs3.jki.intern/classes/core/Application.inc.php:38
PHP   7. import() /var/www/ojs3.jki.intern/lib/pkp/classes/core/PKPApplication.inc.php:137
PHP   8. require_once() /var/www/ojs3.jki.intern/lib/pkp/includes/functions.inc.php:25

What is correct way to use the stable branches from github?


#5

Ok, got it:

Download full ojs 302 stable zip and patch the both github stable branches into the full package. This did the trick for me.

But the upgrade fails now here:

php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.0.2.0]
[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]
[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]
[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/gifts.xml]
[schema: lib/pkp/xml/schema/mutex.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: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]
[code: Installer Installer::migrateCounterPluginUsageStatistics]
PHP Fatal error:  Uncaught exception 'Exception' with message 'Cannot load record: invalid context id.' in /var/www/ojs3.jki.intern/lib/pkp/classes/statistics/PKPMetricsDAO.inc.php:408
Stack trace:
#0 /var/www/ojs3.jki.intern/classes/statistics/MetricsDAO.inc.php(47): PKPMetricsDAO->foreignKeyLookup(256, 20)
#1 /var/www/ojs3.jki.intern/lib/pkp/classes/statistics/PKPMetricsDAO.inc.php(282): MetricsDAO->foreignKeyLookup(256, 20)
#2 /var/www/ojs3.jki.intern/classes/install/Upgrade.inc.php(498): PKPMetricsDAO->insertRecord(Array)
#3 [internal function]: Upgrade->migrateCounterPluginUsageStatistics(Object(Upgrade), Array)
#4 /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php(415): call_user_func(Array, Object(Upgrade), Array)
#5 /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php(265): Installer->executeAction(Array)
#6 /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#7 /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Inst in /var/www/ojs3.jki.intern/lib/pkp/classes/statistics/PKPMetricsDAO.inc.php on line 408

Again: No idea :frowning:


#6

Hi @Commifreak

Could it be that you DB table in OJS 2.4.8.1 counter_monthly_log contains a journal_id that does not exists (any more)?

Best,
Bozana


#7

Indeed, exact that matches here. journal_id 20 is listed but non existent anymore.

That should be covered by the upgrade process :wink:


#8

Actually, those entries should have been removed when that journal was removed, but… Would it be possible for you to then remove those entries from that table? (-- The upgrade scripts covers it by throwing an exception…)


#9

Hi,

I’ve tried it. I’ve deleted all old records.

It seems to work now. However, I got some PHP-Warnings during the upgrade: PHP Warning: Cannot use a scalar value as an array

In detail:

PHP Warning:  Cannot use a scalar value as an array in /var/www/ojs3.jki.intern/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Stack trace:
PHP   1. {main}() /var/www/ojs3.jki.intern/tools/upgrade.php:0
PHP   2. UpgradeTool->execute() /var/www/ojs3.jki.intern/tools/upgrade.php:34
PHP   3. UpgradeTool->upgrade() /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/UpgradeTool.inc.php:64
PHP   4. Installer->execute() /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/UpgradeTool.inc.php:88
PHP   5. Installer->executeInstaller() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:186
PHP   6. Installer->executeAction() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:265
PHP   7. call_user_func() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:415
PHP   8. Upgrade->migrateArticleMetadata() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:415
PHP   9. DAOResultFactory->next() /var/www/ojs3.jki.intern/classes/install/Upgrade.inc.php:97
PHP  10. JournalDAO->_fromRow() /var/www/ojs3.jki.intern/lib/pkp/classes/db/DAOResultFactory.inc.php:104
PHP  11. ContextDAO->_fromRow() /var/www/ojs3.jki.intern/classes/journal/JournalDAO.inc.php:46
PHP  12. DAO->getDataObjectSettings() /var/www/ojs3.jki.intern/lib/pkp/classes/context/ContextDAO.inc.php:76
PHP  13. DataObject->setData() /var/www/ojs3.jki.intern/lib/pkp/classes/db/DAO.inc.php:587

and

PHP Warning:  Cannot use a scalar value as an array in /var/www/ojs3.jki.intern/lib/pkp/classes/db/SettingsDAO.inc.php on line 41
PHP Stack trace:
PHP   1. {main}() /var/www/ojs3.jki.intern/tools/upgrade.php:0
PHP   2. UpgradeTool->execute() /var/www/ojs3.jki.intern/tools/upgrade.php:34
PHP   3. UpgradeTool->upgrade() /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/UpgradeTool.inc.php:64
PHP   4. Installer->execute() /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/UpgradeTool.inc.php:88
PHP   5. Installer->executeInstaller() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:186
PHP   6. Installer->executeAction() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:265
PHP   7. call_user_func() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:415
PHP   8. Upgrade->migrateArticleMetadata() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:415
PHP   9. Context->getSupportedSubmissionLocales() /var/www/ojs3.jki.intern/classes/install/Upgrade.inc.php:100
PHP  10. Context->getSetting() /var/www/ojs3.jki.intern/lib/pkp/classes/context/Context.inc.php:224
PHP  11. SettingsDAO->getSetting() /var/www/ojs3.jki.intern/lib/pkp/classes/context/Context.inc.php:320
PHP  12. GenericCache->get() /var/www/ojs3.jki.intern/lib/pkp/classes/db/SettingsDAO.inc.php:72
PHP  13. call_user_func_array() /var/www/ojs3.jki.intern/lib/pkp/classes/cache/GenericCache.inc.php:63
PHP  14. SettingsDAO->_cacheMiss() /var/www/ojs3.jki.intern/lib/pkp/classes/cache/GenericCache.inc.php:63
PHP  15. SettingsDAO->loadSettings() /var/www/ojs3.jki.intern/lib/pkp/classes/db/SettingsDAO.inc.php:96

And some other files.

And the migrateFiles() function skips files, like:

WARNING: Unable to find a match for "2400-9647-1-RV.doc" in "volltexte/journals/5//articles/2400/". Skipping this file.

What does this mean?

Some copies didnt worked. (Failed to open stream, file not found)

And an assertion failed:

PHP Warning:  assert(): Assertion failed in /var/www/ojs3.jki.intern/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 134
PHP Stack trace:
PHP   1. {main}() /var/www/ojs3.jki.intern/tools/upgrade.php:0
PHP   2. UpgradeTool->execute() /var/www/ojs3.jki.intern/tools/upgrade.php:34
PHP   3. UpgradeTool->upgrade() /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/UpgradeTool.inc.php:64
PHP   4. Installer->execute() /var/www/ojs3.jki.intern/lib/pkp/classes/cliTool/UpgradeTool.inc.php:88
PHP   5. Installer->executeInstaller() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:186
PHP   6. Installer->executeAction() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:265
PHP   7. call_user_func() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:415
PHP   8. Upgrade->convertSupplementaryFiles() /var/www/ojs3.jki.intern/lib/pkp/classes/install/Installer.inc.php:415
PHP   9. PKPSubmissionFileDAO->updateObject() /var/www/ojs3.jki.intern/classes/install/Upgrade.inc.php:1318
PHP  10. SupplementaryFileDAODelegate->insertObject() /var/www/ojs3.jki.intern/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php:390
PHP  11. SubmissionFileDAODelegate->insertObject() /var/www/ojs3.jki.intern/lib/pkp/classes/submission/SupplementaryFileDAODelegate.inc.php:42
PHP  12. assert() /var/www/ojs3.jki.intern/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php:134

and:

Unknown supplementary file setting "datacite::registeredDoi"!

and:

ERROR: Reviewer files with ID 10115 from review assignment 245 could not be found in the database table submission_files

Due to the copy problems, it would be great to check database/journal integrity before upgrade (an so called dry-run). Maybe some investigation needed before upgrading?

Is something like that possible?


#10

Hi @Commifreak

Phew…
I do not know what are the first warnings exactly about :-\ – it seems that a setting is not localized but it should/is expected to be. I do not know which one. If you could try to debug it to see what settings that are… it would be great.

This error: “Unable to find a match for “2400-9647-1-RV.doc”…” means that there is a file in your DB but not in the file system. Could you double check if this is so? Either you can reconstruct that file or maybe to delete it?

If the copying of the file did not work (and that assert failure), it means that the access permissions on your files (sub)folders are not enough – the folders should be writable for the user running the upgrade. Could you check that?

The unknown supp file setting is a bug i.e. not considered in the upgrade script – I will change it and let you know…

The reviewer file seams to be in the DB but not in the files folder. Also here, either you can reconstruct them or maybe remove them…

Unfortunately, we cannot (pre-)check everything :frowning: because the ways of using the software are so different and because of the huge amount of data and cases. Those warnings/errors are a way to check it i.e. to point users on what is not correct…

Thanks a lot!
Bozana


#11

Hi @Commifreak

Here is the fix for the supp file setting “datacite::registeredDoi” migration problem: https://github.com/pkp/ojs/commit/1143b66b890131d9608648adb10307d7a5295dcc

Best,
Bozana