Closed
Description
Preconditions
Magento CE 2.1.5, PHP 7.0.15, MariaDB 10.0.29.
Have Index in scheduled mode.
Steps to reproduce
- Do a database backup with
setup:backup --db
. - Do a database restore with
setup:rollback -d
.
Expected result
Database is restored and includes triggers.
Actual result
Database is missing triggers, so indexing doesn't work correctly.
I noticed this problem after several product changes failed to show in the front. I realized the index was not updated and after some debugging found that there were no triggers.
I tried switching index mode to realtime and saving the product so the changes would appear. When switching back to scheduled the triggers were recreated.
I could reliably reproduce the problem afterwards which leads me to assume the problem is in the backup CLI command.
Short way to reproduce:
- Magento CE 2.1.8
- Create empty test trigger:
mysql> CREATE TRIGGER test_trigger AFTER INSERT ON catalog_product_entity FOR EACH ROW BEGIN END;
- To make sure that trigger was created:
mysql> SHOW TRIGGERS;
- create backup
php bin/magento setup:backup --db.
- Create New DB:
CREATE DATABASE magento_backup;
- import data form backup
mysql -u root -p magento_backup < "/var/backups/1506349239_db.sql"
- Show trigers from buckup:
mysql> SHOW TRIGGERS from magento_backup;
Expected result
magento_backup have trigger "test_trigger"
Actual result
magento_backup do not have trigger "test_trigger"
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release