Hey,
I tried to upgrade my openHAB version to 4.1.0 M3 , but the update.bat file always giving me this error. I dont know what to do. Does anyone had this issue?
Looks like you sre trying ti download 4.1.3 instead on 4.1.0.M3?
What command are yoh using to upgrade?
Hey
I just started the update.bat file
I didn’t changed anything because the openHAB is new for me
Take a look at the upgrade instructions for Windows, which is what it looks like you are running.
Depending on what you what to upgrade to you would run something like:
. .\runtime\bin\update.ps1
Update-openHAB -OHVersion 4.1.0.M3
In Powershell.
The above will upgrade you to the latest MILESTONE
The latest STABLE is:
. .\runtime\bin\update.ps1
Update-openHAB -OHVersion 4.0.4
I tried this as well but I got an error
Sorry but you will need to provide more information than that for anyone to be able to help you.
I did notice that your install folder seems to refer to openhab 2.
I follwed the installation as described on the openHAB page. The current version that I use is 4.0.3 I wanted to upgrate my system to 4.1.0 M3 with the update.bat file. I attached the picture from that one in the bigining. I tried with that command that you added and I always get an error for the path has been not founded (I replaced the C: with D: because that is my openhab path). I don’t what is the problem with the update… But if its so difficult maybe I will try another smart home program…
The update process makes use of a ps1 file (not a update.bat). I am not sure where you are finding update.bat? (You are running on Windows I assume?)
As per the link I sent you:
- Run Powershell as administrator
- Change to the openHAB directory
- run the following commands:
. .\runtime\bin\update.ps1
Update-openHAB -OHVersion 4.1.0.M3
Update.bat is a valid file located in the same directory as the powershell file.
It works fine if you open a command prompt with admin and you navigate to the directory that the bat file resides in. then you pass the following command.
update 4.1.0.M3 you then press enter and you will accomplish a update to the version specified.
as a example my openhab lives in a parent folder of c:\hold and is installed in the folder openhab4_1_M3 it could just as easily be D:\hold or d:\openhab or anything you want just insure you are in the working directory have a elevated command prompt and pass the correct version you want to upgrade too.
actually It does not get any easier than that.
c:\hold\openhab4_1_M3\runtime\bin>update 4.1.0.M3
###########################
# openHAB update script #
###########################
Checking whether a service exists
Checking the specified openHAB directory
Using C:\hold\openhab4_1_M3\conf as conf folder
Using C:\hold\openhab4_1_M3\userdata as userdata folder
Using C:\hold\openhab4_1_M3\runtime as runtime folder
Using C:\hold\openhab4_1_M3\addons as addons folder
The current version is 4.0.4
Changing location to C:\hold\openhab4_1_M3
Creating temporary update directory C:\Users\XXXX\AppData\Local\Temp\openhab
Downloading the openHAB 4.1.0.M3 distribution to C:\Users\XXXX\AppData\Local\Temp\openhab\openhab-4.1.0.zip
Downloaded 108184K of 108184K [100%]
Finished Download
Extracting the archive (C:\Users\XXXX\AppData\Local\Temp\openhab\openhab-4.1.0.zip) to C:\Users\XXXX\AppData\Local\Temp\openhab\update
######################################################################################################################################
# New update.ps1 was found - executing it instead (found in C:\Users\XXXX\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1) #
######################################################################################################################################
fyi @Miko_Mark the reason your first attempt failed is because you passed an update request with an invalid version (4.1.3) or no version at all and that is what it told you. It defaulted to the next likely increment of what you had install so it tried to go from 4.0.3 to 4.1.3 based on logic in the script. You can review the script for yourself can clearly see the behavior I mentioned.
Download of 4.1.3 failed because it is not a valid version
there is no version 4.1.3 like you requested so of course it failed to find a 4.1.3.zip file.
the update instructions do tell you this however.
Updating the openHAB Runtime
To start the update process, run PowerShell as an administrator and use the following commands, while replacing x.x.x
with the wanted openHAB version. Assuming you have openHAB installed in C:\openHAB
:
The instructions in the above link do not mention or explain the difference between a snapshot a stable version and a milestone version. Also, they do not cover just using the update.bat file so it is easy to see why you may not have fully understood the directions and that is why your previous attempts failed.
however, the update.bat file with your argument simply passes that over and calls the PowerShell script that was mentioned in other replies.
@ECHO off
SETLOCAL
IF "%1"=="?" GOTO printArgs
IF "%1"=="\?" GOTO printArgs
IF "%1"=="/?" GOTO printArgs
SET uargs=
IF NOT [%1]==[] ( SET uargs=%uargs% -OHVersion %~1% )
CD %~dp0
powershell -ExecutionPolicy Bypass -command "& { . .\update.ps1; Update-openHAB %uargs% }"
SET LEVEL=%ERRORLEVEL%
if %LEVEL% LSS 0 (
PAUSE
EXIT /B %LEVEL%
)
EXIT /B 0
:printArgs
ECHO Usage: update.bat {OHVersion}
ECHO OHVersion (required) - The version you want to update (4.0, 4.1, etc)
ECHO.
ECHO Example to update to openHAB version 4.0.0 stable:
ECHO update.bat 4.0.0
ECHO.
ECHO Example to update to openHAB version 4.0.0 snapshot:
ECHO update.bat 4.0.0-SNAPSHOT
ECHO.
ECHO Example to update to openHAB version 4.0.0 milestone 1:
ECHO update.bat 4.0.0-M1
ECHO.
EXIT /B -1
It is always best to read/review the files you are about to execute on your device so you fully understand the behaviors and what they will do for you to your computer. However even the echo in the bat file was a bit misleading since it requires 4 variables for a milestone separated by periods.
4.1.0.M3 not the"-" dash as it says.
BTW
Welcome to the community!
and the very next line in the instructions under the screenshot says.
“NB: Due to an issue with long file paths sometimes the update script may fail after the ‘Copying files…’ stage. This can be resolved by deleting the c:\openHAB\userdata\tmp folder.”
Did you try that? or what ever you path to those temp folder is D:\xxx\xxx
thanks man, with this I was able to update my system
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.