Magento 2 - What is the correct way to change default Order Id?

Magento 2. After fresh install the new Order id will be 100000001, 100000002 and so on.

What is the correct way to change that increment id so it would be a higher number? For example 155555552, 155555553 and so on. When changed it will look much better.

In Magento 1.9 To edit default Id for Orders, Invoice or Shipment we simply had to change values in database in "eav_entity_store".

Magento 2 looks so different...

I know there are some plugins that offer to do this, but I want to know how to do it manually.


Go to your database from phpmyadmin,

Here _1 is used for store id after tablename.

Default Frontend store id is 1. if you have multi store then you have to set query for each store with table name like sequence_order_2 upto sequence_order_.*

Enter below query for table sequence_order_1 is used for default store. If you have multiple store you have to set tablename as per store id in below query.

This is only used for order placed from frontend.

sequence_order_1 is used for order id management in magento 2.

ALTER TABLE sequence_order_1 AUTO_INCREMENT=155555551;

Next order id is start from 155555551.

Below Query is defined for INVOICE, if you want to change invoice id

ALTER TABLE sequence_invoice_1 AUTO_INCREMENT=155555551;

For Shipment ALTER TABLE sequence_shipment_1 AUTO_INCREMENT=155555551;

  1. Open your PHP Admin database (I tested on php 7)
  2. Find & click on the table called: sequence_order_1 (it is located in database itself not in the information_schema )
  3. Click on "Operations" tab & under "AUTO_INCREMENT" edit to desired order number.

What was previously in eav_entity_store is now covered in sales_sequence_profile and sales_sequence_meta. The table sequence_order_1 gets populated when orders are placed.

Tags: Magento 2.x / PHP / Orders

Similar questions

Order time stamp off by 6 hours in the order Confirmation Email. It is CORRECT on the order itself in the Admin panel
The orders have correct date/time stamps in the Admin Panel (Sales - Orders - click an order open - under Order Date --) Apr 9, 2016 3:07:57 AM) but the time is off by exactly 6 hours in the Customer Confirmation Email --) Your order #100006833 Placed on April 9, 2016 9:07:57 AM MDT We are in Colorado (MST) and I have the following setup in Admin P...
What is the correct way to update a value to be NULL on a Magento model?
I am having an issue getting a custom model's value to update to NULL. This code does not update the field custom_value in the database, and the database value accepts NULL values (Manually setting NULL in the database works fine). EDIT: As Tim mentions below using Zend_Db_Expr("NULL") does set the value to null, could anyone explain why this is re...
magento 1.9 correct way to extend Mage_Adminhtml_Catalog_ProductController
y'all. What is the best way to achieve this epic feat of intellectual prowess? Is this a good start? From that point, what else must be achieved?
What is the correct way/approach to modify a Magento template?
Please suggest me the right approach, I want to customize the "EMAIL to Friend" page into pop up window, when user click on the button (email this product). By enabling template hinting, I found out that the button is rendered with frontend/rwd/default/template/catalog/product/view/sharing.phtml And the corresponding layout file is catalog.xml (in ...
What is the correct way to properly register & run automated cronjobs in Magento 2?
I'm trying to define a cronjob for a custom module, but having a hard time going through the proper flow of scheduled cronjobs. Few things of note:
Magento 2 - Correct way of Module Installation
Trying to install sample module in Magento 2 from this. Below is the module structure app/code/NameSpace/Module/ module.xml composer.json Registration.php Executing below command to enable module It says there are no commands defined in the "module" namespace. Also on frontend it throws below exception. I am using composer but not github. Fatal err...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.