Announcement

Collapse
No announcement yet.

Backup strategies

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

    #16
    Originally posted by jordonmusser View Post
    Could you not run a windows task schedule where it shuts down HS4, copies the whole directory and then restarts HS4?
    You could do that, but it's the Windows initiated shutdown that appears to be causing at least some of the corruption.
    "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

    Comment


      #17
      In my case I make read-only copies of all the config/data folders that are used by HS and the plugin each day onto a USB flash drive. It protects HS-related data that I am concerned about for the first level. My premise is that I can restore executables from what the supplier provides via internet if I have a more significant failure than just loss of my setup data.

      Where this approach is limited is that database data, which will usually be on a different computer, (InfluxDB, mySQL, etc) is not covered and needs to be managed independently.

      Comment


        #18
        Originally posted by Michael McSharry View Post
        In my case I make read-only copies of all the config/data folders that are used by HS and the plugin each day onto a USB flash drive. It protects HS-related data that I am concerned about for the first level. My premise is that I can restore executables from what the supplier provides via internet if I have a more significant failure than just loss of my setup data.

        Where this approach is limited is that database data, which will usually be on a different computer, (InfluxDB, mySQL, etc) is not covered and needs to be managed independently.
        For Influxdb running on linux, I use the influxd backup command in a cron job to backup to a network drive (NAS).

        I'm still using 1.8 so this page applies: https://docs.influxdata.com/influxdb...p_and_restore/
        "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

        Comment


          #19
          Originally posted by randy View Post
          Backup! Backup! Backup!

          There are so many things that can render your HomeSeer system non-functional, a thorough backup routine is imperative. In my system there are several thousand Devices and 1600+ Events. There is no way in the world I would want to build it again from scratch. In nearly 10 years of HS3/HS4 usage I have never had an unrecoverable failure. Take a look at the assumptions \below and come up with your own plan.

          All of this is from a Windows O/S perspective, but much would apply to Linux versions as well.

          My Backup plan consists of:
          • A full HomeSeer directory backup to a local NAS using the BLBackup plug-in, taken at 1:00AM and 1:00PM each day. I retain 60 copies. The NAS is in a different physical location in the house from the rest of my servers and network devices.
          • A full metal backup of the HS server using Macirum Reflect. This stores a full image of the system once a month plus differential copies on Mondays and incremental copies each day. These are also stored on the NAS..
          • Before I install any plug-in or new HomeSeer version, I shut down HomeSeer and take a copy of the HomeSeer directory structure, placing it on the server desktop. This gives me working copy to roll back to in the event an update has an issue..
          • I don't worry about offsite backups for HomeSeer, since a catastrophic event (fire, flood) in my house would likely make HomeSeer useless.

          There a number of things to be considered and understood:
          • HomeSeer is all contained within a single directory structure. This directory structure is portable in that it contains a fully functional HS implementation
          • This directory structure can be copied to another Windows computer and will run without issue as long as the OS (64 or 32 bit) and file placements are similar.
          • The built in backup utility only backs up 4 of the folders in this directory. It does backup data, config, scripts and HTML directories, it does not copy HomeSeer or plug-ins. To restore using these backups, you must first install HomeSeer and all plug-ins before restoring these files. The HS data files will backup, but many plug-ins use various database files. Those will be in use and will not backup with the built-in utility.
          There are some backup utilities available as a plug-in. I use Blades BLBackup with a twice a day backup and 30 days of retention. If space is a premium, Blade's backup can be put in compressed files. It suffers from the same problems as the built-in as it relates to 3rd party database files.

          There are a number of PC based backup programs. Many of these utilize MS Shadow Copy features and can take a snapshot of the drive prior to backup. This snapshot will capture even 3rd party databases that are in use. I chose Macirum Reflect years ago and stick with it. It can do a full metal restore of the server from a networked backup by booting off a thumb drive. This has saved me once when I had an SSD fail on my HS server. It only took replacement of the SSD and about an hour to get my system back to where it was at the last backup. There are many other choices, but a full metal backup ought be in place for anyone who counts on HS to be running. .

          In the HomeSeer data directory you will find the HS database files.

          For HS3 it was stored in a single SQLite database with an .hsd extension. Along with the primary data file, there will be 10 or more copies stored with _xx appended to the filename. This file is backed up in this fashion each time HS3 is started. Note: the number appended to each file is not sequential. As you can see in the screenshot below, _21 is the newest file and _23 is the oldest. You must pay attention to the timestamps if you want to restore from one of these backups. This one database contains all Devices, Events, Counters and Timers.

          Click image for larger version Name:	capture5.png Views:	34 Size:	94.8 KB ID:	1587283

          For HS4 the database files are JSON backups all stored in a single directory under the \HomeSeer HSx\Data directory. There are 5 JSON files and 5 backup files. Their names explain what is stored in each file. These files contain every Device, Event, Timer and Counter, but each group in their own file. .

          Click image for larger version Name:	capture1.png Views:	33 Size:	47.2 KB ID:	1587280


          Z-Wave

          Again some concepts are important.
          • The Z-Wave Node Information is all stored within the interface's flash memory.
          • A Backup of each interface is created each time a Node is included and Excluded. With multiple interfaces, each interface has its own backup. These backups are stored in the \HomeSeer HSx\Data\Z-Wave directory.
          • A new or existing interface can be overwritten with the backup and restored to a fully functional Z-Wave network.
          • Z-Wave interfaces each have a unique HomeID. The devices are written with this HomeID when they are included.
          • HomeSeer addresses each Z-Wave device by its HomeID and Node number. Each Z-Wave device communicates with the Interface bearing the correct HomeID and the interface communicates with HomeSeer devices through the HomeID and Node number.
          • A manual backup can be initiated from the plug-in menus for each interface.
          • A manual Restore can be initiated from the plug-in menus.
            • When a controller is restored it is first erased, then it is restored from the backup. The restored interface will then have the HomeID of the backup
            • You cannot have two interfaces with the same HomeID on the same system. If you restore a new controller from a backup, the old controller must be completely offline
            • Some interfaces do not support backup and/or restore operation
          • HomeSeer and the interfaces must be in sync. If you restore an Interface from an earlier backup there may not be a node in the controller for a device that exists in HomeSeer. If you restore from an older copy of HomeSeer, there may be Nodes in an interface but no corresponding HomeSeer device.
          • When you backup the \HomeSeer HSx\Data directory, you are also backing up the Z-Wave backups.

          The Z-Wave backups are stored in the \HomeSeer HSx\Dat\Z-Wave directory and a pair of files are created for each interface.

          Click image for larger version Name:	capture3.png Views:	35 Size:	74.3 KB ID:	1587282

          Each HS Device references the HomeID and Node of the controller.

          Click image for larger version Name:	capture4.png Views:	33 Size:	17.5 KB ID:	1587281
          Randy, thanks for the explanation but I think something else is happening in the background that it does not seems right. I also posted in another threat the issue I'm having. I used BLBackup for many years and it always worked like a charm. Now when I restore from one of the backups, most of the devices disappears, I have the latest HS installation. After restarting HS, in the homeseerdata_2.json I get from 17,772 KB devices.json to only few. Something is locking these files and I'm not sure how. I'm trying different solutions but nothing works. On a small note, why HS decided to so a partial backup and not all the directory, it does not make sense. Do you imagine installing all the plugins, and etc.

          Comment


            #20
            this is what is causing the issue.
            Attached Files

            Comment


              #21
              Before any changes, I manually backup the entire HS3 directory. If I make an error in any changes around devices or events, what is the minimum files and/or directories that I would need to recover? At the moment, I recover the entire directory which is overkill

              Cheers,
              Scott

              Comment


                #22
                I've tried a couple of times to wrap my head around BLBackup but was never able to get it to make a backup? Should I ask questions here or in the BLBackup sub-forum?
                waplus
                ​projectfreetv.onl

                Comment

                Working...
                X