Figured it out, here’s the resolution.
Import-NAVData : The specified file contains a table with the ID xxx that does not exist in the application database
After you get the database upgraded from a C/AL system, there shouldn’t be any Object Metadata in your database under Object ID 2000000000.
Check by looking at SQL.
SELECT TOP (1000) [timestamp]
,[Object Type]
,[Object ID]
,[Metadata]
,[User Code]
,[Metadata Version]
,[User AL Code]
,[Hash]
FROM [dbo].[Object Metadata]
where [Object ID] < 2000000000
Then check the Object Metadata Snapshot.
SELECT TOP (1000) [timestamp]
,[Object Type]
,[Object ID]
,[Name]
,[Data Per Company]
,[Metadata]
FROM [dbo].[Object Metadata Snapshot]
where [Object ID] < 2000000000
My results listed tables:
265 Document Entry
338 Entry Summary
830 DO Payment Card Type
1670 Option Lookup Buffer
1754 Field Content Buffer
7330 Bin Content Buffer
9192 Pending Company Rename
none of these exist in Cronus database (for 18.5)
I found each one in the database and then ran a DROP statement for each.
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N’[dbo].[CompanyName$Document Entry]’) AND type in (N’U’))
DROP TABLE [dbo].[CompanyName$Document Entry]
GO
Then I deleted the extra entries from the Object Metadata Snapshot table.
DELETE FROM [dbo].[Object Metadata Snapshot]
where [Object ID] < 2000000000
Then I restarted the Service Tier. and tested the Export/Import using powershell.
$ServerInstance = “BC180”
$CopyCompany = “CRONUS”
$NewCompanyName = “TestJoe1”
$FilePath = “E:~TempData\TestJoe1.navdata”
Restart-NAVServerInstance -ServerInstance $ServerInstance
Remove-Item -Path $filepath
Copy-NAVCompany -DestinationCompanyName $NewCompanyName -ServerInstance $ServerInstance -SourceCompanyName $CopyCompany
Export-NAVData -ServerInstance $ServerInstance -CompanyName $NewCompanyName -FilePath $FilePath -IncludeApplication -IncludeApplicationData -IncludeGlobalData
Remove-NAVCompany -CompanyName $NewCompanyName -ServerInstance $ServerInstance
Import-NAVData -ServerInstance $ServerInstance -CompanyName $NewCompanyName -FilePath $FilePath -IncludeApplication -IncludeApplicationData -IncludeGlobalData -Force
and it worked!
best of luck,
joe