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
Add backup/restore scripts #499
Comments
I'm not aware of anything existing for backup and restore on Windows. |
Another thought, backups should be platform independent. It should be perfectly reasonable for a user to move their windows installation to a Linux server, or visa versa. For this reason, we should use zip. Some methods of compressing with zip will remove previous file ownership. I'd suggest using a file inside the backup to determine a couple of things so that they can be restored later: backup.properties
Secondly, if no path is specified where should the zip file be stored? For manual installations this can be |
@whopperg, I'm happy to do it for linux/mac if you've not got the time and if it's okay with you. I'll start on the weekend. |
Hey! Good idea. I will not be of much help with the project but will try to annoy all of you with comments as good as I can ;) Regarding the backup location: Hmmm I'd say So yeah. Wdyt about |
/var/backups is specific to debian I think. I'd prefer "/home/backups" but I think it shouldn't matter too much if we make it clear where to define the default path ( Another option is using "/var/lib/openhab2/backup", but not including that folder in the actual backup. i.e: if [ "$OPENHAB_BACKUP" -eq "$OPENHAB_USERDATA/backup"]; then
[...]
fi |
that might be but what gives. We can simply create the backups folder on other OSs. The answer you linked to suggests "you could put them in /backups, or even /home/backups" which both are very bad choices in my eye. Noone should start to mess up the root folder and home should stay restricted to user accounts. Before we mess around in these areas ask yourself this: who will be mad at us for creating /var/backups? |
Okay I've read up on the meaning of "/var/backups is reserved". It may not be the best solution after all. |
@BClark09: Please do so! Feel free to use what ever you can / need from the script! |
Thanks @whopperg, I'll have a go this evening. @ThomDietrich, FHS 3.0 defiantly points to /var/lib/openhab2/backups being the most appropriate directory to use, and to me having it under where every other "user-initiated" file is makes sense. It shouldn't be too hard to stop backups appearing in the backups. You'd know openHAB's Linux users best though, any other suggestions as which to use? |
Yesterday I was answering from the phone. After reading though quite a few recommendations and checking with other applications just now, I'm convinced of |
@ghys Agreed, stick with PS. Are OPENHAB_CONF and OPENHAB_USERDATA new environment variables that get set? |
I'm partial to always avoid invoking blocking dialogs and other GUI in command line scripts. Those scripts could be called from another one without user interaction - or from a PS remoting session, Windows Core Edition etc. |
Need tester for backup script. Hoping to have restore script done tonight. |
@bdleedy I'm a windows user and still on the migration of 1.8.3 to OH2.x but willing to play aroung with your script. Please tell me what/how to test and what kind of feedback do you need? Any specific test cases to run? Any pre-conditions required? |
update.ps1 and backup.ps1 should be in \runtime\bin. Open powershell as admin, cd to the root of your OH install. run ". .\runtime\bin\update.ps1" then "update-openhab" |
This is available by now. |
Continuing on from #299...
Separate files that backup and restore the openHAB configuration should be made. Users should be able to specify a file for the archive to be created/extracted depending on the script.
General
../../
).[openHAB]/backups
.userdata/cache
,userdata/tmp
and any of the following files:/userdata/etc/all.policy
userdata/etc/branding.properties
userdata/etc/branding-ssh.properties
userdata/etc/config.properties
userdata/etc/custom.properties
userdata/etc/version.properties
userdata/etc/distribution.info
userdata/etc/jre.properties
userdata/etc/profile.cfg
userdata/etc/startup.properties
userdata/etc/org.apache.karaf*
userdata/etc/org.ops4j.pax.url.mvn.cfg
Specific to Linux/Mac OS
backup
andrestore
with no extension and executable rights set (755).@whopperg, you have already done most of this, care to finish it off and send a PR?
Specific to Windows
backup.bat
andrestore.bat
, there should be no need to use powershell here.@bdleedy and @ghys, I'm not sure if anything exists here yet, care to take a look?
The text was updated successfully, but these errors were encountered: