OJS from 3.1.2.1. to 3.3.0.5

Good day friends! I am trying to upgrade OJS from 3.1.2.1. up to 3.3.0.5. Through the web interface. Perhaps someone came across and solved a similar problem. Or has ideas on how to solve it.
When I click update. I get an error message:

"A database error has occurred: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'navigation_menus' already exists (SQL: CREATE TABLE navigation_menus ( navigation_menu_id BIGINT NOT NULL AUTO_INCREMENT, context_id BIGINT NOT NULL, area_name VARCHAR(255) DEFAULT '', title VARCHAR(255) NOT NULL, PRIMARY KEY (navigation_menu_id) ))"
Thanks in advance.

1 Like

The best way to upgrade ojs is upgrade all version one by one until version you want

Do you mean upgrade in stages? :cold_face:

3.1.2-1 → 3.1.2-2 → 3.1.2-3 → 3.1.2-4 → 3.2.0 → 3.2.0-1 → 3.2.0-2 → 3.2.0-3 → 3.2.1 → 3.2.1-1 → 3.2.1-2 → 3.2.1-3 → 3.3.0 → 3.2.1-4 → 3.3.0-3 → 3.3.0-4 → 3.3.0-5

Yes sir
Because every version any database upgraded. When you try to jump you will lose database upgraded

Hi all,

Actually, I don’t recommend upgrading through each version in sequence – you should be OK to jump directly from an old release to a new one.

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

Thanks for your reply! You have saved a tremendous amount of time.
Perhaps you can give a hint regarding the update error?

Hi @Heorhii,

As Site Administrator, can you check the version history in your OJS 3.1.2-1 installation? See e.g.:

Regards,
Alec Smecher
Public Knowledge Project Team

Yes, I will try. Thank you! After several attempts to update and receive this message, I did not check the log itself, restored the backup.

[19-Apr-2021 21:27:03 Europe/Helsinki] PHP Deprecated:  Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
    [19-Apr-2021 21:27:03 Europe/Helsinki] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'navigation_menus' already exists (SQL: CREATE TABLE navigation_menus (
    navigation_menu_id       BIGINT NOT NULL AUTO_INCREMENT,
    context_id               BIGINT NOT NULL,
    area_name                VARCHAR(255) DEFAULT '',
    title                    VARCHAR(255) NOT NULL,
                     PRIMARY KEY (navigation_menu_id)
    ))
    [19-Apr-2021 21:27:33 Europe/Helsinki] PHP Notice:  Undefined index: url_path in /home/main/public_html/public/jurnal/classes/issue/IssueDAO.inc.php on line 307
    [19-Apr-2021 21:27:33 Europe/Helsinki] PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'main_jurnal.publications' doesn't exist in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:78
    Stack trace:
    #0 /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(78): PDO->prepare('select `s`.*, `...', Array)
    #1 /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(361): Doctrine\DBAL\Driver\PDOConnection->prepare(Object(Illuminate\Database\Query\Expression))
    #2 /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}(Object(Illuminate\Database\Query\Expression), Array)
    #3 /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Conn in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

if set installed = On after this, i take 500 error

Hi @Heorhii,

Can you check and post your version history as described above?

Thanks,
Alec Smecher
Public Knowledge Project Team

Sorry, I hope I understood you correctly.

69c0e-clip-116kb af6a1-clip-9kb

Hi @Heorhii,

Are you able to restore from backup, turn on the show_stacktrace option in config.inc.php, then re-run the upgrade using the command-line upgrade tool (tools/upgrade.php)?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher !!!
I am updating with Full Package update. I tried to enable show_stacktrace and update, tell me plz, where can I find a report for this option?
My error file remained unchanged.

[20-Apr-2021 13:04:33 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /home/main/public_html/public/jurnal/lib/pkp/lib/vendor/adodb/adodb-php/adodb-xmlschema.inc.php on line 1307
[20-Apr-2021 13:04:34 Europe/Helsinki] SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘navigation_menus’ already exists (SQL: CREATE TABLE navigation_menus (
navigation_menu_id BIGINT NOT NULL AUTO_INCREMENT,
context_id BIGINT NOT NULL,
area_name VARCHAR(255) DEFAULT ‘’,
title VARCHAR(255) NOT NULL,
PRIMARY KEY (navigation_menu_id)
))

Hi @Heorhii,

Can you include the full output from the command-line upgrade tool?

Regards,
Alec Smecher
Public Knowledge Project Team

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

[code: Installer Installer::checkPhpVersion]

[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 (skipped)]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_last_activity.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/categories.xml]
[schema: lib/pkp/xml/schema/notes.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]
ERROR: Upgrade failed: DB: SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘navigation_menus’ already exists (SQL: CREATE TABLE navigation_menus (
navigation_menu_id BIGINT NOT NULL AUTO_INCREMENT,
context_id BIGINT NOT NULL,
area_name VARCHAR(255) DEFAULT ‘’,
title VARCHAR(255) NOT NULL,
PRIMARY KEY (navigation_menu_id)
))

Hi @Heorhii,

Can you try the following SQL query on your pre-upgrade database?

DESCRIBE navigation_menus;

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher forgive me if I make some stupid mistakes, before that I updated OJS OCS and OMP exclusively by replacing files in the file manager and there were no such problems.

c5c6b-clip-60kb

@asmecher hi!
An interesting observation, but on an identical server where I restored the site backup. I was able to update ojs with no problem. I will be able to migrate the updated ojs. But it is very interesting why the update on the main server fails.
I would be glad if you could suggest what the problem is.

9fd9d-clip-29kb
8150b-clip-34kb

Hi @Heorhii,

It looks like OJS was trying to create a table that already existed, when the normal behaviour would have been to inspect the existing table and adapt any necessary changes. (Based on your DESCRIBE statement, there wouldn’t have been any.) I wonder if the table was owned by another user and OJS didn’t have access to it?

Regards,
Alec Smecher
Public Knowledge Project Team

1 user with all privileges. It’s strange that this jurnal, which I copied to another server, was updated without problems. Try to recreate the database and user?