You are viewing an old revision of this post, from April 10, 2015 @ 17:18:19. See below for differences between this version and the current revision.

Magento – Removing all products and log tables

You can use the following commands to remove all products and logs.

 

SET FOREIGN_KEY_CHECKS = 0;

TRUNCATE TABLE `catalog_product_bundle_price_index`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_bundle_selection_price`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_group_price`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;
TRUNCATE TABLE `catalog_product_entity_text`;
TRUNCATE TABLE `catalog_product_entity_tier_price`;
TRUNCATE TABLE `catalog_product_entity_varchar`;
TRUNCATE TABLE `catalog_product_flat_1`;
TRUNCATE TABLE `catalog_product_flat_2`;
TRUNCATE TABLE `catalog_product_flat_3`;
TRUNCATE TABLE `catalog_product_flat_4`;
TRUNCATE TABLE `catalog_category_flat_store_1`;
TRUNCATE TABLE `catalog_category_flat_store_2`;
TRUNCATE TABLE `catalog_category_flat_store_3`;
TRUNCATE TABLE `catalog_category_flat_store_4`;
TRUNCATE TABLE `catalog_category_flat_store_5`;
TRUNCATE TABLE `catalog_category_flat_store_6`;
TRUNCATE TABLE `catalog_category_flat_store_7`;
TRUNCATE TABLE `catalog_category_flat_store_8`;
TRUNCATE TABLE `catalog_category_flat_store_9`;
TRUNCATE TABLE `catalog_category_flat_store_10`;
TRUNCATE TABLE `catalog_category_flat_store_11`;
TRUNCATE TABLE `catalog_category_flat_store_12`;

TRUNCATE TABLE `catalog_category_flat_store_14`;
TRUNCATE TABLE `catalog_category_flat_store_15`;
TRUNCATE TABLE `catalog_category_flat_store_16`;
TRUNCATE TABLE `catalog_category_flat_store_17`;
TRUNCATE TABLE `catalog_category_flat_store_18`;
TRUNCATE TABLE `catalog_category_flat_store_19`;
TRUNCATE TABLE `catalog_category_flat_store_20`;

 

TRUNCATE TABLE `catalog_product_link`;
TRUNCATE TABLE `catalog_product_link_attribute_decimal`;
TRUNCATE TABLE `catalog_product_link_attribute_int`;
TRUNCATE TABLE `catalog_product_link_attribute_varchar`;
TRUNCATE TABLE `catalog_product_option`;
TRUNCATE TABLE `catalog_product_option_price`;
TRUNCATE TABLE `catalog_product_option_title`;
TRUNCATE TABLE `catalog_product_option_type_price`;
TRUNCATE TABLE `catalog_product_option_type_title`;
TRUNCATE TABLE `catalog_product_option_type_value`;
TRUNCATE TABLE `catalog_product_super_attribute_label`;
TRUNCATE TABLE `catalog_product_super_attribute_pricing`;
TRUNCATE TABLE `catalog_product_super_attribute`;
TRUNCATE TABLE `catalog_product_super_link`;
TRUNCATE TABLE `catalog_product_enabled_index`;
TRUNCATE TABLE `catalog_product_website`;
TRUNCATE TABLE `catalog_category_product_index`;

TRUNCATE TABLE `catalog_category_product`;

TRUNCATE TABLE `catalog_product_entity`;
TRUNCATE TABLE `catalog_product_relation`;

TRUNCATE TABLE `cataloginventory_stock_item`;
TRUNCATE TABLE `cataloginventory_stock_status`;


TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_viewed_product_index;
TRUNCATE report_compared_product_index;
TRUNCATE report_event;
TRUNCATE index_event;
TRUNCATE catalog_compare_item;


SET FOREIGN_KEY_CHECKS = 1;

Revisions

  • April 10, 2015 @ 17:18:19 [Current Revision] by admin
  • April 10, 2015 @ 17:18:19 by admin

Revision Differences

There are no differences between the April 10, 2015 @ 17:18:19 revision and the current revision. (Maybe only post meta information was changed.)

No comments yet.

Leave a Reply