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

Backups should record userdata and runtime location #1145

Open
BClark09 opened this issue Sep 17, 2020 · 1 comment
Open

Backups should record userdata and runtime location #1145

BClark09 opened this issue Sep 17, 2020 · 1 comment

Comments

@BClark09
Copy link
Member

BClark09 commented Sep 17, 2020

The runtime creates a few files that have hardcoded paths in $OPENHAB_USERDATA. If these are backed up on one machine and restored on another then these paths may be incorrect.

If we can't change these to paths to references, we should store the paths in the backup folder so that the restore scripts can do a find and replace to the new path on those hardcoded files.

On Linux/Mac OS, I assume that the restore commands would looks similar to:

find ${OPENHAB_USERDATA}/config/ -type f -name "*.config" -exec sed -i'.bak' "s|${OLD_USERDATA}/|${OPENHAB_USERDATA}/|g" {} \;
find ${OPENHAB_USERDATA}/config/ -type f -name "*.config" -exec sed -i'.bak' "s|${OLD_RUNTIME}/|${OPENHAB_RUNTIME}/|g" {} \;

This needed to be done (openhab/openhab-linuxpkg#181 (comment)) when the linuxpkg file paths moved from **/openhab2/ to **/openhab/:

I will try to get a PR through if I get the time but don't think I'll be able to do something about the Windows script.

@wborn
Copy link
Member

wborn commented Sep 20, 2020

I'm here to comment that this also relates to #860. 😉

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

2 participants