When you upgrade to 20.x from an earlier version, you might stop when synchronizing base application with a strange error stating
Sync-NAVApp -ServerInstance BC200 -Name "Base Application" -Mode ForceSync
MicrosoftDynamicsNavServer$BC200/nav-systemapplication
Confirm synchronization of the extension in ForceSync mode
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
Sync-NAVApp : Root element is missing.
At line:1 char:1
+ Sync-NAVApp -ServerInstance BC200 -Name "Base Application" -Mode Forc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Sync-NAVApp], InvalidOperationException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$BC200/nav-systemapplication,Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.SyncNavApp
Using a SQL Profiler when performing the synchronization, you should be able to find out the last metadata object that was searched in the Object Metadata Snapshot table before the errors kick in.
In a specific case, it was table 6701 Web Part.
This is an old useless table that was not having any Metadata description (Base Metadata field) hence the procedure was trying to extract the content from Base Metadata field into XML format and parse it.
Since no XML data where inside the BLOB, that error surfaced: no root element for the XML Metadata.
Digging deeper, you might use Schema Hash field from Object Metadata Snapshot table to determine which records had it with value 0, hence no Base Metadata.
See below a snippet of this as example (NOTE: there might be other records listed).
Deleting all these records with Schema Hash field equal to 0, the synchronization of the Base Application will go through successfully.
Just to resume, then, by running
SELECT *
FROM [Object Metadata Snapshot]
WHERE [Schema Hash] = 0
You should be able to see if there are some hanging fruit in the affected environment that are preventing synchronization.
If there are some then try to delete them through
DELETE
FROM [Object Metadata Snapshot]
WHERE [Schema Hash] = 0
and continue the upgrade.
Be sure to test, test and re-test your application after the upgrade has been accomplished.
*This post is locked for comments
Thank you for sharing Duilio!
Sohail Ahmed
2,655
Mansi Soni
1,574
YUN ZHU
1,453
Super User 2025 Season 1