IMPORT-NAVDATA FAILS

tarkmyler
Member Posts: 57
I am trying to create a test company using Powershell and the following steps with NAV 2013r2 Update 11.
1. Export-NAVData (I've tried both UseNST_SomeCompanies, and UseDatabase_SomeCompanies)
2. Rename-NAVCompany
3. Import-NAVData
The Export and Rename complete without error. The Import fails with the following message:
========================================================================================
Import-NAVData -databaseName NAV2013_GoLive -FileName C:\install\NAV2013_GoLive.navdata -ApplicationDatabaseName NAV2013_GoLive -ApplicationDatabaseServer DBSERVER2 -CompanyName "PHBTest" -DatabaseServer DBSERVER2 -Force
WARNING: UnhandledErrorMessage
Import-NAVData : Object reference not set to an instance of an object.
At line:1 char:1
+ Import-NAVData -databaseName NAV2013_GoLive -FileName C:\install\NAV2013_GoLive. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-NAVData], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Dynamics.Nav.Management.Cmdlets.ImportNavData
========================================================================================
I have:
1. Recompiled all of the objects, retried export/import.
2. Performed a Sync-NAVTenant
3. Tried it with and without application/applicationdata/globaldata
4. Tried doing it through the user interface - with the same result.\
5. Performed the following query per Gunnar ...
Delete from [<<Source Database>>].[dbo].[Object Metadata Snapshot] Where [Object ID] IN
(2000000007, 2000000026, 2000000049, 2000000101, 2000000102, 2000000103, 2000000020, 2000000055, 2000000009, 2000000029, 2000000038, 2000000058, 2000000041, 2000000028, 2000000063, 2000000022, 2000000048, 2000000040, 2000000043, 2000000044, 2000000039, 2000000045)
I have no idea why the schema would be different, or if that is what is causing the error. I'm stumped.
Our workaround is a test SQL dB and service tier to service it. Not nearly as elegant as just changing companies.
Update on this .... I was just successful using the COPY Action on the Companies list via the RTC client. Absolutely whacky. I'd still like to do this with powershell if I can get past the error.
Please help!
1. Export-NAVData (I've tried both UseNST_SomeCompanies, and UseDatabase_SomeCompanies)
2. Rename-NAVCompany
3. Import-NAVData
The Export and Rename complete without error. The Import fails with the following message:
========================================================================================
Import-NAVData -databaseName NAV2013_GoLive -FileName C:\install\NAV2013_GoLive.navdata -ApplicationDatabaseName NAV2013_GoLive -ApplicationDatabaseServer DBSERVER2 -CompanyName "PHBTest" -DatabaseServer DBSERVER2 -Force
WARNING: UnhandledErrorMessage
Import-NAVData : Object reference not set to an instance of an object.
At line:1 char:1
+ Import-NAVData -databaseName NAV2013_GoLive -FileName C:\install\NAV2013_GoLive. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-NAVData], NullReferenceException
+ FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Dynamics.Nav.Management.Cmdlets.ImportNavData
========================================================================================
I have:
1. Recompiled all of the objects, retried export/import.
2. Performed a Sync-NAVTenant
3. Tried it with and without application/applicationdata/globaldata
4. Tried doing it through the user interface - with the same result.\
5. Performed the following query per Gunnar ...
Delete from [<<Source Database>>].[dbo].[Object Metadata Snapshot] Where [Object ID] IN
(2000000007, 2000000026, 2000000049, 2000000101, 2000000102, 2000000103, 2000000020, 2000000055, 2000000009, 2000000029, 2000000038, 2000000058, 2000000041, 2000000028, 2000000063, 2000000022, 2000000048, 2000000040, 2000000043, 2000000044, 2000000039, 2000000045)
I have no idea why the schema would be different, or if that is what is causing the error. I'm stumped.
Our workaround is a test SQL dB and service tier to service it. Not nearly as elegant as just changing companies.
Update on this .... I was just successful using the COPY Action on the Companies list via the RTC client. Absolutely whacky. I'd still like to do this with powershell if I can get past the error.
Please help!
Mark Tyler
Pacific City, OR
Pacific City, OR
0
Comments
-
Hi,
Are Export and Import database same or different ?Jatin Patel
Microsoft Dynamics NAV Consultant
Jatin's Blog0 -
Hi,
Just curious, why do you not use the Copy-NAVCompany cmdlet? [ I do not know if that is already available in your build - that might explain.... ]Jan Veenendaal0 -
Export/Import database is the same.
I didn't use the Copy-Company Cmdlet because of ignorance. And now I'll just have the user go to the companies page and use the Copy Company Action posted there... :oops: - this is a big "duh" moment, but that's how we learn.
That sidesteps the whole issue of how we as an ISV might be able to use Export-NAVData and Import-NAVData to take our demo/training company and drop it into an upgraded customer's database. I'd love to figure out why Import is throwing errors when the navdata file being imported was JUST EXPORTED from the same database after performing all of the incantations that are supposed to make it work.
Thanks for the responses!Mark Tyler
Pacific City, OR0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions