Error upgrading jenkin

Hi All,

I have a Windows Server running Jenkins version 2.255.3919. One of my colleagues originally installed it, but he is no longer part of the organization.I am trying to upgrade Jenkins to the latest version, but the upgrade is failing because the service is unable to start after the upgrade.Could someone please guide me on the correct way to upgrade Jenkins to the latest version?

Will the following steps work?

  1. Stop the Jenkins service.

  2. Back up the C:\ProgramData\Jenkins folder.

  3. Uninstall Jenkins.

  4. Install the newer version of Jenkins.

  5. Stop the Jenkins service again.

  6. Replace the C:\ProgramData\Jenkins folder with the one I backed up earlier.

  7. Start the Jenkins service.

Please let me know if this is the correct approach or if there is a recommended upgrade procedure.