NAVDataUpgrade failed with "Object of type CodeUnit with ID 2 could not be found."
Hi Microsoft Team,
Describe the bug I try to update a Cronus Database with no customisations to BC16. Is there any proper documentation updating from BC15 to BC16 available? I am using https://docs.microsoft.com/de-de/dynamics365/business-central/dev-itpro/upgrade/upgrading-cumulative-update-v15
more details see below:
from OnPremise BC Version BC15.5 (15.5.41926.0) to OnPremise BC Version BC16.0 (16.0.11240.12076)
from Docker Image: 'mcr.microsoft.com/businesscentral/onprem:15.5.41926.0-w1-ltsc2019' to Docker Image: 'mcr.microsoft.com/businesscentral/onprem:w1'
The Cronus-DB is on a separate Local MS-SQL-Server 2019 installed.
To Reproduce I run the following powershell script:
#Upgrade System Application Publish-NAVApp -ServerInstance $navServerInstance1 -Path "C:\Applications\System Application\Source\Microsoft_System Application.app" Sync-NAVApp -ServerInstance $navServerInstance1 -Tenant default -Name "System Application" -Version 16.0.11240.12076 Start-NAVDataUpgrade -ServerInstance $navServerInstance1 -Tenant default -FunctionExecutionMode Serial -SkipAppVersionCheck Get-NAVDataUpgrade -ServerInstance $navServerInstance1 -ErrorOnly (see Screenshots below)
Expected behavior Runing the upgrade without errors.
If this is the wrong channel for reporting this problem, please provide me the right one.
Thanks for assistens.
Screenshots

The same process, the same result.
Have you checked your event viewer? Is this a legacy single tenant installation or a multi-tenant one?
It is a single tenant installation!

Try adding -SkipCompanyInitialization parameter at Start-NAVDataUpgrade because your company has already been initialized.
Best, Zoran M.
Hi Zoran, Adding the -SkipCompanyInitialization parameter do the trick. Thanks for your help! Regards Daniel
Hi Daniel,
I do not know which scenario exactly you are testing but there is difference in steps between Upgrade and Update. I think that you want to do the Upgrade but are going through Update steps. Upgrade steps are explained here: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/upgrade-unmodified-application Should be the same from BC14->BC15 or BC15->BC16.
Anyway after publishing (Task 6) it is required to restart Service Tier (Task 7) to continue with Upgrade. There is a small (can be missed) line that says: "This step is important, otherwise you might experience issues when you run the data upgrade." for Task 7 (Restart).
Afterwards Publishing should not give you that error but I really haven't tried it like that.
Best, Zoran
Regarding the update process in general, I recommend watching this video if you have not done so https://www.youtube.com/watch?v=NKqYa3Oyi3Q&list=PLI1l3dMI8xlCkFC0S4q8VxPiBt30VQ4w0&index=10&t=0s