When I installed a new module and did the setup:upgrade I received this message:

Duplicate Of Template Name on Magento 2

3 Answers 3


Duplicate of Template name comes from the module-email So setup:upgrade tries to add e-mail templates that already exist. Remove any non altered templates from the database.

  • This is a correct answer. Setup version is just a consequence of this.
    – iva
    Jun 12, 2019 at 14:37
  • 1
    For me it was Temando_Shipping, it was trying to add Emails here so I was able to track down exact emails that I have to remove \Temando\Shipping\Setup\SetupData::addPickupOrderEmailTemplate \Temando\Shipping\Setup\SetupData::addPickupOrderGuestEmailTemplate
    – Macas
    Jul 4, 2019 at 9:35
  • 1
    same Temado problem for me /vendor/temando/module-shipping-m2/Setup/UpgradeData.php just comment the 2 addPickup calls as @Macas said Aug 5, 2019 at 10:56
  • @open-ecommerce.org you can either remove one those methods or remove emails from database. Ofc if you chose to remove methos - after you finish your setup upgrade, do not forget to return them back.
    – Macas
    Aug 6, 2019 at 13:56
  • This should be the accepted answer Dec 5, 2020 at 9:43


bin/magento setup:upgrade

Probably the issue is on database, so open the table setup_module and complete the module that doesn't have data_version completed.

Duplicate Of Template Name on Magento 2


hey i had the same problem , Remko de Keijzer is right here , the problem is any module is trying to add email template that already exist , to solve this

  1. open your database
  2. RUN SELECT * FROM email_template
  3. Here in the template_code column and orig_template_code you will find the duplicate template id . You just have to remove that row from the table.
  4. To find which one is duplicate go to Setup/InstallData.php file of the problematic module , like in the above example error comes immediately below Amasty_Rma so it is problematic.

Hope this saves your time

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.