Upgrade form 4.4 to 5.6.1 questions

Product: PowerShell Universal
Version: 4.4.0

Hello,

I’m sure this has been partially answered somewhere on the forum, but I’m trying to consolidate all the information in one place.

In my production environment, I’m still running version 4.4.0. I’ve been holding off on upgrading, waiting for version 5 to include the improvements I need and to become relatively stable and bug-free.

I’ve now installed all the v5 versions in my development environment, up to the latest 5.6.1. I’ve re-coded all my apps to take advantage of the new features in 5.6.1 and added a lot of new functionality.

So, it’s finally time to upgrade production.

I understand that for such a major upgrade, the old version must be uninstalled before installing the new one. I have a few questions regarding this process:

  1. Will it remove any of my dashboards or apps?

  2. Will it remove any of my scripts or endpoints?

  3. Will it affect any of my settings, including PowerShell Universal settings in appsettings.json?

  4. Will it delete any of my secret variables or tokens, especially those stored in the database?

In short: how can I prepare the upgrade so that it goes as smoothly as a regular minor update?

Anyone ??
Nobody has done it before or there is nothing to worry about ?

I’m not sure how it handles the database between major versions (if you’re using sqllite) I’ll let someone else answer that

But certainly for your repo and all the files contained within, and even your appsettings.json, they should remain untouched by any uninstall/install process. Obviously, it should still go without saying, any changes in your production environment like this, still make sure you have backed things up and have a rollback plan. Snapshot your VM, or as a minimum copy your database and repo files to an alternative location, it’s always worth doing anyway just in case even if you don’t expect impact.

Hi,

maybe my input is usefull.
When we updated from major version 4 to major version 5 (5.5.1 to be exactly) I did the following stuff before execute the msi file:

  • stopped all schedules (probably not necessary)
  • stopped git sync (if you use git)
  • Unblocked all Files in my PSU folder (probably not necessary but for safety)
  • manually updated db schema (because we use SQL not the built in database)
  • Uninstalled the current version
  • Installed the new major version

and it went pretty smooth.

No apps (dashboards), variables, scripts or endpoints got lost in the process, also the appsettings.json wasn’t touched

Edit:
Have a look at this:

yep i also think that all of the settings, apps, schedules and endpoints will remain untouched (since its all stored in powershell scripts anyway and they should be not deleted)

im little worry about secrets variables. i can backup them and restore after but it will be nice if it will be not affected as well.
ofcourse vm snapshot is mandatory (even with minor updates)

We just did 4.5.x to 5.5.x. The big thing was moving from queues to computer groups and making sure that all schedules were set with the computer group instead. We have one entry point into our prod cluster (only one server can be modified with git pushing to the others). I shut them all down, made changes to the schedules, computer groups, etc, and restarted just the one. Once that was up I would upgrade each additional node.

The biggest headache was git.. because of the upgrade I had to manually copy the repository to every other node so the .git folder would be 100% in sync.

i dont have cluster. only one prod server and one dev. and they are not synced (although i have git set on both but in different projects

I just did the update from 4.4.1 to 5.6.1, the environment PSU runs on is:

Windows Server 2022
MS SQL Server 2019
WS-Fed authentication (Configured in AppSettings.json)
Git Sync

I haven’t run into any issues you wanted specifically answered, but I did have the following issues:

  • Installer detected a major upgrade (Caused by at least one duplicate Installer entry, had both PSU 4.2.8 and PSU 2.8.2 registered)
    • Fixed by removing those entries, unfortunately I had already performed an uninstall on 4.4.1, but it basically found my old uninstall (Excluding the Service Account)
  • PSU wouldn’t start, SQL foreign key constraint in the JobPipelineOutput-table, this was caused by old jobs that had an identity Id, but no JobId.
    • Fixed by deleteing the jobs with a null-valued JobId on the database
  • WS-Fed/Saml Authentication didn’t work properly, I did get past authentication but had the wrong permissions (Might’ve been a license issue, as ours had lapsed as well)
    • Could’ve been due to license, in the end I removed it from appsettings.json and set it up using the UI, and it worked again (a license upgrade and restart later)
  • Git sync not working.
    • Investigating, but seems to be the same issue as in this thread.
  • Scripts with gRPC errors
    • Still investigating, but it’s why I didn’t upgrade to 5.x in the first place, as it changed some things around which caused basically all internal PSU commands to fail, which I use in many of my scripts.

But as to your point the apps/dashboards work fine, nothing seems to have been lost, and the few issues I have above is mostly due to it being a system with a history of helper scripts and other quirks from not having had the features when I developed it :slight_smile:

On the last one - that’s expected going from v4 to v5, you’ll need to change your appsettings.json to use either Permissive or Integrated SecurityModel, or re-work how you use the PSU cmdlets since strict mode works a little different and it’s more secure, the gRPC errors are a bit misleading, but its likley to do with that.

I had the same issues, initially I switched to integrated, but I’m now looking into Strict instead for better security as my instance will be used by a few different people/teams.

See: Module | PowerShell Universal

Yep, that was actually why I didn’t upgrade past 4.x back then, and I didn’t have the time to address it then, but in hindsight I guess it was a bit silly since at the end of the day, not running 5.x because you have to “lower security” is kind of the equivalent of not upgrading to Windows 7 because Windows XP doesn’t have UAC Slider :grin:

But figured it was at least a good opportunity to answer OP’s question so he knew what to expect :slight_smile:

Wait, we are not that old… right? @tholabrk :grin:

1 Like

Of course not, I was just reading off Wikipedia :slight_smile:

(Or I guess watching a TikTok about it :rofl: )