hi we have installed magento 2.2.2 in our store,,,,,,
We have lot of test orders and we deleted that orders using mage comp Delete Orders Extension,,,,,,
Now we need to reset order Number to 1 (Starting from First)....Because we have so many test orders,,,,previously,,,,,,
How to reset order number to 1 ,,,,,,Is it possible by admin side???????
or Any other possible solutions,,kindly help us
You have to lookup below links for your customization,
One of the paid extension is also available from below link,
First of all, Thanks for using MageComp delete order extension for your store.
As per your need to reset order sequence, you need to change order autoincrement value from your database.
You can either do it manually by navigating to sales_order table and from operations, simply change the autoincrement value as Shown in this screenshot.
Or you can change autoincrement value by firing SQL query to your database as shown below.
ALTER TABLE SALES_ORDER AUTO_INCREMENT=1;
You can take a look at https://bsscommerce.com/magento-2-custom-order-number-extension.html.
This tool helps you change the order number flexibly and of course, the order number can be reset whenever you want.
I got the same issues but my issues resolved by magento 2 custom order number extension
Unfortunately Magento 2 uses the Auto_increment field of the sequence table, so the only way to reset the order number is to reset the Auto_increment field of the sequence table.
With ALTER TABLE one can only incease the Auto_Increment field, not decrease it so that won't work either. The only solution is to first TRUNCATE the table, this will delete all rows in the table ánd reset the Auto_increment to 1. After that you could use the ALTER TABLE to set it to whatever start value you want....
So if you created 30 test orders that you've deleted and you want to start your first real order with order ID 5 for store ID 2, the way to go is
TRUNCATE TABLE sequence_order_2 ; ALTER TABLE sequence_order_2 AUTO_INCREMENT=4
You have answered in 2 lines what people across the world wide internets answer with convoluted instruction, modules, plugins, pages and edits of incorrect database methods, and a complete non-understanding of the original question.
Thank you, I knew it should have been simple. This works perfectly.