Reset Order id after clearing dummy Orders in Magento

Reset Order id after clearing dummy Orders in Magento

After developing a website, Developers delete all the dummy order placed using either a SQL script or using one of the free extension available on Magento Connect.

After deleting orders, the Order Id still continues to be in the previous range ie if last Order Id was #100000123 the new Order Id will be #100000124. To reset the Order Id to default value ie: #100000001 we need to perform some SQL Queries on our Database.

The queries are as follows :

1) UPDATE eav_entity_store SET increment_last_id = ‘000000000’ WHERE entity_type_id = ‘5’;

2) UPDATE eav_entity_store SET increment_last_id = ‘000000000’ WHERE entity_type_id = ‘6’;

3) UPDATE eav_entity_store SET increment_last_id = ‘000000000’ WHERE entity_type_id = ‘7’;

4) UPDATE eav_entity_store SET increment_last_id = ‘000000000’ WHERE entity_type_id = ‘8’;

Here

5 is for Orders
6 is for Invoice
7 is for Credit Memo
8 is for Shipment

Leave a Comment