-
Notifications
You must be signed in to change notification settings - Fork 197
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
Next generated increment_id completely wrong after DB conversion? #615
Comments
Hi @craigcarnell Increment policy for sales entities (orders, invoices ...) has changed in M2. See my comment for more detail. And the tool can do nothing about it. The number 3072434672 is because 72434672 is the maximum number in eav_entity_store table for entity_type_id is 5 (order). It means there is a record ?072434672 in increment_last_id column for some store_id (not 3). |
@victor-v-rad Thanks for the clarification. Still slightly confused.. The problem is this number is always increasing and therefore cannot be hard coded. Why can't getMaxIncrementForEntityType() take it's value from store view level from m1? |
I did not mean hard-coded number but tp change the algorithm of getMaxIncrementForEntityType() method so that it will return the number as you expected |
Isn't the value 72434672 per store so shouldn't pick up the correct value from m1? Or take the highest number from the collection of store views? |
yes the tool takes the highest number from the collection of store views |
@victor-v-rad The tool does not appear to be operating correctly. If the increment Id is now based on store, and not store view, then the tool is not picking the highest store increment_id for that group of store. Why would it pick up the highest increment_id for all stores? Magento 2 can maintain a separate list per Store can it not? It is picking a completely different increment_id globally (the highest number it can find). For example, Store View 3 has a increment_last_id of 307736459 in eav_entity_store for entity_type_id 5 Store View 3 is part of Website 3 In Magento 2, it is picking the value 72443211 for sequence_order_3, which I assume comes from Store 15 in M1, as that is the closest value I can possibly find!! Here is my eav_entity_store values:
Store ID 3 is under Website Id 3. This needs fixing also for invoices, credit memos, rma, shipment as well presumably. You acknowledged this in #163 but the issue was then closed? |
@victor-v-rad any update on this issue please? |
@victor-v-rad can you confirm is anyone is looking at this please? |
Sorry for not answering to your question right away. Yes, you are right. It will be better if the tool find the highest number from store group and not from all stores. Internal ticket MAGETWO-97203 to fix it |
@victor-v-rad Excellent, looking forward to a fix. If you manage to resolve this internally, I would be happy to test this before the next release of the tool. |
Fixed. Please test |
@victor-v-rad Is there any way in my composer.json to specify this commit or branch? When I try I get:
Same for the commit. |
I can install the tool by the command |
composer require magento/data-migration-tool:dev-2.3-develop
Do I need to add it as a repository? |
@victor-v-rad I got it to work by adding to composer.json
|
@victor-v-rad This has worked tremendously well! Please can this be included in 2.3.1? Thank you 👍 |
Glad it works ) Will be included into 2.3.1 |
Preconditions
Steps to reproduce
In Magento 1 - eav_entity_store, last_increment_id is 307719923, store_id is 3, entity_type_id is 5 (order)
Convert DB from Magento 1 to Magento 2 using data migration tool
After data conversion - sequence_order_3 is 72434671
sales_sequence_profile is 3 3 3 1 1 4294967295 4294966295 1
After place order - order number is 3072434672
Expected result
Actual result
Additional notes
Not only is the next order increment Id the wrong sequence, it is also 1 extra number longer.
It's possible to reduce the length to what we have here by adding:
However, this does not fix the issue that the order increment Ids are not following the correct sequence after db conversion.
The text was updated successfully, but these errors were encountered: