Announcement

Collapse
No announcement yet.

HomeSeer Backup Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HomeSeer Backup Question

    I have a script that backs up my desktop computer each night. This desktop computer is not where HomeSeer is installed - I have a HomeTroller S6 Pro (Windows 7). However, I wanted to also backup the HomeSeer files/folders. To do this I updated my script to pull the files from the HomeSeer machine over my home network as part of my daily backup process. This is working great. But I'm unclear if these files, because HomeSeer is running at the time they are copied, would be considered a good backup (I haven't had to restore yet). The backup process can take less than a minute up to several minutes depending on if there's already a prior backup that's being updated (changed file are only copied) or if the entire folder and all files need to be captured. So here's my question:

    If HomeSeer application is running when the files are copied over my home network, would that be considered a good backup from which a restore could be applied if needed?

    #2
    We’ve been using Blade’s BLBackup for quite some time and it works very well. Have even restored when changing to a new computer for HS3.

    It’s free, too!

    https://forums.homeseer.com/forum/ul...blbackup-blade


    Michael

    Comment


      #3
      I second BLBackup. It has saved my bacon more times than I care to count. And as Rvtravlr stated above...you can't beat the price. Great contribution by a great developer.
      My home is smarter than your honor roll student.

      Comment


        #4
        Hi guys, thanks for the responses! Turns out I have BLBackup, though haven't used it because it was an easy update to my backup script to add the HomeSeer files (I've used this script for years). Because I backup files from two (2) machines, and because one is mostly off during the day (I run a WOL command to wake it before its backup time), I didn't want the HomeTroller managing the backup process to two machines (if that's even possible?). Without changing my steps and implementation process, I'd like to continue with my current scenario. Which is: I make daily, weekly, monthly and yearly backups (weekly backups on Sundays, monthly/yearly on first of month or year). I keep one year's backup for each category (e.g. monthly has 12 backup copies). After backup, my one machine shuts back down. I not sure I could accomplish this as easy (or at all) with BLBackup. So for the moment, my script is my preferred way, though I'll give that some additional thought to BLBackup.

        This brings me back to my current script grabbing "in-use" files over my home network. Will "in-use" files backup properly?

        From experience (because both machines backup at slightly different times (about 30-45 minutes apart), there are only 5 (five) files which are different between the two machines' backup files:

        ..\Program Files\HomeSeer HS3\Config\powerfail.ini
        > This contains a single "last_event_time" entry (e.g. 2019-1-29-23-35-0)
        ..\Program Files\HomeSeer HS3\Config\powerfail.ini.bak
        > Backup file containing the same single "last_event_time" entry (e.g. 2019-1-30-0-9-0)

        The last 3 are database files which concern me the most. These are the "in-use" files which may or may not be valid with home I'm performing backups. And I'm not really sure how BLBackup deals with these as well. Does it shutdown HomeSeer during backup or does it perform like I'm doing and grab them at runtime while "in-use"? Here are the database files:

        ..\Program Files\HomeSeer HS3\Data\ultralog3\ultralog3.db3
        ..\Program Files\HomeSeer HS3\Data\ultralog3\ultralog3_syslog.db3
        ..\Program Files\HomeSeer HS3\Data\HomeSeerData.hsd

        That's the reason for the initial post if anyone can confirm how a simple backup, or how BLBackup, treats "in-use" files - maybe Blade can chime in?

        Again, thanks for reading and I appreciate the thoughts and suggestions!

        Comment


          #5
          Isn't the database file (one of the main ones you want to backup) locked and unusable while HomeSeer is running? I'm pretty sure that I tried it with HS2 and the copy was locked.
          I use BLBackup with HS3 and so far it has done well, and has saved me twice so far.

          Comment


            #6
            Originally posted by joegr View Post
            Isn't the database file (one of the main ones you want to backup) locked and unusable while HomeSeer is running? I'm pretty sure that I tried it with HS2 and the copy was locked.
            I use BLBackup with HS3 and so far it has done well, and has saved me twice so far.
            Yes, as I understand it, the log file is one of the main files needed. Which is what concerns me. After running my backups for over a year, I don't want to have the need to restore only to find my backups are not valid. I'll give some thought around BLBackup, but my initial question still stands if anyone is able to answer it:

            Are the copied files valid if HomeSeer is running when copied?

            If they are valid, then I'll continue with my script process. Otherwise, I may look into BLBackup a bit more. But I'm hoping someone knows the answer to this question.

            Comment


              #7
              I would like to know the answer to that too. Meanwhile, could you use BLBackup to make a backup to a local directory, then use your process to backup that backup?

              Comment


                #8
                Originally posted by NetworkGuy View Post

                Yes, as I understand it, the log file is one of the main files needed. Which is what concerns me. After running my backups for over a year, I don't want to have the need to restore only to find my backups are not valid. I'll give some thought around BLBackup, but my initial question still stands if anyone is able to answer it:

                Are the copied files valid if HomeSeer is running when copied?

                If they are valid, then I'll continue with my script process. Otherwise, I may look into BLBackup a bit more. But I'm hoping someone knows the answer to this question.
                The log file is not important. If it gets corrupted, just delete it and HS will create a new one. All you lose is the history in the log file. The important file is the HomeSeerData.hsd file in the Data folder. It's the one with all the devices and events. HS does create a backup when you restart it, but if you haven't restarted in a long time, you could lose a lot of changes. There's risk with backing up that file as HS continually writes to it. Ideally you shut down HS and then copy the whole directory structure. I don't know if BLBackup does anything with the database files specifically or just copies the files and the same risk of an invalid database file exists. Having said all that, I have recovered from backup a few times in the past and never had an issue with a file that was corrupted.
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment


                  #9
                  Originally posted by sparkman View Post

                  The log file is not important. If it gets corrupted, just delete it and HS will create a new one. All you lose is the history in the log file. The important file is the HomeSeerData.hsd file in the Data folder. It's the one with all the devices and events. HS does create a backup when you restart it, but if you haven't restarted in a long time, you could lose a lot of changes. There's risk with backing up that file as HS continually writes to it. Ideally you shut down HS and then copy the whole directory structure. I don't know if BLBackup does anything with the database files specifically or just copies the files and the same risk of an invalid database file exists. Having said all that, I have recovered from backup a few times in the past and never had an issue with a file that was corrupted.
                  Thanks sparkman, that's helpful! I had an event to restart my machine on Sunday mornings at 3 am using BLShutdown, but it was disabled. I enabled it and will pay attention to my *.hsd files. I don't make a lot of changes at this time to my system, and try to document when I do make them, and this is helpful to think about! I currently have 10 of the *.hsd files with the second most recent from January 11th. Probably didn't make many changes since then, but I'd rather lose at most a week's worth of changes rather than more.

                  When I manually ran BLBackup, the entire process took just 32 seconds, so I don't think BLBackup is killing HomeSeer either. I may take a look at BLShutdown for my backup process, but I think the restart will help for now so I get a more recent *.hsd file backup. I may also give a little thought around creating a scheduled task that can shutdown HomeSeer, backup the files locally, then restart HomeSeer so it can happen quickly. If I use BLShutdown to turn off HomeSeer, I don't know what my trigger would be to run a backup script since HomeSeer would not be running to kick on an event. And timing and execution triggering with a scheduled task I'm a little unclear about since, again, HomeSeer would not be running to kick off a script. But that's not high on my plate right now. Something for another day. :-)

                  Again, thanks for the great information!

                  Dave

                  Comment


                    #10
                    I'm on Linux, Once a week or after significant changes. I backup z-wave, shut down HS3. Recursively tar the entire HomeSeer directory, copy the tar file to my pc. I then reboot the Linux box.
                    HS3 SEL running Pro Edition 3.0.0.531 on Ubuntu 18.04, mono 5.20, 656 devices, 209 events.
                    Plug-Ins: Chromecast, Device History, EasyTrigger, Ecobee, JowiHue, LutronCaseta, MeiUnifi, PHLocation2, Pushover 3P, SDJ-Health, Sonos, WeatherFlow, weatherXML
                    Scripts: SparkMan's Lock Event, 5 of Jon00 scripts.

                    Comment


                      #11
                      Originally posted by drparker151 View Post
                      I'm on Linux, Once a week or after significant changes. I backup z-wave, shut down HS3. Recursively tar the entire HomeSeer directory, copy the tar file to my pc. I then reboot the Linux box.
                      I backup my Z-Wave settings early Saturday morning, and my entire HomeSeer folder every day. I reboot only occasionally. The backup works fined, but I get that nagging feeling about restoring .

                      Comment


                        #12
                        In Windows, the only method to copy a file in use is to use its volume shadow copy service. Most commercial software backup software use this when making daily backups. I very much doubt BLBackup uses this as the plugin is both Windows & Linux compatible.
                        Jon

                        Comment


                          #13
                          sqlite does have a backup API but have not looked into it myself. https://www.sqlite.org/backup.html

                          While I too use BLBackup, 15 minutes before it runs, I have an export event which runs hs.SaveEventsDevices and after a 5 minute delay I run Jon's Event Viewer via curl to get a text version of my events which is stored in HS's html directory ready for BLBackup to save.

                          Now, if I can only find a way to schedule the execution of the "export events" button under Tools -> Setup -> Labs !!!!! I do this about once a month when I remember.

                          Click image for larger version

Name:	Capture.PNG
Views:	172
Size:	231.8 KB
ID:	1281177
                          Len


                          HomeSeer Version: HS3 Pro Edition 3.0.0.435
                          Linux version: Linux homeseer Ubuntu 16.04 x86_64
                          Number of Devices: 633
                          Number of Events: 773

                          Enabled Plug-Ins
                          2.0.54.0: BLBackup
                          2.0.40.0: BLLAN
                          3.0.0.48: EasyTrigger
                          30.0.0.36: RFXCOM
                          3.0.6.2: SDJ-Health
                          3.0.0.87: weatherXML
                          3.0.1.190: Z-Wave

                          Comment


                            #14
                            Originally posted by jon00 View Post
                            In Windows, the only method to copy a file in use is to use its volume shadow copy service. Most commercial software backup software use this when making daily backups. I very much doubt BLBackup uses this as the plugin is both Windows & Linux compatible.
                            Looks like that only works if you have an NTFS file system.
                            HS 4.2.8.0: 2134 Devices 1252 Events
                            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                            Comment


                              #15
                              Looks like one can execute hs.BackupDB just before doing a backup. BackupDB will close the currently active HomeSeer configuration database and will make a backup copy. This is now stored in HS's Data directory. These are named HomeSeerData_##.hsd, where ## is a number. ## is not sequential either so you need to restore based on time stamp.

                              More details at http://help.homeseer.com/help/HS3/st...puter_backupdb
                              Len


                              HomeSeer Version: HS3 Pro Edition 3.0.0.435
                              Linux version: Linux homeseer Ubuntu 16.04 x86_64
                              Number of Devices: 633
                              Number of Events: 773

                              Enabled Plug-Ins
                              2.0.54.0: BLBackup
                              2.0.40.0: BLLAN
                              3.0.0.48: EasyTrigger
                              30.0.0.36: RFXCOM
                              3.0.6.2: SDJ-Health
                              3.0.0.87: weatherXML
                              3.0.1.190: Z-Wave

                              Comment

                              Working...
                              X