1

Around a year ago, a client considered moving to Magento 2 and at the advice of another developer, they installed the data-migration-tool to prepare for a migration to Magento 2.

However, they realized the (unnecessary) cost of re-writing all their extensions and they have since made the decision to stick in the v1 universe and migrate (or upgrade) to OpenMage.

However, the data-migration-tool has done a few things they didn't know would happen.

It has created a m2_cl_ table for nearly every table in the database.

mysql> show tables;
+----------------------------------------------------------+
| Tables |
+----------------------------------------------------------+
| m2_cl_customer_entity |
| .... |
+----------------------------------------------------------+
651 rows in set (0.02 sec)

On the surface, this doesn't appear to be a major problem. However, they now have a replica of almost every table in their database - and the data is also duplicated.

To add to this... Each of these tables appears to have a corresponding trigger.

mysql> SHOW TRIGGERS FROM `__` WHERE `table` = "customer_entity";
+----------------------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+
| Trigger | Event | Table | Statement | Timing |
+----------------------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+
| trg_customer_entity_after_insert | INSERT | customer_entity | BEGIN INSERT IGNORE INTO m2_cl_customer_entity (`entity_id`, `operation`) VALUES (NEW.entity_id, 'INSERT')ON DUPLICATE KEY UPDATE operation = 'INSERT'; END | AFTER |
| trg_customer_entity_after_update | UPDATE | customer_entity | BEGIN INSERT IGNORE INTO m2_cl_customer_entity (`entity_id`, `operation`) VALUES (NEW.entity_id, 'UPDATE')ON DUPLICATE KEY UPDATE operation = 'UPDATE'; END | AFTER |
| trg_customer_entity_after_delete | DELETE | customer_entity | BEGIN INSERT IGNORE INTO m2_cl_customer_entity (`entity_id`, `operation`) VALUES (OLD.entity_id, 'DELETE')ON DUPLICATE KEY UPDATE operation = 'DELETE'; END | AFTER |
+----------------------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+

This makes their DB twice the size it should be, and then the triggers put unnecessary extra load on the DB.

Does anyone have a quick way to remove all these tables and triggers?

asked Nov 28, 2023 at 18:13

1 Answer 1

0

I don't know if the user that has made the question above has found a solution. But for me, I simply deleted these tables and reinstalled OpenMage using .zip method and it fixed the DB.

If you have PHPMyAdmin you can look for "m2_" table prefix and it will show all the tables with that prefix, just delete them all.

Oh yes, make a full backup of the DB b4 trying that.

answered May 27, 2024 at 20:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.