Start-NavDataUpgrade during upgrade to v17/18 - how to detec when it is finished?

radek.bbradek.bb Member Posts: 49
I am running upgrade to V17 according to this MS guideline Upgrading Customized C/AL Application to Microsoft Base Application Version 17 .
Everything is fine but...
Task 10 point 1 when I run Start-NavDataUpgrade is asynchronous :(
In next point they say: "To view the progress of the data upgrade, you can run Get-NavDataUpgrade cmdlet with the –Progress switch. When completed, the table migration extension will be installed."
I want this to be scripted - not manual...
I tried using SingleTransaction option - but it is also asynchronous.
Should I build some weird repeat/try/sleep loop - or is there a better way to do this?

Best Answers

  • TallyHoTallyHo Member Posts: 416
    edited 2021-06-24 Answer ✓
    Start-NavDataUpgrade -ServerInstance BC140 -FunctionExecutionMode Serial
    Get-NAVDataUpgrade -ServerInstance BC140 -Progress -Interval 30
    $notifyParams = @{title="PowerShell Alert";content="NavDataUpgrade Ready."}
    Invoke-WebRequest -Uri https://hook.notify17.net/api/raw/asdf -Method POST -Body $notifyParams

    I scripted it this way so I got warned by notify17 app at the end of the process. You can do this for every step in your script (replace asdf with your notify17 key).
  • radek.bbradek.bb Member Posts: 49
    Answer ✓
    aa... it does NOT work...
    if I have something like this:

    Line1: Start-NavDataUpgrade -ServerInstance BC140 -FunctionExecutionMode Serial
    Line2: Get-NAVDataUpgrade -ServerInstance BC140 -Progress -Interval 30
    Line3: whatever

    Line 3 is executed right away - without waiting for completion :(

    Below is my script (using standard approach for upgrade scripts) and its result:
    u5u565kvlf9v.jpg

    My previous version works fine...
    fq620g2ggx5n.jpg

Answers

  • radek.bbradek.bb Member Posts: 49
    I do not like this very much but well... it works...

    $ServerReady = $false
    Do
    {
    try
    {
    $ServerReady = $true
    Install-NAVApp -ServerInstance BC17 -Name "System Application" -Version 14.0.0.0
    }
    catch
    {
    $ServerReady = $false
    Start-Sleep -Seconds 60
    }
    }
    Until($ServerReady)
  • RockWithNAVRockWithNAV Member Posts: 1,139
    Yes to see the Progress you need to execute with -Progress command, keep running this it wont stop it will show and the status bar will close, so keep running this command after a while.
  • TallyHoTallyHo Member Posts: 416
    edited 2021-06-24 Answer ✓
    Start-NavDataUpgrade -ServerInstance BC140 -FunctionExecutionMode Serial
    Get-NAVDataUpgrade -ServerInstance BC140 -Progress -Interval 30
    $notifyParams = @{title="PowerShell Alert";content="NavDataUpgrade Ready."}
    Invoke-WebRequest -Uri https://hook.notify17.net/api/raw/asdf -Method POST -Body $notifyParams

    I scripted it this way so I got warned by notify17 app at the end of the process. You can do this for every step in your script (replace asdf with your notify17 key).
  • radek.bbradek.bb Member Posts: 49
    aaa... now I got it... I just need to use -Interval flag - thanks! :)

    I missed this completely :)
    Thanks!
  • radek.bbradek.bb Member Posts: 49
    Answer ✓
    aa... it does NOT work...
    if I have something like this:

    Line1: Start-NavDataUpgrade -ServerInstance BC140 -FunctionExecutionMode Serial
    Line2: Get-NAVDataUpgrade -ServerInstance BC140 -Progress -Interval 30
    Line3: whatever

    Line 3 is executed right away - without waiting for completion :(

    Below is my script (using standard approach for upgrade scripts) and its result:
    u5u565kvlf9v.jpg

    My previous version works fine...
    fq620g2ggx5n.jpg
Sign In or Register to comment.