Get-NAVDataUpgrade

Gets information about a data upgrade process that is currently running, or the last completed data upgrade process.

Syntax

Get-NAVDataUpgrade
   [[-Tenant] <TenantId>]
   [-ServerInstance] <String>
   [-Force]
   [<CommonParameters>]
Get-NAVDataUpgrade
   [[-Tenant] <TenantId>]
   [-ErrorOnly]
   [-ServerInstance] <String>
   [-Force]
   [<CommonParameters>]
Get-NAVDataUpgrade
   [[-Tenant] <TenantId>]
   [-Detailed]
   [-ServerInstance] <String>
   [-Force]
   [<CommonParameters>]
Get-NAVDataUpgrade
   [[-Tenant] <TenantId>]
   [-Progress]
   [[-Interval] <Int32>]
   [-ServerInstance] <String>
   [-Force]
   [<CommonParameters>]

Description

This information is available until the Business Central Server instance is restarted.

Examples

EXAMPLE 1

Get-NAVDataUpgrade -ServerInstance BC

ExtensionData             : System.Runtime.Serialization.ExtensionDataObject
TenantId                  : default
TotalFunctionCount        : 5
ExecutedFunctions         : 3
UpgradeExecutionMode      : UsingParallelOrSerialTransaction
Progress                  : 60.00 %
Details                   : {OnRun}
Errors                    :
ExecutionDetails          : {BASE, BASE, BASE, BASE...}
ExecutionErrors           :
State                     : Completed
NumericProgress           : 0.6
IsTenantInExclusiveAccess : False

This example gets information about the data upgrade process that is currently running or the last completed data upgrade process. The following table describes the details:

Detail Description
ExtensionData Data object used to extend this type
TenantId The ID of the tenant being upgraded
TotalFunctionCount The total number of upgrade events and codeunit methods to be executed in the upgrade
ExecutedFunctions The total number of successfully executed upgrade events and codeunit methods
UpgradeExecutionMode Indicates whether upgrade was run in UsingSingleTransaction mode (using the -SingleTransaction parameter) or UsingParallelOrSerialTransaction mode (using the -FunctionExecutionMode parameter)
Progress The progress of upgrade process execution shown as a percentage of ExecutedFunctions/TotalFunction
Details Obsolete; not used
ExecutionDetails A collection of details for upgrade execution
ExecutionErrors Indicates whether any activities reported errors during execution
State Indicates the current state of upgrade process, like InProgress or Completed
NumericProgress The progress of upgrade process execution shown as a numeric value (ExecutedFunctions/TotalFunction)
IsTenantInExclusiveAccess Indicates whether the tenant is in ExclusiveAccess state

EXAMPLE 2

Get-NAVDataUpgrade -ServerInstance BC -Progress -Interval 2

Data Upgrade Process is currently in progress...


   Percent complete: 0.00 %


   [                                                                    ]

This example monitors progress of current data upgrade process by requesting the Business Central Server for status every 2 seconds (the default is every second).

EXAMPLE 3

Get-NAVDataUpgrade -ServerInstance BC -Detailed


ModuleName        : BASE
WorkflowStep      : CheckPreconditions
ExecutionSourceId : 00000000-0000-0000-0000-000000000000
SessionId         : 26
CompanyName       : CRONUS International Ltd.
StartTime         : 04/27/2022 3:08:15 PM
Duration          : 00:00:00.0470021
State             : Completed
Error             :
PostUpgrade       : False

ModuleName        : BASE
WorkflowStep      : OnUpgrade
ExecutionSourceId : 00000000-0000-0000-0000-000000000000
SessionId         : 27
CompanyName       : CRONUS International Ltd.
StartTime         : 04/27/2022 3:08:15 PM
Duration          : 00:00:00.0030002
State             : Completed
Error             :
PostUpgrade       : False

ModuleName        : BASE
WorkflowStep      : ValidateUpgrade
ExecutionSourceId : 00000000-0000-0000-0000-000000000000
SessionId         : 0
CompanyName       : CRONUS International Ltd.
StartTime         :
Duration          :
State             : NotExecuted
Error             :
PostUpgrade       : False

ModuleName        : BASE
WorkflowStep      : AfterUpgradeCommit
ExecutionSourceId : 00000000-0000-0000-0000-000000000000
SessionId         : 0
CompanyName       : CRONUS International Ltd.
StartTime         :
Duration          :
State             : NotExecuted
Error             :
PostUpgrade       : False


SessionId         : 30
CodeunitId        : 2
FunctionName      : OnRun
CompanyName       : CRONUS International Ltd.
StartTime         : 04/27/2022 3:08:25 PM
Duration          : 00:00:04.8249923
State             : Completed
Error             :
ExecutionSourceId : 00000000-0000-0000-0000-000000000000
PostUpgrade       : False

This example returns a detailed status of a currently running or completed data upgrade process. The following table describes the details:

Detail Description
ModuleName The name of the module that was upgraded; always BASE
WorkflowStep The upgrade event that ran
CodeunitId The ID of the upgrade codeunit that ran
FunctionName The method in the upgrade codeunit that ran
ExecutionSourceId The ID of the source where the event came from
SessionId The ID of the session that ran the step
CompanyName The company the upgrade was run on
StartTime Date and time that step or method started
Duration The time it took to complete the step or method
State The state of the step, like InProgress, Failed, Completed or NotExecuted
Error The error that occurred in the step, if any.
PostUpgrade Indicates whether step occurred after the upgrade was completed.

Parameters

-Detailed

Lists details about all the upgrade events and methods that were invoked during the data upgrade process. You can format the output as a table by appending the command with "| ft" or "| ogv".

Type:SwitchParameter
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ErrorOnly

Lists errors that occurred during the data upgrade process.

Type:SwitchParameter
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Interval

Specifies how often (in seconds) the cmdlet requests the current status of data upgrade process. This parameter can only be used together with the -Progress switch. The default value is 1 second.

Type:Int32
Position:5
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Progress

Provides live progress indication about the data upgrade process that is currently running.

Type:SwitchParameter
Position:4
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ServerInstance

Specifies the name of a Business Central Server instance, for example, BC or myinstance. You can specify either the full name of an instance, such as MicrosoftDynamicsNavServer$myinstance or the short name such as myinstance. Include the name in single-quotes.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Tenant

Specifies the ID of a tenant on the Business Central Server instance. You can omit the Tenant parameter only if the Business Central Server instance is not configured to run multiple tenants.

Type:TenantId
Aliases:Id
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

System.String

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

Outputs

Microsoft.Dynamics.Nav.Types.NavUpgradeProcessExecutionDetails