UPGRADING OJS 3.0.0 A database error has occurred: Duplicate entry 'tinymceplugin-0-enabled' for key 'plugin_settings_pkey'

Is this a bug?

I am getting this error when trying to uprade the database.

How do I proceed ?

1 Like

Hello, I have the same problem with ‘defaultthemeplugin-0-enabled’ for key ‘plugin_settings_pkey’. Did you resolved that error?

2 Likes

Hi @Wojciech_Francuzik and @Victor_Mendez,

Are you attempting to perform an upgrade on a database that was already partially upgraded? If so, you’ll need to restore from backup to the time before the upgrade was first attempted.

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher

Exacly!

I performed the upgrade, and sth did not work so I re run this and got this error.

To resolve this I had to
mysql> DROP DATABASE databsasename;
mysql> CREATE DATABASE databasename;
mysql> use databasename;
mysql> databsasename < bacupfile.sql;

I hope this will save people some time :slight_smile:

Hello,

The steps of @Wojciech_Francuzik are Perfect. Also, try to check the errors messages in the database.

My best regards

hi!

the it work from ojs 2.4.1 to 2.4.8.1 without a problem but from 2.4.8.1 to 3 have a problem regarding table ‘article_migration’ already exist so i removed it and upgraded it again and later on error came out article_migration does not exist. i already tried’ ‘Wojciech_Francuzik’ guide.

any one can help me?

Hi @Leonard_Nelle_Villas,

It sounds like you might not have fully dropped and re-created your database. After you do that, and after you restore your OJS 2.4.1 or OJS 2.4.8-1 database from backup, does the article_migration table exist in your database?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes it has already exist!

Hi @Leonard_Nelle_Villas,

That table is only ever introduced during the OJS 2.x to OJS 3.0 upgrade. Is it possible that your backup was taken after a failed upgrade rather than before?

Regards,
Alec Smecher
Public Knowledge Project Team

Upgrade to 2.4.1 confirmed to me that there is failed upgrade. B4 Upgrading
2.4.1 to 2.8 i backup my data. There is way around to fix the issue?

Oh i know there is one failed upgrade from 2.4 to 3.0, it was done by my
co workers, he tried to upgrde it ang failed and i backup the data. So what
should i do?

Hi @Leonard_Nelle_Villas,

Do you have a backup from before the OJS 3.0 upgrade was attempted, i.e. something that doesn’t have article_migration in it? I’d suggest upgrading from that. Note that you can upgrade straight from OJS 2.4.1 to 3.0, no need to upgrade to 2.4.8-1 first.

Regards,
Alec Smecher
Public Knowledge Project Team

Okay i will try to find na back up database

Dear OJS Team,

Thanks for all your attemps for development of OJS.
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 ‘defaultthemeplugin-0-enabled’ for key ‘plugin_settings_pkey’

(The images of the both the error have been attached along this email)

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.

On the other hand OJS 2.x has some security bugs and hackers easily hack the OJS 2.x while we cannot do anything to protect our websites.

We appreciate if you guide us how to solve the problem that we face for upgrading from OJS 2.x to 3.

Thanks for your time for reading our email.

Regards
Editorial Team

Hi @OJSUSER11,

As far as we’re aware, OJS 2.4.x is secure to run; can you clarify the security problem you mention?

Are you sure you’re running the upgrade on a clean copy of your 2.x database? If you try an upgrade and it fails, you’ll need to restore from backup. Make sure to fully drop and re-create the database as part of this process.

Regards,
Alec Smecher
Public Knowledge Project Team

I did not found any previously backup database. Any solutions may help?

Hi @Leonard_Nelle_Villas,

It sounds like your first attempt at an OJS 2.4.8 to 3.0 upgrade failed, and you made a second attempt, with the result being an error message that you quoted above. This means your database is in an indeterminate state between OJS 2.4.8 and OJS 3.0, but without the error message from the first attempt, it’ll be hard to tell exactly what state your database is in.

If you’re absolutely sure you don’t have a backup, and don’t have the error message from the first attempt, your only option may be to look at the upgrade steps in dbscripts/xml/upgrade.xml and see if you can determine from the presence/absence of data what step was last completed.

This situation is exactly why we strongly recommend making a backup before upgrading.

Regards,
Alec Smecher
Public Knowledge Project Team

such head ache… dnt know what to do

this is the file.

i saw the backup and there is no article_migration in it?

Hi @Leonard_Nelle_Villas,

Is it possible that you’re just re-loading the database dump over the old database? If so, and if your database has the article_migration table in it, then loading your dump again without deleting and recreating the database will leave the article_migration table in place and untouched. After loading the database dump, and before running the upgrade script, try executing DESCRIBE article-migration; to check for sure.

Regards,
Alec Smecher
Public Knowledge Project Team