Error upgrading OJS 3.1.2 -> 3.3.0.6

Hi, I’m trying to upgrade OJS to version 3.3.0.6, but I receive this message in the console
“Integrity constraint violation: 1062 Duplicate entry ‘0-1’ for key ‘citations_publication_seq’ (SQL:
UPDATE citations as c
SET c.publication_id = (
SELECT s.current_publication_id
FROM submissions as s
JOIN temp_citations as tc ON s.submission_id = tc.submission_id
WHERE c.citation_id = tc.citation_id
) ORDER BY c.publication_id ASC
)”

I have a lot of info in my database, but I receive this error and I’m not to know to do. Please Help meee!!

Hi,

Fortunately it’s easy to workaround this issue.

First, make sure you have a backup from everything. If something goes wrong, you’ll thank yourself for this.

The citations table might be truncated before the upgrade, and regenerated after it, but you’ll need command line access to your OJS.

Before you start the upgrade, truncate the table:

TRUNCATE TABLE citations;

Perform the upgrade as usual, and you should face no issues since the table is now empty.

Then let OJS repopulate the citations table:

cd /home/youruser/www/
php lib/pkp/tools/parseCitations.php all

Remember: make sure you have backups before proceeding, and that you can access your server via SSH to run the commands as needed.

1 Like

This topic was automatically closed after 10 days. New replies are no longer allowed.