I’m getting this strange Duplicate entry ‘5–allowRegAuthor’ for key ‘journal_settings_pkey’ when trying to import journal_settings from a single journal installation into a multiple journal installation.
I changed journal_id on the single install database to the corresponding journal id in the multiple journal install. Then exported the data as an sql and tried to execute the insert commands only.
Should I run the whole SQL file with the create journal_settings if exists command??
This indicates that you already have a “allowRegAuthor” setting for journal id #5 in table journal_settings.
If you’ve created a “placeholder” journal on the multiple journal installation with the desired journal id (of 5?), you will have existing data in the tables which will then conflict with the INSERT statements you want to run.
When creating a new journal, there are no journal_settings for the specific journal created. At least, that’s what I got from querying the database.
However, there’s a *_pkey thing that seems to be some kind of index.
When I try to import the settings from one install into another, what I do is run a select * from journal_settings where journal_id = x . Then, export that as SQL command. That SQL doesn’t execute correctly, so there must be some parameters to the SQL that need to be added so that it can work.
If I add dummy content, remove it from the new install, then the SQL runs okay.
I saw that in the table structure, but I’m not an expert in databases, so I don’t really know what it does or why would it prevent from adding content to the table when it’s “empty”, only after I added and removed dummy content.
The index (Key_name) journal_settings_pkey spans three columns on the table journal_settings: journal_id, locale, and setting_name. The 0 in non_unique means the index cannot contain duplicates.
The error message ‘5–allowRegAuthor’ means a duplicate was found with the values “5”, (blank), “allowRegAuthor” in Seq_in_index order.
This combination either existed in the table (or was orphaned in the index) before import, or was attempted to be added twice in the import.
“This is an import/export plugin for OJS 2.4.6 for transfering journals among OJS portals. The content of a journal is transfered in the process, including articles in review, submitted articles, email and event log.”