Magento 1 – change increment Id
While working with Magento 1 you may want to change increment Id for your orders, invoices, credit memos or shipments. In this post I show you how to do this and what you need to know about unique id numbers for your shop.
Magento 1 – change increment Id
An online shop sells good and need to pay tax. If you are a vendor you may know, that your accounting needs invoices in a number range. Normally this should be gapless, otherwise you may get in trouble and need to explain this to your tax inspector. Magento offers you to define increment ids for your orders, invoices, credit memos and shipments. You are also able to define different numbers to different stores (Magento is a multishop solution). There is only one rule: the number is incremented by one of each new order, invoice or so on. It is not possible to define strings for increment ids nor to count down this automatically.
Database
You will find definition for increment ids in your eav_entity_store table. On a multistore setup this may look as follows:
This table saves the last used increment id. It is quite obvious, that store_id is the corresponding store ( Magento allows you to define as many as you want). But which number corresponds to orders, which to increments? Column entity_type_id tells you which type of increment id do you need to change. Just open table eav_entity_type to see a readable definition of this numbers:
So for this example, if you want to change order increment ids for store 3, replace 300003360 (line 5) with a new number of your choice.
You can change increment id as you like, but please be aware, that there is no check if that number was used before. If you change order id 1000001 to 1000000, then there will be a second order id 1000001, if a new order is created!
Why and when should I change increment id numbers?
It is not a good idea to change this numbers on a production system. Don’t do it, only if you have a valid reason (for example your shop owner needs to change his number for accounting reasons). Increment ids are adjusted before shop launch. The only other reason I know is to migrate old order data from a previous shop after launch…but this is a pain.
Increment ids are a good possibility to identify orders from different stores. A good setup is to create numbers starting with 1 for store id 1, 2 for store id 2 and so on.
Conclusion
Magento 1 offers you a possibility to change increment id for your needs. You can set numbers for orders, invoices, shipments and credit memos. It is not a good idea to do this on a production environment without valid reason.