Upgrade-script for Windows from OH2.5 to OH3.2 fails

I’m finally trying to upgrade my OH 2.5.11-installation on Windows 10 to OH 3.2.0 with the Powershell-script update.ps1, but it fails. I’ve updated earlier installations using the same procedure without a problem.

I can’t find any information on the error. Can someone guide me in the right direction? I’ve tried upgrading with both the update.ps1 from the 2.5.11-installation and also tried with the latest version of the script, but the Get-WmiObject-error is the same.

Would guess related to sunset of bintray. Try search community for that. Nor 100% sure of solution details.

There is no references to Bintray left in the script of what I can see. That was the first errors I got, but changing the download-links for releases to JFrog solved the downloading-issue i got at first.

Maybe this helps?

And to confirm you are running script in a power shell administrator window?

Hi Niklas

I had the same issue moving from 2.5.6 to 3.1.0.
Main issue is, that “Things” in Json cannot be migrated. This was only supported in the migration from 2.5.x to 3.0.0. I could not find the respective update.ps1 and version from OH in GitHub.

So I saved my 2.5.6 installation installed 3.1.0 from scratch and deleted thing from json DB before I moved json an conf data from my 2.5.6 to the 3.1.0 installation. I guess this will work also for 3.2.0.

All was there except Things. I copied them from json 2.5.6 to a text file and defined them new in 3.1.0.
each thing I had defined and linked with the items (items are still working) I deleted in the text file, so I was sure not missing out anythng.

See also this Topic I have created:

Important: That Things can be used in 3.2.0 you need to edit the following:

I actually got it to work! The problem was I was using the wrong Powershell-version. Using Powershell 7.x does not work. But using the built in version Powershell 5.1 in Windows 10 solved the problem.
The only thing I had to do in the script was change the url:s from bintray to the new download locations mentioned before.

Now I’m checking if everything works. Things seem to work alright? (attached)
But I seem to be missing my Habpanel-configuration? Can not choose the panel configuration, just local storage?

You can also download the newest OpenHAB zip file, extract the update.ps1 and replace your current version with this file.

Interesting: So your update.ps1 worked to update from 2.5 to 3.2.0?
Can you confirm?
If so, I made some extra work.

update.ps1 will automatically pick the newest version after the download and restart.

No,
it will not in this special case from 2.5 to 3.x, as the old script still refers to the old eclipse environment and fails.
If it would work, this thread would not be necessary.
Joerg

Yes, it worked for me anyway. From 2.5.11 to 3.2. The only thing I had to do was to change the url:s. Attached the log from the update. Don’t know if it is something in there that I should be worried about. The most things seem to work. Just som issues with HABPanel, Sony-binding, Hue-binding and a lot of other stuff that I have sorted out now… :smirk:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
                                                                                                                        Try the new cross-platform PowerShell https://aka.ms/pscore6                                                                                                                                                                                    PS C:\WINDOWS\system32> cd c:\openhab                                                                                   PS C:\openhab> . .\runtime\bin\update.ps1                                                                               PS C:\openhab> Update-openHAB -OHVersion 3.2.0

#################################
#  openHAB 2.x.x update script  #
#################################

Checking whether a service exists
Checking the specified openHAB directory
Using C:\openhab\conf as conf folder
Using C:\openhab\userdata as userdata folder
Using C:\openhab\runtime as runtime folder
Using C:\openhab\addons as addons folder
The current version is 2.5.11
Changing location to C:\openhab
Creating temporary update directory C:\Users\Pezay\AppData\Local\Temp\openhab
Downloading the openHAB 3.2.0 distribution to C:\Users\Pezay\AppData\Local\Temp\openhab\openhab-3.2.0.zip
Downloaded 96722K of 96722K [100%]
Finished Download
Extracting the archive (C:\Users\Pezay\AppData\Local\Temp\openhab\openhab-3.2.0.zip) to C:\Users\Pezay\AppData\Local\Temp\openhab\update

########################################################################################################################################
#  New update.ps1 was found - executing it instead (found in C:\Users\Pezay\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1)  #
########################################################################################################################################


###########################
#  openHAB update script  #
###########################

Checking whether a service exists
Checking the specified openHAB directory
Using C:\openhab\conf as conf folder
Using C:\openhab\userdata as userdata folder
Using C:\openhab\runtime as runtime folder
Using C:\openhab\addons as addons folder
The current version is 2.5.11
Changing location to C:\openhab
Upgrading to version 3.2.0

Making a backup of your distribution to C:\Users\Pezay\AppData\Local\Temp\openhab\backup-2.5.11
Creating backup directories in C:\Users\Pezay\AppData\Local\Temp\openhab\backup-2.5.11
Copying directory conf, userdata and runtime to C:\Users\Pezay\AppData\Local\Temp\openhab\backup-2.5.11\conf
Copying files from C:\openhab to C:\Users\Pezay\AppData\Local\Temp\openhab\backup-2.5.11\home

