Cant finish upgrade error

Hello, I have start OJS upgrade, latest OJS version2 to latest version3.
On the Upgrade process, a page has a message
“A database error has occurred: Table ‘review_assignments_tmp’ already exists”

Upgrade Open Journal Systems

OJS Version 3.1.1.4

Thank you for downloading the Public Knowledge Project’s Open Journal Systems . Before proceeding, please read the README and UPGRADE files included with this software. For more information about the Public Knowledge Project and its software projects, please visit the PKP web site. If you have bug reports or technical support inquiries about Open Journal Systems, see the support forum or visit PKP’s online bug reporting system. Although the support forum is the preferred method of contact, you can also email the team at pkp.contact@gmail.com.

It is strongly recommended that you back up your database, files directory, and OJS installation directory before proceeding.

If you are running in PHP Safe Mode, please ensure that the max_execution_time directive in your php.ini configuration file is set to a high limit. If this or any other time limit (e.g. Apache’s “Timeout” directive) is reached and the upgrade process is interrupted, manual intervention will be required.

Errors occurred during installation:

  • A database error has occurred: Table ‘review_assignments_tmp’ already exists

How to solve that?
Can I delete Table ‘review_assignments_tmp’?
I try to upload a database backup before the upgrade but no help
Thank you

I don’t know exactly, but such errors usually indicate that your trying to upgrade the database, that already failed to upgrade. You need to restore the default one from backup before trying once more. Is it your case?

Thank you, I try that but seems that is already incuded from some earlier failured upgrade. Can you suggest me some other solution?

Have you got a backup of the database?

Yes I have but when make restore and try upgrade unfortunately get the same error.
Can you suggest me some other solution?

Are you sure that you are using a database dump that wasn’t exposed to any prior updates to OJS 3+?
The update process is trying to create a temporary table that is already created.
As I see from the script, it is a part of an update process, so this database was already processed during the update.

No, I am not sure, have filling it is exposed to update process. Is there any way to solve this?

Theoretically, if going step by step with SQL queries, it may be done, but I’m not sure and I’m definitely not an expert here. Maybe @bozana knows more.

Hi @komir

First to be sure: Do you have a clean backup of your OJS 2 DB? Is your OJS 2 installation active/running? – In that case you could make a new, clean backup…

Best,
Bozana

Hi @bozana

Yes it is active and running

I don’t think so because I have
review_assignments_tmp
notes_tmp
inside SQL.

Hi @komir

You can then make a new, clean OJS 2 full backup again, right?
Or, did you do the upgrade on that running OJS 2 installation and without keeping the backup?

Best,
Bozana

@bozana
Thx for your help
The last backup I have is back up with

review_assignments_tmp
notes_tmp

so think I stuck with no clear backup :disappointed_relieved:
Is there any solution for this?

Hi @komir

So your OJS 2 live/productive installation contains those …_tmp tables, correct?
In order to figure out first what was the last upgrade step done:
Does your DB table citations has the column assoc_id or submission_id?
Do you have and which one of the following tables in your DB: submission_files, item_views, submission_galleys, navigation_menus?

Lets first see how your situation is, to then see if something can be done…

Best,
Bozana

Thank you @bozana

Yes

No there is no assoc_id or submission_id

Yes I have submission_files, item_views, submission_galleys, navigation_menus

Best regards

Hi @komir

Phew… that will be difficult to figure out and solve :frowning: First we would need to figure out what all upgrade scripts were already executed (from this list: ojs/upgrade.xml at ojs-3_1_1-4 · pkp/ojs · GitHub) and then the question is if the installation can be ‘repaired’ at all :frowning:
I also do not understand how can it be that your installation is still working correctly :open_mouth:

Do you have DB table genres and something in it?
Do you have entries with setting_name = submissionKeyword in your DB table controlled_vocab_entry_settings?

Best,
Bozana

Dear @bozana thank you for your help. Think I will have to make it all over again but don’t know how.
I there any way to make a new installation and migrate data to the new installation?

Hi @komir

Unfortunately there is no easy way to migrate data to a new installation: you can only migrate issues (together with articles) and users using the OJS native and users export/import plugin – the other content, e.g. the journal settings and reviews can not be migrated (exported/imported). If this is not a big deal for you, you would then need to somehow migrate the data to a new OJS 2.4.8 installation and when this installation is clean to make a fully backup and upgrade to OJS 3.1.1-4. You cannot migrate (export/import) issues and users directly from OJS 2.4.8 to OJS 3.1.1-4 because the XML schema changed – you would need to adapt it, which is also not an easy task.

Best,
Bozana