Change Magento Order ID Prefix

I was recently launching some new Magento stores at work and came across and issue that I probably should have forseen – order IDs became out of sync. For my work setup, this is absolutely crucial, as we have a custom built server/software in house that pulls from the Magento web server and manages shipping etc. It is, however, also useful for new stores were it is desirable to not start at order 100000.

Anyway. Log in to the Magento back end. Go to System then Manage Stores. Finally, select the Store View Name that you wish to manipulate the order IDs for. You can now see the store ID in the browser address bar.

Next we need to manually edit some database records. Here I am using phpMyAdmin. Search for the table eav_entity_store. Here you can see the store_id, set the increment_prefix and possibly most importantly the increment_last_id. The next order placed to this store will be this number plus one. Set this number well below the values used by other stores. You have been warned!

In this screenshot entity_store_id 15 is new and is taking over from the now disabled entity_store_id 3, so I set the increment_prefix to the same value as that of entity_store_id 3.

Happy incrementing!

Leave a Reply

Your email address will not be published. Required fields are marked *