Error upgrading from BC14 to BC24

apquintasapquintas Member Posts: 3
edited 2024-09-06 in General Chat
When following this guide from Microsoft
https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-unmodified-application-v14-v24

we're getting an error in Task 10, step 1
«Upgrade the data to the platform, system application, and base application.
To run the data upgrade, use the Start-NavDataUpgrade cmdlet:»

running this command
Start-NAVDataUpgrade -ServerInstance $BcServerInstance_24 -Tenant default -FunctionExecutionMode Serial -SkipAppVersionCheck

the DataUpgrade is never complete

ps78kk4nik29.png

and in Event Viewer this is what we get as info...

« An item with the same key has already been added. Key: 00000000-0000-0000-0000-000000000000 »

m1p2ursntq8u.png


kha9m5uzc2uf.png




Anyone has any idea what could generate this kind of error?

would really appreciate some help in this matter..



Answers

  • GOCEIGOCEI Member Posts: 3
    Hi @apquintas ,
    I'm struggling with the same, could you solve it?

    Thanks in advance.
  • apquintasapquintas Member Posts: 3
    Hi @GOCEI
    Actually Yes! :)

    The problem was related with previous steps upgrading from 2017 to BC14.

    In BC14 in Company Table, there is a new GUID field that was populated in both (we had only 2) companies with the value 000000... (see screenshot below)

    mtca8ltmmk1o.png


    Solution in our case: Generate 2 new GUIDs and change the field values in the table with Microsoft SQL Server Management Studio (running the table and changing with windows client was not possible although the field was editable)

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7.4

    After that we could finish the script and upgrade from BC14 to BC24
  • GOCEIGOCEI Member Posts: 3
    hi @apquintas ,
    Wow, it worked, i had some records with value 0000... I generated guid for those records and no errors!!!

    How did you find out the solution? Because I spent plenty of time trying to solve it and I didnt find any reference to Company Table.

    Thanks!! :smiley:
  • apquintasapquintas Member Posts: 3
    Hi @GOCEI

    I also spent a lot of time with no clue until an ex-colleague with experience in migrations told me that, although he never saw the exact same error, it sounded like the routine was trying to insert a 2nd record with a GUID 00000000-0000-0000-0000-000000000000 but there was already one in the target table.

    Then I looked with more attention to the Error in event viewer and saw something related with company before the error message:
    « An item with the same key has already been added. Key: 00000000-0000-0000-0000-000000000000 »

    (althoug here the picture has no quality you can probably understand the word company 4 and 5 lines below the selected error text)

    https://us.v-cdn.net/5022383/uploads/editor/4m/m1p2ursntq8u.png

    So then, in Microsoft SQL Server Management Studio, I filtered the tables that contain word "Company" looking for a GUID field.

    And that's how I found that one table with the 00000000-0000-0000-0000-000000000000 value repeated in both records :)
  • GOCEIGOCEI Member Posts: 3
    Hi @apquintas ,
    Yeah, I checked en Event Viewer but unluckly I didnt reacht out any proper conclusion.

    I was so close to split the upgrade in two, first into the bc22 and later to bc24, it would have been a real pain in the b****s.
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'General Chat' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.