Multiple versions of prepared emails

Hello, we recently upgraded to on dev and prod systems, dev seems fine but on the prod system all prepared emails seem to be tripled up…so there are 10 pages of emails in prod as opposed to just 4 in dev. Any idea what’s causing this??



Hi @BeckettResearch,

Are you sure your productive system database upgrade finished with no error and that you ran that only once?

Also, there might be lot’s of custom prepared emails created in your productive install by users. I don’t think that’s probable, but make sure the emails are really duplicated and not just a different entry.

If you can confirm that your database upgrade went fine and that the rest of the system is working as expected, you can always dump the dev install prepared emails table and import that into your productive install.


Thanks Bruno - there are no users other than myself and a few admin colleagues (we’re still testing). See below from my colleague in IT in case you have further comment, otherwise I think we’ll do as you suggest from dev:

I’m pretty sure the database upgrade didn’t generate any errors but I have checked it’s email tables.

There are two database tables concerned with “default Prepared Emails”. One contains the actual email text and doesn’t contain any duplications. However, there is another one that contains email “types” (which point into the other text table) which does appear to have duplications.

I can do as Bruno suggested for that table and import a copy of the same table from Dev. That would require about 30 minutes downtime on Prod so would need a change control. There is a small risk associated with doing this kind of thing because changing only one table can affect the consistency of the database. For that reason it would be necessary to test the system quickly after the change (preferably before other people try to use it). If there is a problem I’ll copy back the previous contents of the table.


The table he is talking about is called email_templates_default. And yes, he is right, that table uses auto increment function to give id to the emails, and then uses that in the email_templates_default_data to implement a relation. Instead of copying only the email_templates_default table, I would suggest copying both; email_templates_default and email_templates_default_data.

That way we make sure we keep the relation. The rest of the system uses the email_key to refer to the emails, and that’s not going to change between your dev and prod systems if both are in the same OJS version.