Import-NAVData

Import-NAVData

Imports data from a file that has been exported from a Microsoft Dynamics NAV database.

Syntax

Parameter Set: UseDatabase_SomeCompanies
Import-NAVData -DatabaseName <String> [-ApplicationDatabaseName <String> ] [-ApplicationDatabaseServer <String> ] [-CompanyName <String[]> ] [-DatabaseServer <String> ] [-Force] [-IncludeApplication] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: __AllParameterSets
Import-NAVData [-FilePath] <String> [-Force] [-IncludeApplicationData] [-IncludeGlobalData] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: UseDatabase_AllCompanies
Import-NAVData -AllCompanies -DatabaseName <String> [-ApplicationDatabaseName <String> ] [-ApplicationDatabaseServer <String> ] [-DatabaseServer <String> ] [-Force] [-IncludeApplication] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: UseNST_AllCompanies
Import-NAVData [-ServerInstance] <String> [[-Tenant] <TenantId> ] -AllCompanies [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: UseNST_SomeCompanies
Import-NAVData [-ServerInstance] <String> [[-Tenant] <TenantId> ] [-CompanyName <String[]> ] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

Use the Import-NAVData cmdlet to import data into a Microsoft Dynamics NAV database from a file. You can choose to import all data in the file, and you can choose to import only company-specific data, global data, application data, or application objects. You can use the Import-NAVData cmdlet in a classic single-tenant deployment of Microsoft Dynamics NAV, and you can use it in multitenant deployments.

You can only import an application into an empty database. If you import application data but not the application, you cannot access the database from Microsoft Dynamics NAV. Similarly, if you import global data into a database that does not contain a company, you cannot open Microsoft Dynamics NAV.

Also, we recommend that you do not import an application into a database that users are accessing. A new application often defines a new database schema that changes the structure of the business data.

The cmdlet takes different parameter sets depending on how you connect to the database that you want to import data into. You can access the database through the Microsoft Dynamics NAV Server instance, or you can access the database directly.

You can use the Import-NAVData cmdlet to transfer data between installations. We recommend that you use SQL Server management tools to back up and restore databases. To export data to a file, use the Export-NAVData cmdlet.

Parameters

-AllCompanies

Specifies if you want to import all companies from the specified file.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ApplicationDatabaseName<String>

Specifies the name of the Microsoft Dynamics NAV database that contains the application tables.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ApplicationDatabaseServer<String>

Specifies the name of the computer on which the SQL Server instance for the Microsoft Dynamics NAV database that contains the application tables is installed.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CompanyName<String[]>

Specifies the name of the company or the companies that you want to import. If the company does not exist in the file, the operation fails.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DatabaseName<String>

The name of the Microsoft Dynamics NAV database that contains the data that you want to export, such as 'Demo Database NAV (8-0)'.

In a multitenant deployment, this is the name of the tenant database, and you must also specify the tenant ID in the Tenant parameter.

Aliases

TenantDatabaseName

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DatabaseServer<String>

Specifies the name of the computer on which the SQL Server instance for the Microsoft Dynamics NAV database is installed.

Aliases

TenantDatabaseServer

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FilePath<String>

Specifies the name and location of the file that you want to import data from. The file must be a .navdata file that has been exported from Microsoft Dynamics NAV.

If you use parameter sets that include –ServerInstance, the user account for the Microsoft Dynamics NAV Server instance must have read access to the location that is specified by the –FilePath parameter.

If you use parameter sets that include –DatabaseServer, you must have read access to the location that is specified by the –FilePath parameter.

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Force

Forces the command to run without asking for user confirmation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IncludeApplication

Specifies that you want to include application objects in the import. If you do not set the parameter, application objects are not included in the import. You can only import an application into an empty database.

You can only set this parameter when you access the Microsoft Dynamics NAV database directly through the DatabaseServer and DatabaseName parameters.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-IncludeApplicationData

Specifies that you want to include application data in the import. If you do not set the parameter, application data is not included in the import.

Application data is tables that describe the application as opposed to being business data.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-IncludeGlobalData

Specifies that you want to include global, non-company specific data in the import. If you do not set the parameter, global data is not included in the import.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ServerInstance<String>

Specifies the Microsoft Dynamics NAV Server instance that the company uses, such as DynamicsNAV80. You can specify either the fully qualified name, such as 'MyServer$DynamicsNAV80 ', or the short name, such as 'DynamicsNAV80'.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Tenant<TenantId>

Specifies the ID of the tenant that the company is imported into, such as Tenant1. This parameter is required unless the specified service instance is not configured to run multiple tenants.

Aliases

Id

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Examples

--------------------------EXAMPLE 1--------------------------

Description

-----------

This example imports the two named companies into the database that is mounted against the specified Microsoft Dynamics NAV Server instance in a single-tenant deployment of Microsoft Dynamics NAV.

PS C:\> Import-NAVData -ServerInstance DynamicsNAV80 -CompanyName "CRONUS International Ltd.", "My Company" -IncludeGlobalData -FilePath C:\file\CompaniesAndGlobalData.navdata

--------------------------EXAMPLE 2--------------------------

Description

-----------

This example imports a named company into the specified tenant database that uses the specified application database in a multitenant deployment of Microsoft Dynamics NAV.

PS C:\> Import-NAVData -DatabaseServer 'MyServer' -DatabaseName 'Tenant 1 Database' –ApplicationDatabaseServer 'MyServer' -ApplicationDatabase 'NAV App' -CompanyName "CRONUS International Ltd." -FilePath C:\file\Company.navdata