Archive
This post is archived and may contain outdated information. It has been set to 'noindex' and should stop showing up in search results.
This post is archived and may contain outdated information. It has been set to 'noindex' and should stop showing up in search results.
Change Magento 2 Order ID Increment (2.1.7)
Jul 12, 2017Web DevelopmentComments (1)
Here is how you can change the order ID increment in Magento 2. This requires a minor edit to the database so should only be attempted by those familiar with database changes, and only after a backup. This works for Magento 2 version 2.1.7 and will probably work for similar versions and newer versions, but I can't guarantee it.
Step 1
Log into PHPMyAdmin for your Magento 2 MySQL database. I'm not going to cover how to do this as it varies with every host.
Step 2
Open up your Magento 2 database and find the table named sequence_order_1. There will probably be multiple other similarly-named tables, but those can be ignored.
Step 3
Go to the Operations tab of the sequence_order_1 table, and find the field called AUTO_INCREMENT in the "Table options" box.
Update this to your desired order ID increment value. Your new value must be higher than what it was originally.
Why 101252187?
In the screenshot above you can see that I changed the auto increment to 101252187. This ID increment number was chosen specifically for three reasons:
Step 1
Log into PHPMyAdmin for your Magento 2 MySQL database. I'm not going to cover how to do this as it varies with every host.
Step 2
Open up your Magento 2 database and find the table named sequence_order_1. There will probably be multiple other similarly-named tables, but those can be ignored.
Step 3
Go to the Operations tab of the sequence_order_1 table, and find the field called AUTO_INCREMENT in the "Table options" box.
Update this to your desired order ID increment value. Your new value must be higher than what it was originally.
Why 101252187?
In the screenshot above you can see that I changed the auto increment to 101252187. This ID increment number was chosen specifically for three reasons:
- Magento prefills in zeros if the order ID has fewer than 9 digits.
- The order ID should start with a non-zero, so it isn't shortened when exported into Excel or another program. For example: Order ID "000002187" would become "2187" in Excel by default without preemptively changing row format.
- There should never be more than a few zeros next to each other in an ID, since it makes it very difficult to see at a glance. Compare "100002187" to "101252187".