Problem Upgrade Ojs2 to OJS3

There is a serious problem in upgrading from OJS 2.X to 3.
There is an error at middle of upgrading: "
A database error has occurred: Table ‘issue_galleys_stats_migration’ already exists"
• Even when the issue_galleys_stats_migration is deleted. again there will be an error of 'A database error has occurred: Duplicate entry ‘2-1-3-1’ for key ‘review_round_files_pkey’
Even when the deleted. again there will be an error
• A database error has occurred: Duplicate entry ‘defaultthemeplugin-0-enabled’ for key ‘plugin_settings_pkey’
Even when the deleted. again there will be an error
• A database error has occurred: Duplicate entry ‘defaultthemeplugin-1-enabled’ for key ‘plugin_settings_pkey’
Even when the deleted. again there will be an error
• A database error has occurred: Duplicate entry ‘themePluginPath-’ for key ‘site_settings_pkey’
Even when the deleted. again there will be an error
• A database error has occurred: Duplicate entry ‘defaultthemeplugin-1-enabled’ for key ‘plugin_settings_pkey’
Even when the deleted. again there will be an error
Duplicate entry ‘3-4-3-1’ for key ‘review_round_files_pkey’

There are may users that want to upgrade from 2.x to 3, but they are not able to do that. If you search in forums of OJS, you can see nobody still was able to solve this problem.
Please help me

Hi @Adminojs,

If the issue_galleys_stats_migration table already exists in your installation, it means that an upgrade was already attempted and it failed. You’ll need to drop your database, then re-create it (empty) and load from a backup taken before the upgrade was first attempted.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,
I am facing the same issue of (issue_galleys_stats_migration table already exists) and I don’t have a previous copy of backup database! Please help.

Regards,
Aymen

Hi @aymen,

Do you know where your first upgrade attempt failed?

Regards,
Alec Smecher
Public Knowledge Project Team

I think it was on database upgrade.

Hi @aymen,

Yes, but do you have an error message or any indication of what step it was on? The database upgrade involves many different elements and it’ll be very helpful to know where the failure happened.

Regards,
Alec Smecher
Public Knowledge Project Team

Actually I did the upgrade from 2.4.8.1 to 3 version in earlier when 3 version revealed and the upgrade process didn’t complete. However, in your opinion what are the possibilities of occurring such a problem?

Thanks.

Aymen

Hi @aymen,

The upgrade script does a lot of things to adapt the data from a form the old version expected to the form the new one expected. Any number of things could cause it to fail in process – file permission problems, data inconsistencies, a PHP time limit on your server, etc. When the upgrade process fails it stops, so your database will be left somewhere between the two versions. Without knowing the error message it gave when it failed, I have no way of knowing what state your database is in, so it’s hard to offer advice in resuscitating it – this is why we strongly recommend taking a backup before up upgrade, so that this can be restored in case of an upgrade failure.

If you don’t have a backup, you may need to walk through the upgrade steps scripted in dbscripts/xml/upgrade.xml.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher,
I will try using upgrade.xml.

Regards,
Aymen

Hi @aymen

Have you tried to upgrade only once or several times?
How many journals, issues, articles, users do you have?

Does this mean that you do not have any backup i.e. no working version of your journal? – I believe it is impossible to restore everything correctly without such a backup/version :frowning:

Please do a backup of everything before you try further!!!

You could go this list of questions, to try to first figure out where the upgrade stopped:
Do you have the column “comments_to_ed” in your DB table “submissions”?
Do you have the DB table “library_files”?
Do you have an entry in the DB table “email_templates_defualt”, whre email_key = “EDITOR_DECISION_SEND_TO_PRODUCTION” ?
Do you have any of these DB tables: signoffs, article_files_migration, articles_migration, article_supplementary_files, article_supp_file_settings, submissions_tmp?

Best,
Bozana