Share via


Export-NAVData

Export-NAVData

Exports data from a Microsoft Dynamics NAV database.

Syntax

Parameter Set: UseDatabase_SomeCompanies
Export-NAVData [-ApplicationDatabaseCredentials <PSCredential> ] [-ApplicationDatabaseName <String> ] [-ApplicationDatabaseServer <String> ] [-CompanyName <String[]> ] [-DatabaseCredentials <PSCredential> ] [-DatabaseName <String> ] [-DatabaseServer <String> ] [-Force] [ <CommonParameters>]

Parameter Set: __AllParameterSets
Export-NAVData -FilePath <String> [-Description <String> ] [-Force] [-IncludeApplication] [-IncludeApplicationData] [-IncludeGlobalData] [ <CommonParameters>]

Parameter Set: UseDatabase_AllCompanies
Export-NAVData -AllCompanies [-ApplicationDatabaseCredentials <PSCredential> ] [-ApplicationDatabaseName <String> ] [-ApplicationDatabaseServer <String> ] [-DatabaseCredentials <PSCredential> ] [-DatabaseName <String> ] [-DatabaseServer <String> ] [-Force] [ <CommonParameters>]

Parameter Set: UseDatabase_NoCompanies
Export-NAVData [-ApplicationDatabaseCredentials <PSCredential> ] [-ApplicationDatabaseName <String> ] [-DatabaseCredentials <PSCredential> ] [-DatabaseName <String> ] [-DatabaseServer <String> ] [-Force] [ <CommonParameters>]

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

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

Detailed Description

Use the Export-NAVData cmdlet to export data from a Microsoft Dynamics NAV database. You can export company-specific data, and you can choose to include global data, application data, and application objects.

When you export data from a Microsoft Dynamics NAV database, the data is stored in a file with the extension .navdata. This file cannot be modified in external tools. The data that you export is not deleted from the original database.

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

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

Parameters

-AllCompanies

Specifies if you want to export all companies in the database to the specified file.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ApplicationDatabaseCredentials<PSCredential>

Specifies the user name and password of an SQL Server Authentication login account that provides access to the application database in SQL Server.

You use this parameter to access the database by using SQL Server Authentication. If you want to use Windows Authentication, then you can omit this parameter.

The login account must be a member of the db_owner role on the database.

Aliases

none

Required?

false

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 in a multitenant deployment. You must also set the ApplicationDatabaseServer parameter.

Even if you are not exporting data from the application database, you must specify this parameter.

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 in a multitenant deployment.

Even if you are not exporting data from the application database, you must specify this parameter.

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

-DatabaseCredentials<PSCredential>

Specifies the user name and password for an SQL Server Authentication login account that provides access to the database or tenant database (in a multitenant deployment) in SQL Server.

You use this parameter to access the database by using SQL Server Authentication. If you want to use Windows Authentication, then you can omit this parameter.

The login account must be a member of the db_owner role on the database.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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?

false

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

-Description<String>

Specifies a description of the data that you want to export, such as 'My Application Database'.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-FilePath<String>

Specifies the name and location of the file that you want to export data to. The data is exported to a file with the extension .navdata.

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

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

Aliases

FileName

Required?

true

Position?

named

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 export. If you do not set the parameter, application objects are not included in the export.

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 export. If you do not set the parameter, application data is not included in the export.

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 data in the export. If you do not set the parameter, global data is not included in the export.

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 DynamicsNAV90. You can specify either the fully qualified name, such as 'MyServer$DynamicsNAV90 ', or the short name, such as 'DynamicsNAV90'.

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 in multitenant deployments of Microsoft Dynamics NAV.

Aliases

Id

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

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 exports all companies from the specified database that is mounted against the specified Microsoft Dynamics NAV Server instance in a single-tenant deployment of Microsoft Dynamics NAV.

PS C:\> Export-NAVData -DatabaseServer 'MyServer' -DatabaseName 'Demo Database NAV (8-0)' -AllCompanies -FilePath C:\file\Companies.navdata

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

Description

-----------

This example exports the two specified companies from the specified tenant database in a multitenant deployment of Microsoft Dynamics NAV. The Microsoft Dynamics NAV Server instance is configured for SQL authentication with the database.

PS C:\> Export-NAVData -ServerInstance DynamicsNAV80 -Tenant "Tenant1" -CompanyName "Company A, Company B" -FilePath C:\file\Companies.navdata -DatabaseCredentials (Get-Credential)