openhab / openhab-syno-spk

openHAB Synology SPK Install Package
Eclipse Public License 2.0
161 stars 42 forks source link

How to update openhab2 on synology diskstation #146

Closed abraunisch closed 5 years ago

abraunisch commented 5 years ago

Hello,

i would like to be update my openhab 2.3.0.005. to a newer version. As far as I understand there doesn't exits any update-function at this moment :-(

Therefore, I would like to ask the following questions:

  1. when will there be something like that?
  2. is ther anywhere a simple documentation how can i update openhab manualy and (very important) successfully without any errors? I search for some inforamtion but cant't find a save approach

Thanks for your help, Andreas

jaywiseman1971 commented 5 years ago

I'm also running OH on Synology and I'm at the original version 2.3.0.001 and I would like to be update my openhab to the 2.4 version also. I see the main owner released 2.4 SPK but I'm a bit scared to jump to it manually vs. following some sort of steps, please . . .

I have many "add-ons" at level 2.4 and 2.5 already including the zWave one which is a big change; so I think my upgrade won't be so bad once I can follow the instructions.

Thanks again for all your work on this; jumped into OH in June 2018 and I've been obsessed with it ever since.

Best, Jay

cniweb commented 5 years ago

Hi, a automatic update is not implementet, at the moment. But you can use the manuel update mechanism from OH himself. See OH docs: https://www.openhab.org/docs/installation/linux.html#backup-and-restore

frest-de commented 5 years ago

The Backup/Restore script does not work with synology. The package "unzip" is missing. But even after installing unzip (entware/ipkg) and editing the restore script it seems to be working, no error, but the openhab installation does not work any more.

I backuped the folder /volume1/@appstore/openHAB before.

cniweb commented 5 years ago

@frest-de can you post your adjustments? You're right, because unzip package is missing. That would have to be a prerequisite if the package is to be an update.

frest-de commented 5 years ago

I just installed unzip on my synology using entware-ng an changed the path to unzip in the restore script. The script runs without any errors after that. Resoring OpenHAB does not work anyway.

jaywiseman1971 commented 5 years ago

I think Synology replaced unzip with 7z. Here are 2 threads talking about it.

https://github.com/ncw/rclone/issues/1949 https://portal2portal.blogspot.com/2017/01/synology-nas-wheres-my-unzip-command.html

I personally haven't tried it but I'm watching this thread because I do want to upgrade my Synology OH to 2.4 also.

Best, Jay

frest-de commented 5 years ago

correct, you could replace unzip with 7zip in the script as well.

petermorlion commented 5 years ago

The openHAB documentation about backup and restore isn't about updating. But I found I can just follow the installation instructions with a newer package after I have backed up my files.

Incidentally, the backup script seems to have worked fine on my Synology. It's the restore script that's giving me troubles. Does anyone have the correct 7zip command line to get it working?

If we want to make this easier, what kind of help would you need? I'm no openHAB or Linux expert, but I am a software developer, so I know my way around at least a bit.

petermorlion commented 5 years ago

Found the correct 7zip command. In the restore script replace line 21, change:

command -v unzip >/dev/null 2>&1 || {

to

command -v 7z >/dev/null 2>&1 || {

You could also change the error message two lines lower.

Then, at line 82, change

unzip -oq $"InputFile" -d "$TempDir" || {

to

7z x "$InputFile" -o"TempDir" -y || {

(there is no space between the -o and the "TempDir"!

cniweb commented 5 years ago

@petermorlion can you build a script for this change? Then I can integrate it on the update mechanism for sinology update process. Thanks!

petermorlion commented 5 years ago

I created PR #150

cniweb commented 5 years ago

@petermorlion Thanks for you PR! I will try to use the script with the update.

cniweb commented 5 years ago

In Version 2.4.0.002