Order Number – Can It Be Modified in Magento?

orders

We have a customer move their servers to a new host and we had one days' data which got missed in between, while we have synchronized products and customers, new orders had already been taken and now the customer wants to find out if it would be possible to modify the order number to follow the old sequence.

I am aware of the table(eav_entity_store) that contains the last order id and the increment values which can avoid issues happening in future with order numbers, however we are trying to modify order numbers from the past.

Is there a list of tables, that I can update to achieve this result. I know modifying database directly is a very bad idea, but the for the customer it is a major issue as the orders integrate with their accounting system and it cannot take duplicates.

Best Answer

Yes you can, the tables you would want to have a look at are as follows:

  • sales_flat_order,
  • sales_flat_order_item,

These two tables basically contain all the information regarding an order, from address, delivery method etc. to products & qtys ordered.

You can relate them to each other as follows: the entity_id field in sales_flat_order is the order_id field in sales_flat_order_item.

The column named increment_id in sales_flat_order is the order number which is visible in the front- and back-end.

Related Topic