The script will attempt to update openHAB to version 3.2.0
Please read the following notes and warnings

Important notes for version [3.1.0] :
Warning: Hue Binding: The type of the channels 'switch', 'brightness', 'color' and 'color_temperature' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use one of these channels.
Warning: Keba Binding: Introduced Units of Measurements and the channel 'pwmpilotcurrent' was replaced by 'maxpilotcurrentdutycyle'. Items must be adapted and things created through the UI must be recreated.
Warning: Nest Binding: The binding now also supports the SDM API. To keep using the WWN API, add the 'wwn_' prefix to Thing Types in files or recreate the WWN Nest Things using the UI with your current WWN account configuration parameters.
Warning: OpenUV Binding: The type of the channels 'UVMaxTime', 'OzoneTime' and 'UVTime' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use one of these channels.
Warning: Xiaomi MiIo Binding: Many channels have been converted from Number to a Number with dimension, e.g. temperature channels have been changed from Number to Number:Temperature. Please see the binding documentation for details.

Important notes for version [3.2.0] :
Warning: Air Quality Binding: Full refactoring of things and channels. Please read the updated documentation and start with new things.
Warning: DanfossAirUnit Binding: The channel 'manual_fan_speed' has been deprecated and replaced by channel 'manual_fan_step'. Items should be relinked to the new channel.
Warning: EnOcean Binding: The RockerSwitch channels do not longer react if two buttons of a rocker switch are pressed simultaneously. If needed, the new channel RockerSwitchAction can be used instead.
Warning: Homematic Binding: The DOUBLE_PRESSED trigger event was removed from the BUTTON channel. If needed, it can be replaced by a rule triggered by the SHORT_PRESSED event which employs a timer to check for double presses.
Warning: Hunter Douglas (Luxaflex) PowerView Binding: Channel groups have been introduced for the PowerView Hub thing. Scene channels should be relinked to the new channels for channel group 'Scenes'.
Warning: IpCamera Binding: The URLs that serve the files have changed to now be on port 8080 and the serverPort config is no longer needed. Update any widget and rules if you have hard coded the URLs into them.
Warning: LG webOS Binding: The type of the channels 'power', 'mute', 'volume' and 'mediaPlayer' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use one of these channels.
Warning: Miele Binding: The temperature channels have been converted from Number to Number:Temperature.
Warning: Miele Binding: The channels 'state', 'program' and 'phase' are improved with better and possibly localized texts. Rules should use the new channels 'rawState', 'rawProgram' and 'rawPhase' for reliability. Please see the binding documentation for details.
Warning: RFXCOM Binding: Lighting4 default command ids are deprecated and will be removed in a future version. You must specify command ids in the thing configuration for Lighting4 devices.
Warning: Sager Weathercaster Binding: The type of the channels 'pressure', 'temperature' and 'wind-angle' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use one of these channels.
Warning: Sony Projector Binding: The type of the channel 'power' was updated. You may need to remove and create again your things in case your things were previously created using UI and you want to use this channel.
Okay to Continue? [y/N]: y

Execute 'PRE' instructions for version 3.2.0

Performing pre-update tasks for version [3.0.0] :
Could not rename C:\openhab\userdata/etc/log4j2.xml to C:\openhab\userdata/etc/log4j2.xml.bak
Could not rename C:\openhab\userdata/etc/org.ops4j.pax.logging.cfg to C:\openhab\userdata/etc/org.ops4j.pax.logging.cfg.bak

Performing pre-update tasks for version [3.2.0] :
Could not rename C:\openhab\userdata/etc/log4j2.xml to C:\openhab\userdata/etc/log4j2.xml.bak

