Delete all Orders, Sales & Customer Data in Magento

https://www.designhaven.co.uk/2014/08/cleanly-delete-orders-sales-customer-data-magento/#comment-27491

From Comments:

In addition to clear the SEARCH TERMS

SET FOREIGN_KEY_CHECKS=0;

TRUNCATE catalogsearch_query;
TRUNCATE catalogsearch_fulltext;
TRUNCATE catalogsearch_result;
ALTER TABLE catalogsearch_query AUTO_INCREMENT=1;
ALTER TABLE catalogsearch_fulltext AUTO_INCREMENT=1;
ALTER TABLE catalogsearch_result AUTO_INCREMENT=1;

TRUNCATE TABLE sales_bestsellers_aggregated_daily;
TRUNCATE TABLE sales_bestsellers_aggregated_monthly;
TRUNCATE TABLE sales_bestsellers_aggregated_yearly;
ALTER TABLE sales_bestsellers_aggregated_daily AUTO_INCREMENT=1;
ALTER TABLE sales_bestsellers_aggregated_monthly AUTO_INCREMENT=1;
ALTER TABLE sales_bestsellers_aggregated_yearly AUTO_INCREMENT=1;

SET FOREIGN_KEY_CHECKS=1;

=========================================
In addition to clear the NEWSLETTER SUBSCRIBERS

SET FOREIGN_KEY_CHECKS=0;

TRUNCATE newsletter_problem;
TRUNCATE newsletter_queue;
TRUNCATE newsletter_queue_link;
TRUNCATE newsletter_queue_store_link;
TRUNCATE newsletter_subscriber;
TRUNCATE newsletter_template;

ALTER TABLE newsletter_problem AUTO_INCREMENT=1;
ALTER TABLE newsletter_queue AUTO_INCREMENT=1;
ALTER TABLE newsletter_queue_link AUTO_INCREMENT=1;
ALTER TABLE newsletter_queue_store_link AUTO_INCREMENT=1;
ALTER TABLE newsletter_subscriber AUTO_INCREMENT=1;
ALTER TABLE newsletter_template AUTO_INCREMENT=1;

SET FOREIGN_KEY_CHECKS=1;

More :
http://inchoo.net/magento/delete-test-orders-in-magento/

https://stackoverflow.com/questions/8899366/deleting-all-products-on-magento

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s