Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After migration increment ID for all stores are the same #163

Closed
Got-iT-Services-Inc opened this issue Oct 6, 2016 · 7 comments
Closed
Labels

Comments

@Got-iT-Services-Inc
Copy link

Magento/migration tool version 2.1.1. After migration all increment id's across all stores are identical. Stores 2,3 and 4 took on the increment ID for store 1. This includes invoice and credit memo increment ID's as well.

it also looks like the SalesIncrement test only tests the first store profile, and does not iterate through all store profiles in the database

@victor-v-rad
Copy link
Collaborator

Hi @Got-iT-Services-Inc
According to the documentation there are changes in policy of forming increment ID in Magento 2. As far I know in Magento 2 next increment ID is based not on "store view" but "store" (former name "store group"). That is why you got such behavior. If you feel that it is a bug I would recommend post an issue in Magento 2 GitHub

@Got-iT-Services-Inc
Copy link
Author

Since we're migrating from Magento1 to Magneto2, shouldn't the migration tool take that into account and take the current increment ID's from mangeto1 as magento1 uses them, and migrate them to the correct way magento2 uses it? I don't think this is a bug in magento2, but more of a bug in the migration from magento1 to magento2

@victor-v-rad
Copy link
Collaborator

victor-v-rad commented Oct 10, 2016

The tool does not change migrated order/invoice... IDs from Magento 1, does it? But the way how new IDs are created in Magento 2 have changed. Now it is based on Store, not on Store View.

shouldn't the migration tool take that into account and take the current increment ID's from mangeto1 as magento1 uses them

Please make your proposal how exactly the tool can handle this

@ilol
Copy link

ilol commented Oct 10, 2016

Registered as a bug: MAGETWO-59523

@Got-iT-Services-Inc
Copy link
Author

I believe it's just a matter of having the tool look at the individual stores, I will check the code out later this week

@victor-v-rad
Copy link
Collaborator

victor-v-rad commented Oct 10, 2016

Now it is based on Store, not on Store View.

To be more clear. For new orders/invoices/... Magento 2 gets ID of default "store view" of a "store"

In Magento 1 you have
Store 1 - Store View 1 (default) = order ID 10000001
Store 1 - Store View 2 = order ID 20000001
Store 2 - Store View 3 (default) = order ID 30000001
Store 2 - Store View 4 = order ID 40000001

In Magento 2 for new orders you will be getting
Store 1 - Store View 1 (default) = order ID 10000001
Store 1 - Store View 2 = order ID 10000002
Store 2 - Store View 3 (default) = order ID 30000001
Store 2 - Store View 4 = order ID 30000002

As far I know this approach is hardcoded in Magento 2. That is why I do not see how the tool can fix it. But I will investigate it more

@victor-v-rad
Copy link
Collaborator

victor-v-rad commented Oct 18, 2019

Prefix issue was fixed in Magento 2 magento/magento2#14063 Now prefix of increment id, like in Magento 1, depends on store view id where order was placed
Store 1 - Store View 1 (default) = order ID 10000001
Store 1 - Store View 2 = order ID 20000001
Store 2 - Store View 3 (default) = order ID 30000001
Store 2 - Store View 4 = order ID 40000001

BUT in Magento 2 increment id has store id + 9 digits, in according to \Magento\SalesSequence\Model\Sequence::DEFAULT_PATTERN
whereas Magento 1 increment id has store id + 8 digits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants