Migration OJS Database 2.3.6 to 2.4.6

Hello,

I’m trying update OJS database through CLI, but only Code Version have been updated.

When I run a command for check, the output is:

php tools/upgrade.php check
Code version: 2.4.6.0
Database version: 2.3.6.0
Latest version: 2.4.6.0
Database version is older than code version
Run “tools/upgrade.php upgrade” to update

When I run command for upgrade, the results are:

php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.6.0]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_article_files.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_emaillog.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_reviewrounds.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issues.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_articles.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issue_galleys.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_notifications.xml (skipped)]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/groups.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/comments.xml]
[schema: lib/pkp/xml/schema/notes.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/metrics.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]

[code: Installer Installer::migrateReviewingInterests2]
[data: dbscripts/xml/upgrade/2.3.7_update.xml]

[code: Installer Installer::removeAuthorRevisedFilesFromSignoffs]
[note: docs/release-notes/README-2.3.7]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys2.xml (skipped)]
[data: lib/pkp/xml/mutexData.xml]
[data: dbscripts/xml/upgrade/2.4.0_update.xml]
ERROR: Upgrade failed: DB: Duplicate entry ‘199-old_log_id’ for key ‘event_log_settings_pkey’

I tried updating by Web, but the same error is also displayed.

Regards,
Leandro

Hi @leandro.araujo,

I suspect your database already contains some parts of a failed upgrade, and that’s why you’re getting the error message, Restore your database to its condition before you first tried to run the upgrade, and post the resulting output here if you’re still getting an error message.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher

I restored my database, but the error continued, the output is:

php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.6.0]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_article_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_emaillog.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_reviewrounds.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issues.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_articles.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issue_galleys.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_notifications.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/groups.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/comments.xml]
[schema: lib/pkp/xml/schema/notes.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/metrics.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]

[code: Installer Installer::migrateReviewingInterests2]
[data: dbscripts/xml/upgrade/2.3.7_update.xml]

[code: Installer Installer::removeAuthorRevisedFilesFromSignoffs]
[note: docs/release-notes/README-2.3.7]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::installEmailTemplate]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys2.xml]
[data: lib/pkp/xml/mutexData.xml]
[data: dbscripts/xml/upgrade/2.4.0_update.xml]
[note: docs/release-notes/README-2.4.0]

[code: Installer Installer::migrateNotifications]
[data: dbscripts/xml/upgrade/2.4.0_notifications2.xml]
[note: docs/release-notes/README-2.4.1]
[data: dbscripts/xml/upgrade/2.4.2_update.xml]
[note: docs/release-notes/README-2.4.2]
[schema: plugins/generic/usageStats/schema.xml]
[data: dbscripts/xml/upgrade/remove_timed_views_bots.xml (skipped)]

[code: Installer Installer::migrateCounterPluginUsageStatistics]

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

[code: Installer Installer::migrateDefaultUsageStatistics]
[data: dbscripts/xml/upgrade/2.4.3_postUsageStatsMigration.xml]
[data: dbscripts/xml/upgrade/2.4.3_postUsageStatsMigration2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.3_postCounterMigration.xml]
[data: dbscripts/xml/upgrade/2.4.3_postTimedViewsMigration.xml (skipped)]
[note: docs/release-notes/README-2.4.3]
[data: dbscripts/xml/upgrade/2.4.4_update.xml]
[note: docs/release-notes/README-2.4.4]
[note: docs/release-notes/README-2.4.5]

[code: Installer Installer::localizeCustomBlockSettings]

[code: Installer Installer::removeCustomIdentifierSuffixOption]
[note: docs/release-notes/README-2.4.6]

[code: Installer Installer::addPluginVersions]

You are trying to downgrade the product "counter" from version [1.1.0.0] to version [1.0.0.0]. Downgrades are not supported.

ojs2: You are trying to downgrade the product "counter" from version [1.1.0.0] to version [1.0.0.0]. Downgrades are not supported.

Hi @leandro.araujo,

Have you seen this thread in the old forum?
http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=10113&start=15#p41500

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I did downgrade my database and code, then I run command to upgrade, but not upgrade.

The error message is the same when I run “php tools/upgrade.php upgrade”

When I run a command for check, the output is:
php tools/upgrade.php check
Code version: 2.4.6.0
Database version: 2.3.6.0
Latest version: 2.4.6.0
Database version is older than code version
Run “tools/upgrade.php upgrade” to update

Hi @leandro.araujo,

I’m not sure what you mean about downgrading your database and code – what did you do?

Have you checked the following?

  • The installed setting in config.inc.php should be set to Off before running the upgrade script.
  • There should not be anything in plugins/generic/timedView after the code upgrade.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

sorry my English, I am beginner in English language.

Follow the steps that I made:

  • I rode my old environment with code and database in version 2.3.6
  • I edited config.inc.php and change “installed = On” to “installed = Off”
  • I run the command “php tools / upgrade.php patch”
    Downloading the patch is done, however error occurs when going to patch.
  • Then I ran the command “php tools / upgrade.php upgrade” but the error message is displayed
    You are trying to downgrade the product “counter” from version [1.1.0.0] to version [1.0.0.0]. Downgrades are not supported.ojs2: You are trying to downgrade the product “counter” from version [1.1.0.0] to version [1.0.0.0]. Downgrades are not supported

When I run check command, the output is:
Code Version: 2.4.6.0
Database version: 2.3.6.0
Latest version: 2.4.6.0
Database version is older than version code
Run “tools / upgrade.php upgrade” to update

Regards,
Leandro Araujo

Hi @leandro.araujo,

I suspect the problem is that your code isn’t getting properly patched, so there may be a mixture of code from old and new versions. I’d suggest trying the “full package” upgrade method for the code upgrade, documented in docs/UPGRADE.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,

I could update the database ,it was necessary to carry out full installation.

Now, when I run a command for check, the output is:
php tools/upgrade.php check
Code version: 2.4.6.0
Database version: 2.4.6.0
Latest version: 2.4.6.0
Your system is up-to-date

Thank you!

Regards,
Leandro Araujo

Hi @leandro.araujo,

Glad to hear it’s working!

Regards,
Alec Smecher
Public Knowledge Project Team