Deleting current runtime (C:\openhab\runtime)
Deleting current files in userdata that should not persist
Deleted all.policy from C:\openhab\userdata\etc
Deleted branding.properties from C:\openhab\userdata\etc
Deleted branding-ssh.properties from C:\openhab\userdata\etc
Deleted config.properties from C:\openhab\userdata\etc
Deleted custom.properties from C:\openhab\userdata\etc
Deleted custom.system.properties from C:\openhab\userdata\etc
Deleted distribution.info from C:\openhab\userdata\etc
Deleted jmx.acl.org.apache.karaf.bundle.cfg from C:\openhab\userdata\etc
Deleted jmx.acl.org.apache.karaf.config.cfg from C:\openhab\userdata\etc
Deleted jre.properties from C:\openhab\userdata\etc
Deleted org.apache.felix.eventadmin.impl.EventAdmin.cfg from C:\openhab\userdata\etc
Deleted org.apache.felix.fileinstall-deploy.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.command.acl.bundle.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.command.acl.config.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.command.acl.feature.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.command.acl.jaas.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.command.acl.kar.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.command.acl.scope_bundle.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.command.acl.shell.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.command.acl.system.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.features.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.features.xml from C:\openhab\userdata\etc
Deleted org.apache.karaf.features.repos.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.jaas.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.kar.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.log.cfg from C:\openhab\userdata\etc
Deleted org.apache.karaf.shell.cfg from C:\openhab\userdata\etc
Deleted org.jupnp.cfg from C:\openhab\userdata\etc
Deleted org.ops4j.pax.url.mvn.cfg from C:\openhab\userdata\etc
Deleted overrides.properties from C:\openhab\userdata\etc
Deleted profile.cfg from C:\openhab\userdata\etc
Deleted startup.properties from C:\openhab\userdata\etc
Deleted system.properties from C:\openhab\userdata\etc
Deleted version.properties from C:\openhab\userdata\etc
Removing C:\openhab\userdata\cache
Removing C:\openhab\userdata\tmp
Copying C:\Users\Pezay\AppData\Local\Temp\openhab\update to C:\openhab without overwriting existing ones

Execute 'POST' instructions for version 3.2.0

