When I installed a new module and did the setup:upgrade
I received this message:
3 Answers
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.– ivaCommented Jun 12, 2019 at 14:37
-
1For 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– MacasCommented Jul 4, 2019 at 9:35
-
1same Temado problem for me /vendor/temando/module-shipping-m2/Setup/UpgradeData.php just comment the 2 addPickup calls as @Macas said Commented 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.– MacasCommented Aug 6, 2019 at 13:56
-
Run:
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.
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
- open your database
- RUN
SELECT * FROM email_template
- Here in the
template_code
column andorig_template_code
you will find the duplicate template id . You just have to remove that row from the table. - 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