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

have restore script migrate OH2 config to OH3 #1199

Closed
wants to merge 3 commits into from
Closed

have restore script migrate OH2 config to OH3 #1199

wants to merge 3 commits into from

Conversation

mstormi
Copy link
Contributor

@mstormi mstormi commented Dec 3, 2020

Relates: #1192

Signed-off-by: Markus Storm markus.storm@gmx.net

Signed-off-by: Markus Storm <markus.storm@gmx.net>
@mstormi mstormi marked this pull request as draft December 3, 2020 18:51
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(){
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

@mstormi mstormi Dec 6, 2020

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

Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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"

Copy link
Contributor Author

@mstormi mstormi Dec 6, 2020

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

Copy link
Member

@BClark09 BClark09 Dec 8, 2020

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

@mstormi
Copy link
Contributor Author

mstormi commented Jan 4, 2021

Superseded

@mstormi mstormi closed this Jan 4, 2021
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

Successfully merging this pull request may close these issues.

2 participants