Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 4.X.X from 3.X.X failed on Windows (and non-working backup) #1586

Open
yndtrud opened this issue Sep 6, 2023 · 0 comments
Open

Comments

@yndtrud
Copy link

yndtrud commented Sep 6, 2023

In update.ps1 you added a call to updatetool.jar and it doesn't work.
Tested in different configurations (3.x.x to 4.x.x or 4.x.x to 4.x.x or production/clean/debug).
The try/catch block fires when the java -jar "$OHRuntime\bin\upgradetool.jar" is called.

`
Java home: c:\Program Files\Java\zulu-jdk-17.44.15-ca-jdk17.0.8-win_x64
openjdk version "17.0.8" 2023-07-18 LTS OpenJDK Runtime Environment Zulu17.44+15-CA (build 17.0.8+7-LTS) OpenJDK 64-Bit Server VM Zulu17.44+15-CA (build 17.0.8+7-LTS, mixed mode, sharing)

###########################

openHAB update script

###########################

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

##########################################################################################################################################

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

##########################################################################################################################################

###########################

openHAB update script

###########################

Checking whether a service exists
Checking the specified openHAB directory
Using D:\servers\openhab\conf as conf folder
Using D:\servers\openhab\userdata as userdata folder
Using D:\servers\openhab\runtime as runtime folder
Using D:\servers\openhab\addons as addons folder
The current version is 3.4.5
Changing location to D:\servers\openhab
Upgrading to version 4.0.1

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

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

Important notes for version [4.0.0] :
Warning: CORE: core.GenericEventTrigger and core.GenericEventCondition parameters have have changed. See https://www.openhab.org/docs/configuration/rules-ng.html#system-module-types.
Warning: CORE: Rules are now triggered by ItemStateUpdatedEvent instead of ItemStateEvent. If you use JSR223 scripting without helper libraries and expect a certain Java type, code changes might be needed.
Warning: CORE: The syntax for an item category/icon in a textual configuration file no longer accepts a value enclosed in quotes. So is valid but not <"temperature">. Please update the definition of your items if necessary.
Warning: CORE: SCRIPT transformation has been removed and replaced with language-specific transformations: JS, RB, PY, DSL, GROOVY, etc. See https://www.openhab.org/docs/configuration/transformations.html#script-transformation
Warning: CORE: UoM has been refactored. Please consult https://www.openhab.org/docs/concepts/units-of-measurement.html and https://www.openhab.org/docs/installation/#upgrading BEFORE starting openHAB, otherwise your persisted data may be corrupted.
Warning: Airthings Binding: The channels radon_st_avg and radon_lt_avg are now of dimension RadiationSpecificActivity instead of Density. Please update your linked items accordingly.
Warning: Bosch Indego Binding: Due to changes in the cloud services, the authentication method has changed. Please follow the authorization flow described in the documentation. Furthermore, a bridge is now required and must be assigned to the indego thing. Configuration of username and password is no longer required/supported.
Warning: ComfoAir Binding: The channel enthalpy#enthalpyTime now represents the set time (in minutes) instead of the internal number value that is sent to the device (minutes / 12).
Warning: DanfossAirUnit Binding: The deprecated channel 'manual_fan_speed' has been removed. Please use channel 'manual_fan_step' introduced in 3.2.
Warning: Dark Sky Binding: Due to EOL of their API, this add-on has been removed.
Warning: Generac MobileLink Binding: Due to an API change, existing Generator Things will need to be deleted and added again. Additionally, existing Items will need to be adjusted to reflect the updated Generator Thing channels.
Warning: HomeKit: Add-on wide configuration of mappings for thermostat modes is no longer supported. Please use item-level configuration as described in the README.
Warning: Hue emulation: The uniqueid value has been changed to resolve discovery issues with Alexa. You may need to rediscover "devices" in all services that use the hue emulation (Amazon Echo, Logitech Harmony, etc).
Warning: Hunter Douglas (Luxaflex) PowerView Binding: Deprecated scene channels have been removed. Please use the scene channels introduced in 3.2 (in channel group 'scenes').
Warning: JavaScript: JavaScript engines have changed their MIME types: NashornJS is application/javascript:version=ECMAScript-5.1 and GraalJS is application/javascript. Please update your scripts to either make them compatible with GraalJS or change the MIME type to continue to use NashornJS. For Blockly migration, visit the Blockly documentation.
Warning: JavaScript NashornJS: NashornJS has been removed from core and isn't included by default. If you still need or want to use it, you can install it as an addon.
Warning: JavaScript Scripting Automation: The old "metadata" and "itemchannellink" APIs have been replaced by a new API with extended functionality on the "items" namespace.
Warning: JavaScript Scripting Automation: ItemHistory: historicState, maximumBetween, maximumSince, minimumBetween, minimumSince & previousState now return a HistoricItem instead of just the state. previousStateTimestamp has been removed, the timestamp is available on the HistoricItem.
Warning: KNX Binding: Units of Measurements have been introduced, make sure you use correct units in the state description. Rules may need to be adapted. Several items changed from PercentType to QuantityType, i.e. raw values increase by a factor of 100.
Warning: LuftdatenInfo Binding: The binding was renamed to Sensor.Community Binding to match the new naming of the service. Things need to be recreated.
Warning: Netatmo Binding: Due to API authorization process change scheduled on the 2023/04/17 - refresh Token is no more stored in thing configuration, thus can be removed from things config files. If it remains, it'll be ignored.
Warning: Netatmo Binding: New scope has been added for the introduction of the Carbon Monoxide Alarm. Authorization process has to be replayed (and former refreshToken can be removed from things config files -- see above).
Warning: Windcentrale Binding: The binding has been reworked to support the new API that requires authentication. Delete old 'mill' Things, add an 'account' Bridge and add new 'windmill' Things using the 'account' as Bridge. The channel names now follow the naming conventions. Items must be adapted for these changes.
Okay to Continue? [y/N]: y

Execute 'PRE' instructions for version 4.0.1
No 'PRE' instructions found for version 4.0.1

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

Execute 'POST' instructions for version 4.0.1

Performing post-update tasks for version [4.0.0] :
Replaced string ,javascript to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string javascript, to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string javascript to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string ,cometvisu-php to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string cometvisu-php, to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string cometvisu-php to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string ,innogysmarthome to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string innogysmarthome, to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string innogysmarthome to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string ,imperihome to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string imperihome, to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string imperihome to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string ,darksky to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string darksky, to in file D:\servers\openhab\userdata/config/org/openhab/addons.config
Replaced string darksky to in file D:\servers\openhab\userdata/config/org/openhab/addons.config

Starting JSON database update...
###############################################################################################

Restoring your distribution from C:\Users\OhUsr666\AppData\Local\Temp\openhab\backup-3.4.5

###############################################################################################
Removing existing files in D:\servers\openhab
Copying backup files from C:\Users\OhUsr666\AppData\Local\Temp\openhab\backup-3.4.5\home to D:\servers\openhab
Removing the directory D:\servers\openhab\conf
Copying backup directory C:\Users\OhUsr666\AppData\Local\Temp\openhab\backup-3.4.5\conf to D:\servers\openhab\conf
Restoration was unsuccessful - you may want to restore from C:\Users\OhUsr666\AppData\Local\Temp\openhab\backup-3.4.5 yourself
Update-openHAB : Cannot find path 'C:\Users\OhUsr666\AppData\Local\Temp\openhab\backup-3.4.5\conf' because it does not exist.
At D:\servers\openhab\runtime\bin\update.ps1:584 char:22

  • ... exit Update-openHAB -OHDirectory $OHDirectory -OHVersion $OHVe ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Update-openHAB

Your prior distribution is in C:\Users\OhUsr666\AppData\Local\Temp\openhab\backup-3.4.5
Should it be deleted? [y/N]: y
Removing temporary distribution backup C:\Users\OhUsr666\AppData\Local\Temp\openhab\backup-3.4.5
Removing temporary directory C:\Users\OhUsr666\AppData\Local\Temp\openhab
Setting location back to D:\servers\openhab\runtime\bin
Press any key to continue . . .
`

Test run
D:\servers\openhab.scripts>java -jar "d:\servers\openhab\runtime\bin\upgradetool.jar" --dir "d:\servers\openhab\userdata" [main] INFO org.openhab.core.tools.internal.Upgrader - Copying item unit from state description to metadata in database 'd:\servers\openhab\userdata\jsondb\org.openhab.core.items.Item.json' [main] INFO org.openhab.core.tools.internal.Upgrader - Upgrading JS profile configuration in database 'd:\servers\openhab\userdata\jsondb\org.openhab.core.thing.link.ItemChannelLink.json'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant