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.


1 Answer 1


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.

  • Thank you for the response, I shall try this and get back to you
    – skv
    Apr 15, 2014 at 7:24
  • You may also want to have a look at the sales_flat_quote table and check out which reserved order ids have been set there on active quotations.
    – Moose
    Apr 15, 2014 at 9:18
  • 1
    And do a full database backup before messing with it!!! Apr 15, 2014 at 15:19
  • 2
    Don't forget about the ..._grid table(s).
    – laketuna
    Apr 16, 2014 at 5:31
  • @skv FYI, do read the above comments. I am just pinging you as other users haven't pinged you :)
    – Mr_Green
    May 15, 2014 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.