Select Page

Error while upgrading from NAV 2013 R2 to NAV 2016 Indian Localization Database

Dear All,

While upgrading Indian Localization database from NAV 2013 R2 to NAV 2016 CU10(build 46621) found some issues during upgrade process.

We followed the standard upgrade steps given here: https://msdn.microsoft.com/en-us/library/dn271668(v=nav.90).aspx

Till task 7 everything will be fine. But during task 8, when we try to import the upgrade toolkit FOB from DVD path UpgradeToolKit\Local Objects\Upgrade710900.IN.fob, what we have seen inside the Import Worksheet window. Only 10 upgrade toolkit tables, NO upgrade codeunit and 2 tables(UPG Posting Exch. Column Def,UPG Item).

iw1
So we have import the upgrade toolkit FOB from DVD path UpgradeToolKit\Data Conversion Tools\Upgrade710900.FOB, here you can find all the required upgrade toolkit objects.

iw2

Now we started the task 9, run the Sync. Schema For All Tables – With Validation option from the development environment or run the Sync-NavTenant cmdlet from the Microsoft Dynamics NAV 2016 Administration Shell. We got the error in development environment while syncing the objects. To see error details via cmdlet please use command Sync-NavTenant with CheckOnly mode.

Below is the result from cmdlet, have errors for Length reduced fields/tables in Indian Localization No. Series.

PS C:\Windows\system32> Sync-NAVTenant -ServerInstance Demo_Upgrade_IN_71_90 -Mode Sync
Sync-NAVTenant : The schema synchronization may result in deleted data. The following destructive changes were detected:

Table: 23, Vendor
Field: 16361, Vendor Location: Length reduced
Table: 38, Purchase Header
Field: 13761, State: Length reduced
Table: 79, Company Information
Field: 13709, T.A.N. No.: Length reduced
Table: 81, Gen. Journal Line
Field: 13747, Location Code: Length reduced
Table: 120, Purch. Rcpt. Header
Field: 13701, Assessee Code: Length reduced
Field: 13761, State: Length reduced
Table: 122, Purch. Inv. Header
Field: 13701, Assessee Code: Length reduced
Field: 13761, State: Length reduced
Table: 124, Purch. Cr. Memo Hdr.
Field: 13761, State: Length reduced
Table: 5109, Purchase Header Archive
Field: 13761, State: Length reduced
Table: 6650, Return Shipment Header
Field: 13701, Assessee Code: Length reduced
Field: 13761, State: Length reduced
Table: 13719, RG 23 A Part I
Field: 33, Location Code: Length reduced
Table: 13720, RG 23 A Part II
Field: 33, Location Code: Length reduced
Table: 13721, RG 23 C Part I
Field: 33, Location Code: Length reduced
Table: 13722, RG 23 C Part II
Field: 33, Location Code: Length reduced
Table: 13723, PLA Entry
Field: 33, Location Code: Length reduced
Table: 13735, Posted Jnl. Bank Charges
Field: 2, Bank Charge: Length reduced
Table: 13761, Tax Area Locations
Field: 1, Dispatch / Receiving Location: Length reduced
Field: 2, Customer / Vendor Location: Length reduced
Table: 16321, Sub Order Component List
Field: 46, Company Location: Length reduced
Table: 16322, Sub Order Comp. List Vend
Field: 46, Company Location: Length reduced
Table: 16415, Subcontractor Delivery Challan
Field: 4, Vendor Location: Length reduced
Field: 5, From Location: Length reduced
Table: 16511, Jnl. Bank Charges
Field: 4, Bank Charge: Length reduced
Table: 16527, Proposed Depr Method Header
Field: 1, Depreciation Book: Length reduced
Table: 16536, BOM Location
Field: 3, Location Code: Length reduced
Table: 16537, RG 23 D
Field: 9, Location Code: Length reduced
Field: 49, Transfer From Location Code: Length reduced
Field: 50, Transfer To Location Code: Length reduced
Table: 16546, Voucher No. Series
Field: 3, Posting No. Series: Length reduced
Table: 16547, Voucher Account
Field: 1, Location code: Length reduced
Table: 16550, Service Tax Opening
Field: 55, Location Code: Length reduced
Table: 16552, Gate Entry Header
Field: 3, No. Series: Length reduced
Field: 16, Posting No. Series: Length reduced
Table: 16554, Gate Entry Location Setup
Field: 2, Location Code: Length reduced
Field: 3, Posting No. Series: Length reduced
Table: 16555, Posted Gate Entry Header
Field: 3, No. Series: Length reduced
Table: 16567, Detailed PLA Entry
Field: 27, Location Code: Length reduced
Table: 16576, Service Tax Distribution
Field: 2, From Location: Length reduced
Field: 14, To Location: Length reduced
Table: 16577, Distribution Header
Field: 2, From Location: Length reduced
Table: 16578, Distribution Line
Field: 3, From Location: Length reduced
Field: 4, To Location: Length reduced
Table: 16579, Posted Distribution Header
Field: 2, From Location: Length reduced
Field: 10, Posting No. Series: Length reduced
Table: 16580, Posted Distribution Line
Field: 3, From Location: Length reduced
Field: 4, To Location: Length reduced
Table: 16587, Tax Journal Line
Field: 13747, Location Code: Length reduced
Table: 16597, Capitalize CWIP Header
Field: 8, Depreciation Book: Length reduced
Table: 16599, Posted Capitalize CWIP Header
Field: 8, Depreciation Book: Length reduced

