Start-NAVDataUpgrade

Start-NAVDataUpgrade

Starts the process for upgrading the data in the tenant database.

Syntax

Parameter Set: __AllParameterSets
Start-NAVDataUpgrade [-ServerInstance] <String> [[-Tenant] <TenantId> ] [[-FunctionExecutionMode] <FunctionExecutionModeValue> ] [[-ContinueOnError]] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Start-NavDataUpgrade cmdlet calls the CheckPreconditions and Upgrade type functions in the upgrade codeunits that are set up for the application. These functions are used to update data in tables of the tenant database when schema changes have been made to tables in application database. These functions are called as follows:

1. CheckPreconditions type functions are called (in random order). If an error occurs, then any changes made in this step are rolled back.

2. Upgrade type functions are called (in random order). If an error occurs, then any changes made in this step are rolled back.

All upgrade functions are executed in parallel (at the same time) unless you choose a different mode by setting the -FunctionExecutionMode parameter. When running in parallel, it is important that all upgrade functions of the type "CheckPrecondition" and "Upgrade" can be run independently of each other. If not, then place the dependent functions into a single upgrade function in the required order.

The progress of the running process can be monitored using Get-NAVDataUpgrade cmdlet, stopped using Stop-NAVDataUpgrade cmdlet, and resumed using Resume-NAVDataUpgrade cmdlet.

Parameters

-ContinueOnError

Specifies whether the Microsoft Dynamics NAV Server instance continues to execute other upgrade functions when an error occurs while executing an upgrade function.

If you do not set this parameter, then when an error occurs, the Microsoft Dynamics NAV Server instance will suspend the data upgrade process. It will cancel the execution of upgrade functions currently in progress and roll back any changes that were applied. Completed functions will not be rolled back.

The process remains in suspended state until you take one of the following actions:

- Fix the problems in the upgrade functions that failed, and then resume the process by using the Resume-NAVDataUpgrade cmdlet. You should not add new upgrade functions at this time because they will be ignored when you resume the process.

- Stop the data upgrade process by using the Stop-NAVDataUpgrade cmdlet. Stopping the process will not roll back changes made by upgrade functions that have already been executed.

If you set this parameter, then when an error occurs, the Microsoft Dynamics NAV Server instance will continue executing other upgrade functions. At the end of the process, you can use the Get-NAVDataUpgrade cmdlet to see the list of failed upgrade functions. Changes that were applied by completed functions will not be rolled back.

When upgrading a large database, you should increase the SQL Command Timeout setting for the Microsoft Dynamics NAV Server instance that connects to the database to avoid timeouts during schema synchronization. The default setting is 30 minutes. For more information, see Configuring Microsoft Dynamics NAV Server.

Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServerInstance<String>

Specifies the Microsoft Dynamics NAV Server instance that the application database and the tenant database are mounted against, such as DynamicsNAV90.

The default instance name is MicrosoftDynamicsNavServer. You can specify either the fully qualified name, such as 'MyServer$DynamicsNAV90', or the short name, such as 'DynamicsNAV90'.

You must include the name within single quotation marks.

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 you want to synchronize with the application, 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

-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

-FunctionExecutionMode<FunctionExecutionModeValue>

Specifies whether the Microsoft Dynamics NAV Server instance executes upgrade functions in series or parallel.

If the parameter is set to Serial, then CheckPrecondition and Upgrade type functions for each company are executed in series (one after another).

If the parameter is set to Parallel, then CheckPrecondition type functions will be executed for all companies in parallel (starting at the same time), and if completed successfully, then all Upgrade type functions for all companies will be executed in parallel.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

false

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.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.String

    You can pass the value of the ServerInstance and Tenant parameters as a string to this cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

Notes

  • Because the functions in the steps are called in random order, you should design the functions so that they are independent from each other.

Examples

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

This example starts new data upgrade process that runs upgrade functions in parallel.

PS C:\> Start-NAVDataUpgrade -ServerInstance DynamicsNAV90 -Force

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

Description

-----------

This example starts new data upgrade process that runs upgrade functions run in parallel and is set to continue running when errors occur.

PS C:\> Start-NAVDataUpgrade -ServerInstance DynamicsNAV90 -ContinueOnError -Force

--------------------------EXAMPLE 3--------------------------

Description

-----------

This example starts new data upgrade process that runs upgrade functions in serial. The execution of CheckPrecondition type functions will stop the process. Failure in an upgrade function will suspend the upgrade process, which can then be resumed by using Resume-NAVDataUpgrade cmdlet.

PS C:\> Start-NAVDataUpgrade -ServerInstance DynamicsNAV90 -FunctionExecutionMode Serial -Force