OJS 3.4.0.5 and 3.4.0.8, tested on both.
When importing a Native XML file generated from a different OJS environment (or journal), the import fails due to hardcoded internal database IDs (submission_id
, publication_id
, doi_id
, etc.) that conflict with existing records in the target database.
Reproduction Steps:
- Export a submission using the Native XML Plugin from Journal A (DEV).
- Attempt to import the resulting XML into Journal A (PROD that receives real time submissions).
- The import process fails with the following error:
SQLSTATE[23000]: Integrity constraint violation: 1216 Cannot add or update a child row: a foreign key constraint fails (SQL: update publications
set access_status
= 0, date_published
= 2024-05-28, last_modified
= 2025-05-15 10:53:14, primary_contact_id
= 0, section_id
= 27, seq
= 1, submission_id
= 2382, status
= 3, url_path
= ?, version
= 1, doi_id
= 1219 where publication_id
= 2344)
submission_id
= 2382 is already in use by publication_id
= 2348
Imports between journals or instances are unreliable unless IDs are manually stripped or the target database is empty/same as source.
I encountered similar behavior when migrating a journal from another OJS system where the journal had an ID of 1. In that case, I had to manually adjust the records in sql to match the structure and IDs of the new system.
P.S. As sys.admin I get involved only when redactor has issues exporting/importing journals.
Could this issue be related to primary_contact_id = 0
? Implementing an admin-side search field for such cases would be helpful.
For example, the ability to search by publication_id = 2344
or submission_id = 2382
to locate the exact submission or publication would make it easier to identify and populate any missing required fields.
Are there any suggestions regarding this issue or we are doing something incorrectly?