Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How to delete all magento 2 order, invoice, shipment, and credit memo, and reset the increment_id too using php code?
Create Magento Module.
Create php file in that create queries and execute using ajax button placed in admin of magento.
First find out all tables being impacted then you can easily know the SQL queries .
Try using "ALTER TABLE table_name AUTO_INCREMENT = 1;" sql query to reset auto-increment.
Required, but never shown