I’m testing my upgrade procedure from OJS 3.1.1-4 to 3.2 on Ubuntu LTS, php7.2, mysql 5.0.12,
Package from https://pkp.sfu.ca/ojs/ojs_download/
using sudo php tools/upgrade.php upgrade
I’m getting ERROR: Upgrade failed: DB: Duplicate entry '471-1' for key 'citations_publication_seq'
This happens upon dbscripts/xml/upgrade/3.2.0_versioning.xml line 163
The data itself in publication_id = 471 is fine and seq = 1 is unique for 471 (table: citations)
To keep you updated:
I finally commented out lines 40 to 44 in /lib/pkp/xml/schema/metadata.xml
Afterwards the install script runs smoothly
I suspect that the temporary column submissions.current_publication_id created a shift / an offset in the course of renaming submissions to publications. That caused a double entry in the index citations_publication_seq. I am not sure about the consequences, yet.
Can you try reversing that change, loading everything from backup from before you upgraded to 3.2.x, and running the upgrade again to confirm whether that prevents the error?
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @asmecher
thanks for having a look at this. Your proposed change doesn’t do the trick. The error remains.
I am currently trying to learn how publication_id is constructed during the upgrade. I suspect there is a slight mistake in my database that causes the offset(s). Maybe you could explain that query.
Deleting the index from the citations table caused a mess: some publications were missing their citations and some might have been associated with the wrong submissions. But that confirmed my suspicion.
Hi @asmecher
It turned out that the data is there and it’s all fine.
I was confused because article_details.tpl now reads the references in a different way.
The situation is that I have bunch of submissions/publications that do have entries in the table citations but NULL in submissions.citations (old naming).
Those entries that are empty in submissions.citations get an empty entry in new: publication_setting.setting_name->citationsRaw
Those that used to be NULL in submissions.citations do not get this setting at all. It turns out that in order to display references from citations the setting “citationsRaw” needs to be present and must not be empty.
Maybe that helps others too.
As for the index mentioned above: It was no problem to set the index citations_publication_seq by hand after the upgrade.
Can you describe how you ended up with citations entries that didn’t come from a corresponding citationsRaw? Was this something caused by the upgrade process?
Thanks,
Alec Smecher
Public Knowledge Project Team