How to create automatic backups of hub database

I know z-wave devices are saved on the USB stick but, are the zigbee devices saved on the USB or in the hub?

I purchased another HE full system, arriving today, just to have it spare for an emergency, like hub failure, I already have a spare combo USB stick but to support HE in sales I got the full system, I can use this hub for migrations of friends too, or for testing. I'm using my hub as a security system so a failure and without a replacement doesn't look good for me.

I just need to figure out how to make my Asustor NAS to save a HE backup daily...

1 Like

You just need to setup wget or curl and go to this address:

http://[HubIP]/hub/backupDB?fileName=latest

This should create and download a new backup each time it is called

Andy

5 Likes

Thanks Andy, now to figure out what app of asustor will do your suggestions, I'm totally lost with wget and curl. Now google search and read time.

It would be really nice if the hub had a read-only FTP server for the backups. Then we wouldn't have to screw with wget or curl commands. We could just use any file sync software that supports FTP. Not a high priority obviously but thought I'd throw it out there to see if anyone else thought it would be useful.

I'm trying to figure out where to run my backup-download program too. Cause if it doesn't happen automatically, I'm going to forget to do it.

1 Like

@gavincampbell has some nice instructions on setting this up on a windows computer here:

How does wget or curl play with the new hub authentication?
I've been trying to use powershell's Invoke-RestMethod but it always chokes on authentication so far.

I really do wish external (smb or ftp) backup automation existed within the hub.

I agree, or even better, settings to push the backup to an FTP / SFTP server after creation...

curl -u myusername:mypassword http://myhubitat.somesite.com

wget --user myusername --password mypassword http://myhubitat.somesite.com

That's how those programs send the basic authentication header. I'm assuming Hubitat can use it, because I haven't tried it.

1 Like

That's a good alternative too. Either of those would work for me. And that might be easier for the hub to do. Good idea!

I tried it and it turns out AUTH doesn't get invoked... yet. I vaguely remember someone pointed this out and Hubitat staff responding. The response was one of the three: Next; Soon; Low priority; but I don't remember which :smiley:

Or which combination of them? :wink: While this would be a great feature, there are MUCH bigger fish to fry, so any of those would be justified in my mind. But hey, if you don't ask for it, you'll never get it, right? :slight_smile:

If you turn on user administration, /hub/backupDB?fileName=latest will redirect to login.

You will need to authorize a user to use this url

1 Like

Just so I'm not missing anything here, the processes you all are talking about is the same as clicking the Download button here right?:

Yes.

Thank you Sir! That's what I was hoping. Click Download, have google backup and sync handle the rest.

1 Like

If you remember to download the backup from your hub, yes, you can let google back it up to your Drive account. But that's only if you remember to download it from the hub. That's the part that I'm looking to automate (if I can figure it out).

Oh I figured that part about automating, I just wanted to make sure that using the builtin as I have been was capturing the same information as the way you're backing it up from the backend.

2 Likes

Thanks @patrick

I got a result before turning on User Authentication and I got a result after. I didn't check the size. You're completely correct, with User Auth on, a redirect occurs AND it's not basic authentication, so "--user myusername --password mypassword" does not work.

My mistake for not fully reviewing the result.

But....this still doesn’t backup the USB stick device info. Not complaining, just re-focusing on the intent of disaster record planning.

Well, I would say that having a backup of the hub data is important to a disaster recovery plan. There is no way to back up the stick because the devices are tied to the stick. You'll have to re-join those devices to your new stick because it's a new stick and not your old stick. That's not HE's doing...that's just how the protocol works AFAIK.