Upgrade fron 2.4.8-4 to 3.2.0-1 Duplicate entry 'xxx-x' for key 'citations_publication_seq'

I’m trying to ugrade from OJS-2.4.8-4 to OJS-3.2.0-1 just published.
I’ve obtained this error:
Upgrade failed: DB: Duplicate entry ‘1323-1’ for key ‘citations_publication_seq’
whwn the upgrade process was in
[data: dbscripts/xml/upgrade/3.2.0_versioning.xml] step

I commented this situation but upgrading to 3.2.0-0 in #5626
My proposed solution was
Delete the unique index just before the update sentence and rebuild the index after the update sentence.

Thanks in advance

Hi @Respinosa,

Check this comment: [OMP] Error upgrading from version 3.1.2-4 to 3.2.0 · Issue #5583 · pkp/pkp-lib · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team

Hey @asmecher is there a version of that query that works for OJS 2.4? The problem with going directly from 2.4 to 3.2 is that you don’t have a submissions table and the old citations table uses an assoc_id/assoc_type combination. Thanks!

I ask because I’m hitting the citation key problem, even though I’m running on a stable-3_2_1 checkout so I theoretically have the commits that remedy this bug. We’re upgrading from a 2.4.8.1 installation.

Hi @jnugent,

You should still be able to flush and re-generate the citations, even though 2.x uses assoc_type/assoc_id to identify the related submission, and 3.x uses submission_id. (As always, make sure to keep a good backup.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher, I also encountered this error, upgrading 2.4.8 to 3.2.1, on the same xml.

What do you mean by flush and regenerate? I tried to run the query after the error, but there was Unknown column ‘c.submission_id’ in 'on clause. In the end, I commented out the index in metadata.xml too.

Thanks.

Hi @apit,

See: Upgrade error: Duplicate entry 'xxx-yyy' for key 'citations_publication_seq' · Issue #5626 · pkp/pkp-lib · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team