Coming up: 23 Sep - Magento 2 Technical Architecture training

Yireo - Trainings & extensions

Open main menu

When moving to Magento, some people might want to change the default ordernumber 000000001 to some other number - either fooling the customer into thinking this is a very popular shop, or when migrating from another webshop to Magento. Here's how to change that order number.

MySQL table eav_entity_store

New ordernumbers are determined by a value called the increment_id, and this increment_id is stored in the database table eav_entity_store. You should login to the MySQL database using a program like phpMyAdmin, and then you will be able to edit the contents of this table.

If the database table is empty, this means that the system has not created any orders yet. Instead of trying to hack the database, it's best to create a fake order. To create a fake order you will also need to create a customer and a product, so it's probably best to perform this task just before you're going live with your shop.

Changing which increment_id?

Once you have completed orders, the table eav_entity_store will contain various records, and every record contains a different increment_id. The logic here is that increment_ids are used by various Magento entities, like orders and customers. In a default situation the record for customers has an entity_type_id of 2, while orders have an entity_type_id of 11. So to change the ordernumber for orders, you will need to edit the row with entity_type_id 11.

If you really want to know the IDs used for the different entities in the Magento database, take a look in the database table eav_entity_type, which lists various parts of an entity (like underlying PHP-classes and other MySQL tables).

What can you do with the ordernumber?

We recommend not changing the length of the ordernumber, nor the starting number of the increment_id (which should be the same as the increment_prefix) in the same table. But you can easily change some of the zeroes into other numbers.

Note that this will not change any data already stored in the database.

Written on 12 February 2010 by Jisse Reitsma

About the author

Jisse Reitsma is the founder of Yireo, extension developer, developer trainer and two times Magento Master. His passion is for technology and open source. And he loves talking as well.

Looking for a training in-house?

Let's get to it!

Proud member of

  Latest blog


Legal information

Other Yireo sites

Get Social

About Yireo