Examples of code to migrate data:

DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Vendor”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Purchase Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Company Information”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Gen. Journal Line”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Purch. Rcpt. Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Purch. Inv. Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Purch. Cr. Memo Hdr.”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Purchase Header Archive”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Return Shipment Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”RG 23 A Part I”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”RG 23 A Part II”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”RG 23 C Part I”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”RG 23 C Part II”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”PLA Entry”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Posted Jnl. Bank Charges”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Tax Area Locations”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Sub Order Component List”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Sub Order Comp. List Vend”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Subcontractor Delivery Challan”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Jnl. Bank Charges”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Proposed Depr Method Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”BOM Location”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”RG 23 D”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Voucher No. Series”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Voucher Account”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Service Tax Opening”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Gate Entry Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Gate Entry Location Setup”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Posted Gate Entry Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Detailed PLA Entry”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Service Tax Distribution”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Distribution Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Distribution Line”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Posted Distribution Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Posted Distribution Line”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Tax Journal Line”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Capitalize CWIP Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
DataUpgradeMgt.SetTableSyncSetup(DATABASE::”Posted Capitalize CWIP Header”,[Upgrade Table Id],TableSynchSetup.Mode::[Mode]);
At line:1 char:1
+ Sync-NAVTenant -ServerInstance Demo_Upgrade_IN_71_90 -Mode Sync
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (0:Int32) [Sync-NAVTenant], NavCommandException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$Demo_Upgrade_IN_71_90,Microsoft.Dynamics.Nav.Management.Cmdlets.SyncNavTenant

To solve this error and proceed to next step, if we run Sync-NAVTenant with ForceSync mode(there is no chance of data loss) then Table Synch Setup will not work for the table with schema changes (i.e the modified table) becasue through Sync mode system will not allowed to go ahead.

So to actually solve this error you need to restore NAV 2013 R2 database again and reduce field length for all listed fields in above error and run all the steps again.

But again new error(why system is not showing all the errors in one shot) and this is not the good news.

Sync-NAVTenant : When the TableSynchSetup.Mode::Copy mode is used in an upgrade codeunit for
synchronizing a table, the upgrade table can contain a subset of fields of the original table. The
fields and the primary key of the upgrade table must match those in the original table.
The following errors must be fixed:
Data in the fields ‘Sub. Comp. Location’ in the original table ‘Item’ cannot be saved in the upgrade
table ‘UPG Item’. Please make sure that listed fields are present in the upgrade table and they
match equivalent fields in the original table in terms of their design.
At line:1 char:1
+ Sync-NAVTenant -ServerInstance navtile2016 -Mode CheckOnly
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (0:Int32) [Sync-NAVTenant], NavCommandException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$navtile2016,Microsoft.Dynamics.Nav.Management.Cmdlets.SyncNavTenant

So what’s next…

Again, you need to restore NAV 2013 R2 database again and reduce field length for ‘Sub. Comp. Location’ in table ‘Item’ and run all the steps again.

Hope this help you to avoid error and save time on your next upgrade.