Upgrade deletes all citations

I noticed when upgrading from to that all the citations were being deleted.

Checking the dbscripts, I noticed a file in called 3.1.1_preupdate_citations.xml which deletes all citations which do not have an assoc_type of 527. However, my citations table has the assoc_type 257.

I’m wondering if either:

a) my assoc_type of 257 should have been changed to 527 at some time but failed to (maybe during a previous update) or,

b) 527 should actually be 257.

Can anyone confirm this?

Ah, you are correct @haydenyoung! It should be 257 :frowning: Oh, sorry, this is my fault :frowning:
I’ll fix this in this GitHub Issue: Fix wrong assoc_type in citations upgrade · Issue #3749 · pkp/pkp-lib · GitHub

So do you have any citations in your DB table now?
Do you have entries in your DB table submissions, column citations? If so, you could use the script lib/pkp/tools/parseCitations.php to parse and save them anew…

Sorry, sorry, sorry… :frowning:

@bozana Np, I had it all backed up so just reinstalled the old table adjusted the xml file to use 257 and reran the upgrade.

Do you have entries in your DB table submissions, column citations?

Yes I do. I didn’t know I could use a citation parser; should I test this out as an alternative solution?

Thanks for the quick response.

Hi @haydenyoung

Then everything ok :sweat_smile:
Those citation came from OJS 2 and were already parsed correctly. Those citations coming from OJS 2 are not used any more – the assoc_type for submission changed, it is not 257 any more – but they are still in the DB table citations – for any case.
In OJS 3 there is the possibility to parse the citations line by line as editor (im submission metadata modal > references tab). Then they will be saved in that DB table citations and used for presentation on the article view page. Maybe you can test it with one article to see how it works/looks like. If you would like to use it that way, you could run that script to parse all citations anew. The current citation parsing is above all implemented as a first step for the Crossref reference linking feature.