OJS Upgrade failed 2.4.8-1 to 3.0.0

Hi…

I have a problem OJS from 2.4.8-1 upgrade to 3.0.0 with errors like this:

ojs@journal:~ % php public_html/tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.0.0.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]
[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]
ERROR: Upgrade failed: DB: Data truncated for column 'comment_title' at row 1

Hi @tiyok,

Try making this change in the lib/pkp subdirectory, then restoring your installation (both files directory and database) from backup, and re-running the upgrade.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks for the answer. Unfortunately, this patch can not be used because size of comment_title is 90 not 255. I use ojs 3.0.0 tarball. I try to change manually and i got this error SQL syntax:

ojs@journal:~ % php public_html/tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.0.0.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]
[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]
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 'X) NOT NULL' at line 1

When I change the size of the comment_title to 255, I get an error like this:

ojs@journal:~ % php public_html/tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.0.0.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]
[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]
ERROR: Upgrade failed: DB: Out of range value for column 'metric' at row 1738

Hi @tiyok,

Oops! I made a mistake in that change. Instead, try changing…

 <field name="comment_title" type="C2" size="90">

…to…

<field name="comment_title" type="X">

…in lib/pkp/ xml/schema/submissions.xml

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

It worked for submissions schema, but upgrade still fails. I get the error like this:

journal@dev-journal:~ % php public_html/tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.0.0.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]
[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]
ERROR: Upgrade failed: DB: Out of range value for column 'metric' at row 1738

Is there something wrong with my ojs db?

Hi @tiyok,

Maybe there is a big integer or a wrong value in your DB table “metrics” in the column “metric”. Could you maybe take a look at those numbers there, if there is something strange/too big there?
Also: Do you use Statistics plugin and in that case how often do you rotate i.e. process the log files? Or are there some older values in this DB i.e. what do you see as “metric_type”?

Thanks a lot!
Bozana

Hi @tiyok,

Ah, I’ve just realized, that that column was defined as “I4” i.e. as “int” in OJS 2.4.8 but in OJS 3.0 as “I2” i.e. “smallint” :-\ Could you maybe change it for yourself and test it? Change this line https://github.com/pkp/pkp-lib/blob/master/xml/schema/metrics.xml#L47 in your lib/pkp/xml/schema/metrics.xml file so that type="I4". Then restore the backup and try the upgrade again. Please let us know, if that worked then.

Best,
Bozana

Hi @bozana ,

Thanks, it worked for metrics schema. But there is another upgrade problem on [code: Installer Installer::convertSupplementaryFiles]

Error:

ojs@journal:~ % php public_html/tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.0.0.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]
[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]
[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::migrateArticleMetadata]
[data: dbscripts/xml/upgrade/3.0.0_update.xml]
[code: Installer Installer::clearDataCache]
[code: Installer Installer::migrateUserRoles]
[code: Installer Installer::installDefaultGenres]
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml (skipped)]
[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]
[data: dbscripts/xml/upgrade/2.4.0_postCounterMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postTimedViewsMigration.xml (skipped)]
[code: Installer Installer::fixReviewForms]
[code: Installer Installer::htmlifyEmailTemplates]
[note: docs/release-notes/README-BEACON]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[data: dbscripts/xml/upgrade/3.0.0_scheduledTasks.xml]
[code: Installer Installer::localizeCustomBlockSettings]
[code: Installer Installer::convertEditorDecisionNotes]
[code: Installer Installer::convertQueries]
[code: Installer Installer::migrateFiles]
WARNING: Unable to find a match for "984-3053-1-??.doc" in "/home/journal/files/journals/3//articles/984/". Skipping this file.
WARNING: Unable to find a match for "984-3054-1-??.doc" in "/home/journal/files/journals/3//articles/984/". Skipping this file.
....
[code: Installer Installer::convertSupplementaryFiles]
<h1>DB Error: Data too long for column 'label' at row 1</h1>ojs2: DB Error: Data too long for column 'label' at row 1

Hi @tiyok,

Edit dbscripts/xml/ojs_schema.xml and find the table called submission_galleys:

