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: https://github.com/pkp/pkp-lib/issues/5583#issuecomment-601397764

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