Schogini is Magento2 ready. Are you?

Get started with Magento 2 | Need expert Magento2 support?

Magento 1.9.x Clear All Test Orders


Category: Magento 1.9

Just before going live you would like to clear all the orders in your Magento shop and reset counters so that your shop is clean & ready for the first order. Here are the tables to clear.

SET FOREIGN_KEY_CHECKS=0;

SALES/ORDER 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; TRUNCATE sales_payment_transaction; TRUNCATE sales_order_tax; TRUNCATE sales_order_tax_item; TRUNCATE sales_bestsellers_aggregated_daily; TRUNCATE sales_bestsellers_aggregated_monthly; TRUNCATE sales_bestsellers_aggregated_yearly; TRUNCATE sales_invoiced_aggregated; TRUNCATE sales_invoiced_aggregated_order; TRUNCATE sales_order_aggregated_created; TRUNCATE sales_order_aggregated_updated; TRUNCATE sales_recurring_profile; TRUNCATE sales_recurring_profile_order; TRUNCATE sales_refunded_aggregated; TRUNCATE sales_refunded_aggregated_order; TRUNCATE sales_shipping_aggregated; TRUNCATE sales_shipping_aggregated_order;

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; ALTER TABLE sales_payment_transaction AUTO_INCREMENT=1; ALTER TABLE sales_order_tax AUTO_INCREMENT=1; ALTER TABLE sales_order_tax_item AUTO_INCREMENT=1; 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; ALTER TABLE sales_invoiced_aggregated AUTO_INCREMENT=1; ALTER TABLE sales_invoiced_aggregated_order AUTO_INCREMENT=1; ALTER TABLE sales_order_aggregated_created AUTO_INCREMENT=1; ALTER TABLE sales_order_aggregated_updated AUTO_INCREMENT=1; ALTER TABLE sales_recurring_profile AUTO_INCREMENT=1; ALTER TABLE sales_recurring_profile_order AUTO_INCREMENT=1; ALTER TABLE sales_refunded_aggregated AUTO_INCREMENT=1; ALTER TABLE sales_refunded_aggregated_order AUTO_INCREMENT=1; ALTER TABLE sales_shipping_aggregated AUTO_INCREMENT=1; ALTER TABLE sales_shipping_aggregated_order AUTO_INCREMENT=1;

RESET ID COUNTERS

TRUNCATE eav_entity_store;

ALTER TABLE eav_entity_store AUTO_INCREMENT=1;

INSERT INTO eav_entity_store (entity_store_id ,entity_type_id ,store_id ,increment_prefix ,increment_last_id) VALUES ('1', '11', '1', '1', '000000000'); update eav_entity_store set increment_prefix= 1 where entity_type_id='4' and store_id='1' update eav_entity_store set increment_last_id= '000000000' where entity_type_id='4' and store_id='1'

INSERT INTO eav_entity_store (entity_store_id ,entity_type_id ,store_id ,increment_prefix ,increment_last_id) VALUES ('2', '16', '1', '2', '000000000'); update eav_entity_store set increment_prefix= 2 where entity_type_id='18' and store_id='1' update eav_entity_store set increment_last_id= '000000000' where entity_type_id='18' and store_id='1'

INSERT INTO eav_entity_store (entity_store_id ,entity_type_id ,store_id ,increment_prefix ,increment_last_id) VALUES ('3', '19', '1', '3', '000000000'); update eav_entity_store set increment_prefix= 3 where entity_type_id='24' and store_id='1' update eav_entity_store set increment_last_id= '000000000' where entity_type_id='24' and store_id='1'

INSERT INTO eav_entity_store (entity_store_id ,entity_type_id ,store_id ,increment_prefix ,increment_last_id) VALUES ('4', '23', '1', '4', '000000000'); update eav_entity_store set increment_prefix= 4 where entity_type_id='28' and store_id='1'; update eav_entity_store set increment_last_id= '000000000' where entity_type_id='28' and store_id='1';

SET FOREIGN_KEY_CHECKS=1;


 

Schogini's customer service extends beyond the natural boundaries. ~ Timothy Johnson

Schogini assures 24x7 - 6 hour turn around ticket response time and 24 hour Email response time (support@schogini.com)