-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
have restore script migrate OH2 config to OH3 #1199
Conversation
Signed-off-by: Markus Storm <markus.storm@gmx.net>
Signed-off-by: Markus Storm <markus.storm@gmx.net>
…sedly) final destination Signed-off-by: Markus Storm <markus.storm@gmx.net>
@@ -1,5 +1,109 @@ | |||
#!/bin/sh | |||
|
|||
# taken from postinst script | |||
|
|||
getVersionNumber(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth moving these functions to a shared file and sourcing it? That way, changes made to functions only need to be made once and all you have to do in this script is provide previousVersion and currentVersion parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly so but the origin is the postinst file from openhab-linuxpkg so that should be changed in the same go to use the same shared files. But as that's in another repo I was unsure how to handle that best as I'm new to all the code in these repos. Would you mind to consider this a proof of concept (code worked in my test) and take the ball from here before I hack&slay around too much?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ben is that ok can I leave that "outsourcing" to you ? You're way more familiar with the dependencies.
I allowed for maintainer edits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be able to create a PR this week but I cannot edit this branch as I am not a maintainer of openhab-distro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I have ever been thinking you are that's why I kept poking at you :) Sorry!
Yes if you could make that a PR I'd be glad. I don't want to screw things up while we're rushing up on the finishing line.
@@ -12,6 +116,13 @@ setup(){ | |||
exit 0 | |||
fi | |||
|
|||
# change file locations to read defaults from based on installed version | |||
# according to dpkg only either "openhab" or "openhab2" packages are installed | |||
ohPkgName=openhab2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You won't need to check for this, the master branch is for OH3, the 2.5.X branch is for OH2. So this will really only be "openhab"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure? I don't think so. I have migrated to OH3 (the "proper" way this time) and the "backup" and "restore" scripts both are located in the OH3 location.
/usr/share/openhab(not "2")/runtime/bin/ BUT they still source the env variables from /etc/profile.d/openhab2.sh so ultimately backup the OH2 installation not my OH3 one
That's why I also opened #1190
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure?
The files that you are editing now get added to a zip file ready for use, at the moment they still contain old paths which is the issue in #1190.
linuxpkg takes that zip and puts the files in the correct locations, it is not aware of the contents of these files and does not change them, so the issue of having outdated references is propagated to the apt install.
The 2.5.x branch in openhab-linuxpkg uses the zip file created by the 2.5.x branch of openhab-distro.
The master branch in openhab-linuxpkg uses the zip file created by the master branch of openhab-distro, this is the up-to-date build for openHAB 3
Superseded |
Relates: #1192
Signed-off-by: Markus Storm markus.storm@gmx.net