Last updated for Magento CE 1.4.1.1
This is a work-in-progress to assemble and keep current, the SQL required to perform these actions which are currently not part of the Magento core package but which are often useful for testing and debugging.
Remember to back up your database before using any of these scripts!
Delete *All* Order & Customer Data
|
-
# Magento CE 1.4.1.1
-
# Be sure to replace "#_" with your table prefix
-
-
SET FOREIGN_KEY_CHECKS=0;
-
-
##############################
-
# SALES RELATED TABLES
-
##############################
-
TRUNCATE `#_sales_flat_creditmemo`;
-
TRUNCATE `#_sales_flat_creditmemo_comment`;
-
TRUNCATE `#_sales_flat_creditmemo_grid`;
-
TRUNCATE `#_sales_flat_creditmemo_item`;
-
TRUNCATE `#_sales_flat_invoice`;
-
TRUNCATE `#_sales_flat_invoice_comment`;
-
TRUNCATE `#_sales_flat_invoice_grid`;
-
TRUNCATE `#_sales_flat_invoice_item`;
-
TRUNCATE `#_sales_flat_order`;
-
TRUNCATE `#_sales_flat_order_address`;
-
TRUNCATE `#_sales_flat_order_grid`;
-
TRUNCATE `#_sales_flat_order_item`;
-
TRUNCATE `#_sales_flat_order_payment`;
-
TRUNCATE `#_sales_flat_order_status_history`;
-
TRUNCATE `#_sales_flat_quote`;
-
TRUNCATE `#_sales_flat_quote_address`;
-
TRUNCATE `#_sales_flat_quote_address_item`;
-
TRUNCATE `#_sales_flat_quote_item`;
-
TRUNCATE `#_sales_flat_quote_item_option`;
-
TRUNCATE `#_sales_flat_quote_payment`;
-
TRUNCATE `#_sales_flat_quote_shipping_rate`;
-
TRUNCATE `#_sales_flat_shipment`;
-
TRUNCATE `#_sales_flat_shipment_comment`;
-
TRUNCATE `#_sales_flat_shipment_grid`;
-
TRUNCATE `#_sales_flat_shipment_item`;
-
TRUNCATE `#_sales_flat_shipment_track`;
-
TRUNCATE `#_sales_invoiced_aggregated`; # ??
-
TRUNCATE `#_sales_invoiced_aggregated_order`; # ??
-
TRUNCATE `#_log_quote`;
-
-
ALTER TABLE `#_sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_creditmemo_item` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_invoice` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_invoice_comment` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_invoice_grid` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_invoice_item` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_order` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_order_address` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_order_grid` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_order_item` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_order_payment` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_order_status_history` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_quote` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_quote_address` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_quote_address_item` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_quote_item` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_quote_item_option` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_quote_payment` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_shipment` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_shipment_comment` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_shipment_grid` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_shipment_item` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_flat_shipment_track` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_invoiced_aggregated` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
-
ALTER TABLE `#_log_quote` AUTO_INCREMENT=1;
-
-
#########################################
-
# DOWNLOADABLE PURCHASED
-
#########################################
-
TRUNCATE `#_downloadable_link_purchased`;
-
TRUNCATE `#_downloadable_link_purchased_item`;
-
-
ALTER TABLE `#_downloadable_link_purchased` AUTO_INCREMENT=1;
-
ALTER TABLE `#_downloadable_link_purchased_item` AUTO_INCREMENT=1;
-
-
#########################################
-
# RESET ID COUNTERS
-
#########################################
-
TRUNCATE `#_eav_entity_store`;
-
ALTER TABLE `#_eav_entity_store` AUTO_INCREMENT=1;
-
-
-
##############################
-
# CUSTOMER RELATED TABLES
-
##############################
-
TRUNCATE `#_customer_address_entity`;
-
TRUNCATE `#_customer_address_entity_datetime`;
-
TRUNCATE `#_customer_address_entity_decimal`;
-
TRUNCATE `#_customer_address_entity_int`;
-
TRUNCATE `#_customer_address_entity_text`;
-
TRUNCATE `#_customer_address_entity_varchar`;
-
TRUNCATE `#_customer_entity`;
-
TRUNCATE `#_customer_entity_datetime`;
-
TRUNCATE `#_customer_entity_decimal`;
-
TRUNCATE `#_customer_entity_int`;
-
TRUNCATE `#_customer_entity_text`;
-
TRUNCATE `#_customer_entity_varchar`;
-
TRUNCATE `#_tag`;
-
TRUNCATE `#_tag_relation`;
-
TRUNCATE `#_tag_summary`;
-
TRUNCATE `#_tag_properties`; ## CHECK ME
-
TRUNCATE `#_wishlist`;
-
TRUNCATE `#_log_customer`;
-
-
ALTER TABLE `#_customer_address_entity` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_address_entity_datetime` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_address_entity_decimal` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_address_entity_int` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_address_entity_text` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_address_entity_varchar` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_entity` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_entity_datetime` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_entity_decimal` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_entity_int` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_entity_text` AUTO_INCREMENT=1;
-
ALTER TABLE `#_customer_entity_varchar` AUTO_INCREMENT=1;
-
ALTER TABLE `#_tag` AUTO_INCREMENT=1;
-
ALTER TABLE `#_tag_relation` AUTO_INCREMENT=1;
-
ALTER TABLE `#_tag_summary` AUTO_INCREMENT=1;
-
ALTER TABLE `#_tag_properties` AUTO_INCREMENT=1;
-
ALTER TABLE `#_wishlist` AUTO_INCREMENT=1;
-
ALTER TABLE `#_log_customer` AUTO_INCREMENT=1;
-
-
-
##############################
-
# ADDITIONAL LOGS
-
##############################
-
TRUNCATE `#_log_url`;
-
TRUNCATE `#_log_url_info`;
-
TRUNCATE `#_log_visitor`;
-
TRUNCATE `#_log_visitor_info`;
-
TRUNCATE `#_report_event`;
-
TRUNCATE `#_report_viewed_product_index`;
-
TRUNCATE `#_sendfriend_log`;
-
### ??? TRUNCATE `#_log_summary`
-
-
ALTER TABLE `#_log_url` AUTO_INCREMENT=1;
-
ALTER TABLE `#_log_url_info` AUTO_INCREMENT=1;
-
ALTER TABLE `#_log_visitor` AUTO_INCREMENT=1;
-
ALTER TABLE `#_log_visitor_info` AUTO_INCREMENT=1;
-
ALTER TABLE `#_report_event` AUTO_INCREMENT=1;
-
ALTER TABLE `#_report_viewed_product_index` AUTO_INCREMENT=1;
-
ALTER TABLE `#_sendfriend_log` AUTO_INCREMENT=1;
-
### ??? ALTER TABLE `#_log_summary` AUTO_INCREMENT=1;
-
-
SET FOREIGN_KEY_CHECKS=1;
Revisions
- February 25, 2015 @ 09:57:05 [Current Revision] by admin
- February 25, 2015 @ 09:57:05 by admin
- February 25, 2015 @ 09:56:35 by admin
- February 14, 2015 @ 14:03:20 by admin
No comments yet.