<table name="submission_galleys">
    ...

In that list of columns you’ll find:

<field name="label" type="C2" size="32"/>

Change it to…

<field name="label" type="C2" size="255"/>

See if that solves the problem.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I have been editing dbscripts/xml/ojs_schema.xml. But I still had another problem:

ojs@journal:~ % php public_html/tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.0.0.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]
[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]
[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::migrateArticleMetadata]
[data: dbscripts/xml/upgrade/3.0.0_update.xml]
[code: Installer Installer::clearDataCache]
[code: Installer Installer::migrateUserRoles]
[code: Installer Installer::installDefaultGenres]
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml (skipped)]
[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]
[data: dbscripts/xml/upgrade/2.4.0_postCounterMigration.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_postTimedViewsMigration.xml (skipped)]
[code: Installer Installer::fixReviewForms]
[code: Installer Installer::htmlifyEmailTemplates]
[note: docs/release-notes/README-BEACON]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[data: dbscripts/xml/upgrade/3.0.0_scheduledTasks.xml]
[code: Installer Installer::localizeCustomBlockSettings]
[code: Installer Installer::convertEditorDecisionNotes]
[code: Installer Installer::convertQueries]
[code: Installer Installer::migrateFiles]
WARNING: Unable to find a match for "984-3053-1-??.doc" in "/home/journal/files/journals/3//articles/984/". Skipping this file.
WARNING: Unable to find a match for "984-3054-1-??.doc" in "/home/journal/files/journals/3//articles/984/". Skipping this file.
WARNING: Unable to find a match for "1197-3761-1-??.pdf" in "/home/journal/files/journals/3//articles/1197/". Skipping this file.
 ...
[code: Installer Installer::convertSupplementaryFiles]
PHP Warning:  Invalid argument supplied for foreach() in /usr/home/journal/public_html/classes/install/Upgrade.inc.php on line 1182
PHP Warning:  Invalid argument supplied for foreach() in /usr/home/journal/public_html/classes/install/Upgrade.inc.php on line 1191
 ...
PHP Warning:  assert(): Assertion failed in /usr/home/journal/public_html/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 380
<h1>There are no readable files in this directory tree. Are safe mode or open_basedir active?</h1>ojs2: There are no readable files in this directory tree. Are safe mode or open_basedir active?

Hi @tiyok,

I’m having the same problem with a test upgrade. We’re looking into things right now. One thought I had was that maybe a submission file was missing from the files_dir, but I’m not sure why that would throw a fatal error. If you have any updates, please let me know, and I will do the same.

Cheers,
James

Hi @jmacgreg,

No updates at this time . I’m trying to sync with the production server and tries to check missing files from files_dir.

Hi @tiyok,

It turns out our problem was that a few entries in the articles table had section_id = NULL. Restoring the database and setting a proper section_id for these resolved the issue.

Cheers,
James

Hi @jmacgreg,

After restoring the database and setting a proper section_id, the upgrade process runs perfectly.

Thank you :slight_smile:

Hi James,
how did you know the proper section_id value? I have the same problem, but I don’t know which relationship the section_id has with other fields.
Best Regards,

Hi @Rondineli_Gama_Saad

At least the editors would know to which section that article belongs and you could then take a look in the DB so see the ID of that section.

Best,
Bozana

Hi @Rondineli_Gama_Saad and @bozana

Regasrds,
Tarcisio Pereira.

Hi @Tarcisio_Pereira

Hmmm… I think I don’t understand it :-\ What do you get then i.e. where is the section_id?

Thanks!
Bozana

Hi @bozana

Probably the article was not yet associated with a section.
My articles have been solved by the editor, who knows exactly where each one should be.
Eu não sei explicar qual o motivo.
Mas aqui funcinou, assim como funcinou para o tiyok.

Regards,
Tarcisio Pereira.

1 Like

Hi @yassiel,

I see this is also posted at Upgrading from 2.4.8-1 to 3.1.0-1. Please only post your question in one place – that’ll help keep the forum from getting cluttered.

Regards,
Alec Smecher
Public Knowledge Project Team