Importing journal into another install

Hello all,

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??

Any ideas as to how to proceed?

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.

Have you considered the Full Journal Transfer plugin?

Hello @ctgraham,

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.

The journal_settings_pkey is the primary key index on the journal_settings table.

You can use the mysql command SHOW INDEXES FROM journal_settings to see the definition.

Hello @ctgraham,

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 indexes essentially provide rules for the data which allows for optimization of data access:

mysql> show indexes from journal_settings;
| Table            | Non_unique | Key_name                    | Seq_in_index | Column_name  | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
| journal_settings |          0 | journal_settings_pkey       |            1 | journal_id   | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| journal_settings |          0 | journal_settings_pkey       |            2 | locale       | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| journal_settings |          0 | journal_settings_pkey       |            3 | setting_name | A         |         526 |     NULL | NULL   |      | BTREE      |         |
| journal_settings |          1 | journal_settings_journal_id |            1 | journal_id   | A         |           3 |     NULL | NULL   |      | BTREE      |         |
4 rows in set (0.00 sec)

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.

Perhaps you just had a corrupt index momentarily.


there is a plugin that allows journal migration, exporting an OJS journal from a single instalation and importing it into another

it is available at GitHub - lepidus/fullJournalTransfer: OJS plugin for importing/exporting a journal with all its private information (e.g. submitted articles, reviews, editorial decisions, etc.)

“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.”