Database error on upgrade OJS 2.4.8.1 to OJS 3.0.2

I tried to upgrade OJS 2.4.8.1 to OJS 3.0.2 and received the errors>

A database error has occurred: Table ‘issue_galleys_stats_migration’ already exists

In error log I found>

[18-Jul-2017 16:27:53 Europe/Belgrade] PHP Warning: file_exists(): open_basedir restriction in effect. File(plugins/oaiMetadataFormats/README/index.php) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/local/cpanel/base/3rdparty) in /home/ijcadsee/public_html/lib/pkp/classes/plugins/PluginRegistry.inc.php on line 224
[18-Jul-2017 16:27:53 Europe/Belgrade] PHP Warning: file_exists(): open_basedir restriction in effect. File(plugins/oaiMetadataFormats/README/READMEOaiMetadataFormatsPlugin.inc.php) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/local/cpanel/base/3rdparty) in /home/ijcadsee/public_html/lib/pkp/classes/plugins/PluginRegistry.inc.php on line 233
[18-Jul-2017 16:27:54 Europe/Belgrade] Table ‘issue_galleys_stats_migration’ already exists
[18-Jul-2017 16:28:02 Europe/Belgrade] PHP Warning: file_exists(): open_basedir restriction in effect. File(plugins/oaiMetadataFormats/README/index.php) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/local/cpanel/base/3rdparty) in /home/ijcadsee/public_html/lib/pkp/classes/plugins/PluginRegistry.inc.php on line 224
[18-Jul-2017 16:28:02 Europe/Belgrade] PHP Warning: file_exists(): open_basedir restriction in effect. File(plugins/oaiMetadataFormats/README/READMEOaiMetadataFormatsPlugin.inc.php) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/local/cpanel/base/3rdparty) in /home/ijcadsee/public_html/lib/pkp/classes/plugins/PluginRegistry.inc.php on line 233
[18-Jul-2017 16:28:02 Europe/Belgrade] Table ‘issue_galleys_stats_migration’ already exists

I did two upgrade on other domain without errors, but here I receive it. What I did? From all domain delete all files expect the public file, config.inc.php, index.php and copy there OJS 3.0.2 without mentioning files. Than update the database. I tried to upgrade first to OJS 2.4.8.2 than to OJS 3.0 but the same error. Last two domains passed without errors, but now is the problem. What can I do to solve this problem and upgrade to OJS 3.0.2?

Hi @Lazar_Stosic,

See UPGRADING OJS 3.0.0 A database error has occurred: Duplicate entry 'tinymceplugin-0-enabled' for key 'plugin_settings_pkey' - #14 by OJSUSER11.

Regards,
Alec Smecher
Public Knowledge Project Team

Dear @asmacher,
I read it this post earlier. I backup my last database and whole home directory, but cannot update again to OJS 3.0.2. Is there other opportunity to upgrade to OJS 3.0.2 and to have all issues and articles? Could i Install fresh copy of OJS 3.0.2 and import all issues and articles?

Hi @Lazar_Stosic,

I’m not sure I understand – is your only copy of your database and files area the one that has already experienced the error message above?

Regards,
Alec Smecher
Public Knowledge Project Team

Dear @asmecher,
No. This is not only copy of database and files. Very often, after major changes in publishing or changing the website, I made the backup. I tried with three last database and receive the same errors. Older database and files give me the older version of website with older articles. But again, I received the database error on upgrade. I don`t have idea what to do and how to solve the problem with the database.
I wonder, if I export issues and articles in old OJS, could I import the same in new OJS 3.0.2 to have all issues and articles published?

Hi @Lazar_Stosic,

When you restore your database backups, are you making sure to DROP and CREATE the database again as part of the process? Loading a database dump without dropping the database first may leave extra tables lying around.

Regards,
Alec Smecher
Public Knowledge Project Team

Dear @asmecher,
Now I have done whole process. DROP the database with SQL command and CREATE the database again. After creating and importing my last database I didn`t have article_migration table and issue_galleys_stats_migration table. I started the process of an upgrade (I did it this process on few live website to OJS 3.0.2 without problem). When I click the Upgrade database button, first I received the error DB Error: Unknown column ‘pkp_section_id’ in ‘field list’ and after refreshing the page error: A database error has occurred: Table ‘issue_galleys_stats_migration’ already exists
Also, I read a lot of posts and saw that this is a specific problem. Nobady gave concrete results. Is there other way to solve this problem?

