Upgrading OJS 3.1.1.4 to 3.3.0.7 but database not upgrading

Description of issue or problem I’m having:

hello, I am trying to upgrade my OJS 3.1.1.4 to 3.3.0.7 but failed. I at least attempted 30 times but fail.

currently using PHP 7.3.26
mysql 5.X

Steps I took leading up to the issue:

in start it failed and on second attempt it shows some table already exists e.g author_temp, users_temp.

  • A database error has occurred: SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘users_tmp’ already exists (SQL: CREATE TABLE users_tmp AS (SELECT user_id, first_name, last_name, middle_name, salutation, suffix FROM users) )

on next attempt after restoring DB and removing temp_xxx tables

now it playing game like once it said

2nd Last Attept : 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) ))

next time it will raise same error but with different table name like "citations, Notes, Publications etc.

if I removed one table which causing error as mentioned above
next time it will raise same error but with different table name like "citations, Notes, Publications etc.

Last Attempt:

  • A database error has occurred: SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘submissions’ already exists (SQL: CREATE TABLE submissions ( submission_id BIGINT NOT NULL AUTO_INCREMENT, locale VARCHAR(14), context_id BIGINT NOT NULL, section_id BIGINT, current_publication_id BIGINT, date_last_activity DATETIME, date_submitted DATETIME, last_modified DATETIME, stage_id BIGINT NOT NULL DEFAULT 1, status TINYINT NOT NULL DEFAULT 1, submission_progress TINYINT NOT NULL DEFAULT 1, work_type TINYINT DEFAULT 0, PRIMARY KEY (submission_id) ))

Application Version OJS 3.1.1.4 and want to upgrade 3.3.0.7

Please help me out. i did not upgrade from last 3 year due to theses complications.

Thanx in Advance

It looks like your running the upgrade script without restoring your previous database first. If the upgrade fails you need to drop ALL of the tables and then restore because the upgrade creates new tables. If you restore your db without dropping all the tables you’ll get those types of errors. In addition to backing up and restoring your db, you should be doing the same with your file folder because the upgrade rearranges files and directories.

As Bart explained, you can not run an upgrade over a partially upgraded ojs… you need to recover your backup version and start again.

You also need to know that you can not upgrade directly from 3.1.1.4 to 3.3… you need to upgrade to 3.2.1 first and then you can jump directly to 3.3.0-7.

The recommended upgrade route is: 2.x > 2.4.8-5 > 3.1.2-4 > 3.2.1-4 > 3.3.x-x

If you have some experience with docker, take a look to this link.

Cheers,
m.

thanx for reply, in this discussion , i found that @asmecher said there is no issue in upgrading from 3.1 to 3.3.

I am restoring database from backup, but not other files

1 Like

thanx for your kind words,

I am restoring DB from backup but not all other files. means not unzip ojs-3.3.0-7.tar.gz. and I don’t think it will work for me as all issues till now are relating to DB.
I also tried new mysql DB 8.X, restore data in it and update, after 5 to six minutes it raise internal server error 500

I also tried to upgrade 3.1… to 3.2… but same issue, it give gateway timeout message and thats it.

hi @asmecher , Plz help me out.

@asmecher Is there any way if some one lost the database/backup original with 3.1? after failed attempts it changed and not available in actual form now. then what is the solution for upgradation?

Hi @blackprinceaj,

No, there is no easy way to recover from a partial upgrade without a backup. See e.g. this post for a discussion of partially-upgrade databases: DB Error: Unknown column 'primary_contact' in 'where clause - #15 by asmecher

I see you’ve continued the conversation about upgrades on another thread: Partial Upgrade From 3.1 to 3.3

Please continue the discussion there, and try to post your question just once in the best place you can find.

Thanks,
Alec Smecher
Public Knowledge Project Team