4

I tried to test Magento 2 performance on my local computer by using the Magento Performance Toolkit,

php bin/magento setup:perf:generate-fixtures /var/www/html/magento2/setup/performance-toolkit/profiles/ce/extra_large.xml

I wasn't aware that this command added almost a million products into the database, which made my testing site extremly slow. I would like to remove all the testing data that is generated from this Performance Tookit, but I couldn't find out how.

1

If you want to delete only the profile data and keep your real data then run the below SQl on your database manager.

DELETE FROM `catalog_product_entity` WHERE `sku` LIKE 'product_dynamic_%';
DELETE FROM `catalog_product_entity` WHERE `sku` LIKE 'simple_product_%';
DELETE FROM `catalog_product_entity` WHERE `sku` LIKE 'Configurable Product%'; 'configurable_product_%';

Finally reindex

php bin/magento indexer:reindex
0

If you want to delete only the profile data and keep your real data then run the below SQl on your database manager.

DELETE FROM `catalog_product_entity` WHERE `sku` LIKE 'product_dynamic_%';
DELETE FROM `catalog_product_entity` WHERE `sku` LIKE 'simple_product_%';
DELETE FROM `catalog_product_entity` WHERE `sku` LIKE 'Configurable Product%'; 'configurable_product_%';
/***************************************************/
DELETE FROM eav_attribute_option WHERE attribute_id IN ( SELECT attribute_id FROM eav_attribute WHERE attribute_code LIKE "attribute%");
DELETE FROM eav_attribute_option_value WHERE option_id NOT IN ( SELECT option_id FROM eav_attribute_option );
DELETE FROM eav_attribute_label WHERE attribute_id IN ( SELECT attribute_id FROM eav_attribute WHERE attribute_code LIKE "attribute%");
DELETE FROM eav_attribute WHERE attribute_code LIKE "attribute%";
DELETE FROM eav_attribute_group WHERE attribute_set_id IN ( SELECT attribute_set_id FROM eav_attribute_set WHERE attribute_set_name LIKE "Product Set%" );
DELETE FROM eav_attribute_set WHERE attribute_set_name LIKE "Product Set%";

Then Reindex all

php bin/magento indexer:reindex

For now I have deleted Dummy data Categories manually from the admin area. You have to delete those all categories having name "Category*".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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