Hi @Lazar_Stosic,

The pkp_section_id error message is the relevant one. This thread recommends a specific patch; have you tried that?

After applying it, restore from backup so that the upgrade is clean. Reloading the page after a failed upgrade attempt will just complicate things further.

Regards,
Alec Smecher
Public Knowledge Project Team

What patch did you mean exactly? Could you send me the link?

Hi @Lazar_Stosic,

This one: pkp/pkp-lib#2295 upgrade of old statistics to 3.x · bozana/ojs@fc73c76 · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team

Dear @asmecher,
We made one step forward :sweat_smile: . I removed the previous error and now I have new one: A database error has occurred: Duplicate entry ‘defaultthemeplugin-0-enabled’ for key ‘plugin_settings_pkey’ and also A database error has occurred: Duplicate entry ‘190-3-1’ for key ‘review_rounds_submission_id_stage_id_round_pkey’. I tried with my few last database but the errors are same.
Where is the problem now???

Hi @Lazar_Stosic,

The review_rounds_submission_id_stage_id_round_pkey message can be resolved per the instructions at Upgrade to 3.0.0: pkey violation on review_rounds · Issue #1921 · pkp/pkp-lib · GitHub – it’s a data error in your OJS 2.x install that’s causing trouble with the 2.x to 3.x upgrade process.

Regards,
Alec Smecher
Public Knowledge Project Team

Dear @asmecher,
This is just another circle. After this instruction I came back at the beginnig and the error Duplicate entry ‘defaultthemeplugin-0-enabled’ for key ‘plugin_settings_pkey’ . My old database doesnt have article_migration table in it but, after upgrade new one has. I looked on the link https://forum.pkp.sfu.ca/t/upgrading-ojs-3-0-0-a-database-error-has-occurred-duplicate-entry-tinymceplugin-0-enabled-for-key-plugin-settings-pkey/19415/19 but always after upgrade received the article_migration table in the database and all my steps before this is at the beginning. Almost whole week I cannot solve this problem and every day crash down website and backup OJS 2.4.8.1 again. A lot of posts on forum but nothing concretly to solve this problem which will be very often because a lot of users use OJS 2.x and still didnt accept upgrade to OJS 3.x.

Dear @asmecher,
I tried to upgrade OJS with my older database but received always some kind of errors, different errors. Is there opportunity to install new OJS 3.0.2 and import all issues and articles in OJS 3.0.2? I don`t have an idea how to solve this problem. After all steps, patches, codes… I am again at the beginning. Read it a lot posts, but nothing. Now with older database and backup received an error DB Error: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
Is there other way how to continue with OJS 3.0.2?

Hi @Lazar_Stosic,

It looks like you’re moving ahead with an import/export approach based on this thread. But I’m wondering why you might be getting different errors when performing the upgrade – restoring from backup and performing the same steps twice should result in the same outcome. It’ll be a lot easier to debug if this is systematic.

Regards,
Alec Smecher
Public Knowledge Project Team

Dear @asmecher,
Thank you for your mail. Yes, it is more easy to work with older domain, but, I cannot solve the problem with the database. Now I received an error with older database and some articles wont open. I really dont know what to do next. Now I made subdomain, instal new OJS 2.4.8.1 and new database and try to import issues. I have got some problems, but wait answer from your colleagues about importing. You can read it our conversation on this thread.
If you have some advice for my old database, how to solve the problem and upgrade to OJS 3.0.2 feel free to give me advice. I am really empty with an idea what to do and now is the time when I will start to receive new articles for new issue. I am ready to continue with correcting this error because many of my colleagues which I know work under OJS 2.4.8.1 and afraid to start with OJS 3.0.2 because they read a lot of problems with the upgrade.
I am looking forward to hearing proposal from you.

Hi @Lazar_Stosic,

What would help is a comprehensive description of the upgrade process that gets you closest to a functional installation: the steps you take to perform an upgrade (e.g. drop database, create database, load backup), any interventions you make e.g. SQL queries before running the upgrade script, and then the end result (error message). I might be able to suggest where and when to make another intervention; you could replay the steps and post the new response; etc.

Regards,
Alec Smecher
Public Knowledge Project Team