Performing post-update tasks for version [3.0.0] :
Moved C:\openhab\userdata/config/org/eclipse/smarthome/i18n.config to C:\openhab\userdata/config/org/openhab/i18n.config
Replaced string org.eclipse.smarthome.i18n to org.openhab.i18n in file C:\openhab\userdata/config/org/openhab/i18n.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/persistence.config to C:\openhab\userdata/config/org/openhab/persistence.config
Replaced string org.eclipse.smarthome.persistence to org.openhab.persistence in file C:\openhab\userdata/config/org/openhab/persistence.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/audio.config to C:\openhab\userdata/config/org/openhab/audio.config
Replaced string org.eclipse.smarthome.audio to org.openhab.audio in file C:\openhab\userdata/config/org/openhab/audio.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/voice.config to C:\openhab\userdata/config/org/openhab/voice.config
Replaced string org.eclipse.smarthome.voice to org.openhab.voice in file C:\openhab\userdata/config/org/openhab/voice.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/inbox.config to C:\openhab\userdata/config/org/openhab/inbox.config
Replaced string org.eclipse.smarthome.inbox to org.openhab.inbox in file C:\openhab\userdata/config/org/openhab/inbox.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/links.config to C:\openhab\userdata/config/org/openhab/links.config
Replaced string org.eclipse.smarthome.links to org.openhab.links in file C:\openhab\userdata/config/org/openhab/links.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/folder.config to C:\openhab\userdata/config/org/openhab/folder.config
Replaced string org.eclipse.smarthome.folder to org.openhab.folder in file C:\openhab\userdata/config/org/openhab/folder.config
Could not move C:\openhab\userdata/config/org/eclipse/smarthome/cors.config to C:\openhab\userdata/config/org/openhab/cors.config
Get-Content : Cannot find path 'C:\openhab\userdata\config\org\openhab\cors.config' because it does not exist.
At C:\Users\Pezay\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1:218 char:22
+                     (Get-Content $parts[3]).replace($parts[1], $parts ...
+                      ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\openhab\user...hab\cors.config:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Could not replace string org.eclipse.smarthome.cors to org.openhab.cors in file C:\openhab\userdata/config/org/openhab/cors.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/threadpool.config to C:\openhab\userdata/config/org/openhab/threadpool.config
Replaced string org.eclipse.smarthome.threadpool to org.openhab.threadpool in file C:\openhab\userdata/config/org/openhab/threadpool.config
Replaced string org.eclipse.smarthome to org.openhab in file C:\openhab\runtime/services.cfg
Moved C:\openhab\userdata/config/org/eclipse/smarthome/autoupdate.config to C:\openhab\userdata/config/org/openhab/autoupdate.config
Replaced string org.eclipse.smarthome.autoupdate to org.openhab.autoupdate in file C:\openhab\userdata/config/org/openhab/autoupdate.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/chart.config to C:\openhab\userdata/config/org/openhab/chart.config
Replaced string org.eclipse.smarthome.chart to org.openhab.chart in file C:\openhab\userdata/config/org/openhab/chart.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/lsp.config to C:\openhab\userdata/config/org/openhab/lsp.config
Replaced string org.eclipse.smarthome.lsp to org.openhab.lsp in file C:\openhab\userdata/config/org/openhab/lsp.config
Moved C:\openhab\userdata/config/org/eclipse/smarthome/network.config to C:\openhab\userdata/config/org/openhab/network.config
Replaced string org.eclipse.smarthome.network to org.openhab.network in file C:\openhab\userdata/config/org/openhab/network.config
Could not move C:\openhab\userdata/config/org/eclipse/smarthome/rulehli.config to C:\openhab\userdata/config/org/openhab/rulehli.config
Get-Content : Cannot find path 'C:\openhab\userdata\config\org\openhab\rulehli.config' because it does not exist.
At C:\Users\Pezay\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1:218 char:22
+                     (Get-Content $parts[3]).replace($parts[1], $parts ...
+                      ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\openhab\user...\rulehli.config:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Could not replace string org.eclipse.smarthome.rulehli to org.openhab.rulehli in file C:\openhab\userdata/config/org/openhab/rulehli.config
Replaced string org.eclipse.smarthome.core to org.openhab.core in file C:\openhab\userdata/jsondb/automation_rules.json
Replaced string org.eclipse.smarthome to org.openhab.core in file C:\openhab\userdata/jsondb/automation_rules.json
Moved C:\openhab\userdata/jsondb/org.eclipse.smarthome.config.discovery.DiscoveryResult.json to C:\openhab\userdata/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json
Replaced string org.eclipse.smarthome.core to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json
Replaced string org.eclipse.smarthome to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.config.discovery.DiscoveryResult.json
Moved C:\openhab\userdata/jsondb/org.eclipse.smarthome.core.items.Item.json to C:\openhab\userdata/jsondb/org.openhab.core.items.Item.json
Replaced string org.eclipse.smarthome.core to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.items.Item.json
Replaced string org.eclipse.smarthome to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.items.Item.json
Moved C:\openhab\userdata/jsondb/org.eclipse.smarthome.core.items.Metadata.json to C:\openhab\userdata/jsondb/org.openhab.core.items.Metadata.json
Replaced string org.eclipse.smarthome.core to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.items.Metadata.json
Replaced string org.eclipse.smarthome to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.items.Metadata.json
Moved C:\openhab\userdata/jsondb/org.eclipse.smarthome.core.thing.link.ItemChannelLink.json to C:\openhab\userdata/jsondb/org.openhab.core.thing.link.ItemChannelLink.json
Replaced string org.eclipse.smarthome.core to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.thing.link.ItemChannelLink.json
Replaced string org.eclipse.smarthome to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.thing.link.ItemChannelLink.json
Moved C:\openhab\userdata/jsondb/org.eclipse.smarthome.core.thing.Thing.json to C:\openhab\userdata/jsondb/org.openhab.core.thing.Thing.json
Replaced string org.eclipse.smarthome.core to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.thing.Thing.json
Replaced string org.eclipse.smarthome to org.openhab.core in file C:\openhab\userdata/jsondb/org.openhab.core.thing.Thing.json
Deleted C:\openhab\userdata/config/org/openhab/classicui.config
Deleted C:\openhab\userdata/jsondb/org.eclipse.smarthome.core.thing.link.ItemThingLink.json
Deleted C:\openhab\userdata/config/org/eclipse/smarthome
Deleted C:\openhab\userdata/habmin
Could not delete C:\openhab\userdata/etc/com.eclipsesource.jaxrs.connector.cfg
Deleted C:\openhab\userdata/etc/com.eclipsesource.jaxrs.swagger.cfg
Deleted C:\openhab\userdata/config/com/eclipsesource

Performing post-update tasks for version [3.2.0] :
Could not move C:\openhab\userdata/config/org/openhab/io/metrics/MetricsRestController.config to C:\openhab\userdata/config/org/openhab/metrics.config
Get-Content : Cannot find path 'C:\openhab\userdata\config\org\openhab\metrics.config' because it does not exist.
At C:\Users\Pezay\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1:218 char:22
+                     (Get-Content $parts[3]).replace($parts[1], $parts ...
+                      ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\openhab\user...\metrics.config:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Could not replace string org.openhab.io.metrics.MetricsRestController to org.openhab.metrics in file C:\openhab\userdata/config/org/openhab/metrics.config
Deleted C:\openhab\userdata/config/org/openhab/io/metrics

openHAB updated to version 3.2.0!
Run start.bat to launch it.
Check https://www.openhab.org/docs/installation/windows.html
for instructions on re-installing the Windows Service if desired

Your prior distribution is in C:\Users\Pezay\AppData\Local\Temp\openhab\backup-2.5.11

If you look at the log from Powershell it looks like as if it does it also in this case

@T-A,
I think, you don’t get it.
Pezay changed the URL. That’s why it worked.
If you don’t want to change the URL in the script, you can extract the new update.ps1 out of an openhab-3.x.x.zip file, that you downloaded upfront.
These are the two possibilities.
Joerg

Ok, as I saw no reference in the solved comment, I probably draw the wrong conclusion. I have red the whole story again. You are referring to the change to the jFrog download url?