DB: duplicate key entry '23' for key 'PRIMARY'

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 97
Joined: Thu Dec 06, 2007 9:58 pm

Re: DB: duplicate key entry '23' for key 'PRIMARY'

Postby paul » Tue Apr 16, 2013 1:23 pm


The change worked. Thanks.


Posts: 97
Joined: Thu Dec 06, 2007 9:58 pm

Re: DB: duplicate key entry '23' for key 'PRIMARY'

Postby paul » Wed May 22, 2013 3:51 pm

I am still having problem with upgrading from 2.3.3 to 2.4.2. Here is what I did and got:

1) Full package file upgrading
2) run php tools/upgrade.php upgrade to upgrade database. The output is shown in the image below. It doesn't say whether the database upgrade is successful or not.

upgrade_output.jpg (602.09 KiB) Viewed 500 times

3) I checked the database with phpMyadmin. The database number increased from 98 to 112.
4) Following files in the old database were renamed to filename_old: articles_old, article_galleys_old, issues_old, published_articles_old. The corresponding files in the new database are all empty.
5) When I view the website, everything looks fine except there is no articles.
6) I renamed table articles to articles_e and articles_old to articles, ...... Issues and articles are displayed correctly.
7) I have to stress that there are differences between these 2.4.2 and 2.3.3 tables in terms of number of columns and column names. This may create problems when new contents are added to the website.
8) I checked the OJS version by going to about/About this publishing system. I found "This journal uses Open Journal Systems ......"
9) I went back to the database and checked the version table. The version table did not get updated at all.

Here is my question: I have 2.4.2 files, and my database is upgraded to some degree. Is my OJS 2.4.2? Looking at the image above, I noticed the version numbers stop at 2.3.7. Does it mean anything?

Thank you.


Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: DB: duplicate key entry '23' for key 'PRIMARY'

Postby asmecher » Wed May 22, 2013 4:03 pm

Hi Paul,

Unfortunately no, that doesn't look like a completed upgrade. Typically when an upgrade fails there's an error message, but I don't see anything of the sort there; have you checked your PHP configuration to see where error messages are sent? (Try inspecting your config using "php -i" -- just looking for the php.ini config file can be misleading, because there is sometimes one file for command-line and another for web-based PHP access.)

Alec Smecher
Public Knowledge Project Team

Posts: 97
Joined: Thu Dec 06, 2007 9:58 pm

Re: DB: duplicate key entry '23' for key 'PRIMARY'

Postby paul » Thu May 23, 2013 2:07 pm

I didn't see anything interesting in the error log.

I was able to upgrade from 2.3.3 to 2.3.8 but had similar problem with upgrading from 2.3.8 to 2.4.0 and above. I have tried many things but none worked. I gave up. Hope upgrading to V3 is smooth.



Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 2 guests