ioBroker / AdapterRequests

This Place is used to track the status of new Adapter-Requests.
249 stars 36 forks source link

Adapter to backup unifi Database #797

Open Roellen opened 1 year ago

Roellen commented 1 year ago

What kind of device or service would you like to see an adapter for?

I would like to have an Adapter which can back up the database of unifi devices. There is the Database from the unifi Controller, which is stored locally on the device. If the device is broken you can’t replace the hardware without the backup. There is NO function to save the file to any external device. There are services online which can backup the database but you need to „open“ the firewall to get it working and i tried two services without success.

https://www.ui.com/

Is the device connected to the internet or only available on a local network?

LAN

Is an official App or Website available? https://www.ui.com/

Is an official API including documentation available? If yes, please add links and information[...] Probably, as there is the unifi adapter which connects to thr mongodb database.

Are other libraries for an integration available? Not sure.

Is this device already integrated in other Smart Home systems? Yes, into iobroker with the unifi adapter

**Is this device already integrated in homebridge? No.

dan1-de commented 1 year ago

Would be a good new feature for the backitup adapter.

mcm1957 commented 1 year ago

Would be a good new feature for the backitup adapter.

@dan1-de If you think this could / should be solved as part of backitup adapter please create an issue in this repository (and link it to this issue) to check the feedback of backitup's maintainer.

DutchmanNL commented 11 months ago

Anyone created an issue for backit-up adapter?

mcm1957 commented 11 months ago

issue has been created https://github.com/simatec/ioBroker.backitup/issues/1024

close here

mcm1957 commented 11 months ago

Issue reopended as there are some considerations whether this would fit info backitup.

So I reopen to allow discussion here too.

Roellen commented 11 months ago

Maybe this feature is not needed anymore. Because: Unifi now has a cloud backup.

(A local backup might be better, because you need to be online to get access to the cloud - which is a problem when your unifi system does not work, but at least there is a backup now)

DutchmanNL commented 11 months ago

Label updated, waiting for outcome of dev meeting scheduled for 29th of November

DutchmanNL commented 11 months ago

Maybe this feature is not needed anymore.

Because:

Unifi now has a cloud backup.

(A local backup might be better, because you need to be online to get access to the cloud - which is a problem when your unifi system does not work, but at least there is a backup now)

Agree, I am not (and never will) use cloud service for Aspekts I can do locally, backups is an example of it

As centralised addition yes, like backup on other location, but basic is local

simatec commented 11 months ago

There is NO function to save the file to any external device.

How should iobroker be able to access it if there is no possibility?

simatec commented 11 months ago

Maybe this feature is not needed anymore. Because: Unifi now has a cloud backup.

(A local backup might be better, because you need to be online to get access to the cloud - which is a problem when your unifi system does not work, but at least there is a backup now)

What options are there for a local backup? I don't know the devices, as I only run Mikrotik...

Roellen commented 11 months ago

You can download a backup, or make an online backup (which is a new feature) But it would be good to be able to make automatic backups and be able to save it to any location. With unifi... the backup is stored... on the same device!? I think this is not good.

I don't know much about linux and things. But... wouldn't it be possible to make some kind of script so that no one needs to do all these steps? https://ryanburnette.com/blog/unifi-backup-udmp/

simatec commented 11 months ago

In my opinion, however, no adapter is required for this method. The DreamMachine does this independently via the cronjob.

I don't really understand the issue yet... If I am interpreting this correctly, it is not possible to create a backup of the DreamMachine externally (iobroker adapter)

Roellen commented 11 months ago

When I started the question in 2022 it was only possible to backup up all files locally. What happens next is... dream machine or the controller dies and backup is lost.

As it's a linux machine I thought it might be possible to copy the backup file to another/saver location. Like a NAS or so. I mean... the backup and cronjob can be made by the controller, but unifi can't save it to any NAS or any other location. So there are some sites like https://www.backifi.com/ wher you can backup everything in the cloud. I tried to use it... did not work for me. In the meantime unifi managed to add a cloud backup.

But a local backup always sounds nice. As.. when the router breaks = no access to the cloud.

So to me it sounds like the file of the *.unf backup can, somehow, be copied. Maybe the backup adapter can copy one file and save it to the already existing backup locations?

simatec commented 11 months ago

I'll try to shed some light on this again. The instructions for backing up the local backups on a Dreammachine are given here exclusively on the Unifi device itself.

A rsync is executed via cronjob, which writes the data to the remote system. This can be a NAS, for example.

The usual NAS nowadays support rsync.

Unfortunately, I do not currently see any possibility of using an adapter. Everything happens directly on the Unifi device.

An adapter would need access via e.g. an API or similar.

I would like to help here and understand what an adapter can do, but at the moment I really see the script as the most sensible solution directly on the Dreammachine

DutchmanNL commented 11 months ago

interesting issue, but also mixing things :) What is the scope, unified controller or dream machine (technically totally different ways of making a backup)

controller backup can be made by SSH and batch execution on command Line + rsync, dream machine has a different setup. Please don't get me wrong, I don't want to start a new discussion but there are 3 aspects here:

Roellen commented 11 months ago

Iam the wrong guy making suggestions. :-) (because if limited skills) ;-)

I also thought that the dream machine is just a device with the controller integrated, which is usually an external device. I thought both will just save a *.unf file and that's it.

Copying this file automatically to a local NAS and getting an info from the adapter when the copy-process was NOT working ok would be all I need.

In general: I never understand how adapters are beeing written.

In my brain it should work like this: There is a webfrontend where people (like me) can hit a button and decide when the backupfile will be copied (cronjob thing probably running in the background but I don't know) and then enter NAS credentials for SAMBA filesystem. Hit ok...

And in the background whatever needs to be installed... like rsync... will be installed. So it just sends some linux commands.. .and finished.

And... not sure IF there is a way in iobroker to make more complex things, which maybe need a Docker container or a virtualmachine running. Like influxdb and grafana. That's not easy to configure. But one guy could make it running, save it as docker and this will be started and installed automatically. Same thing for having a videoserver runnning. Not easy to setup manually for people with less experience. Everyone I suggested using iobroker quit after some time and is using home assistant. As it seems to be easier with home assistant. I myselfs really like iobroker.

simatec commented 11 months ago

I understand your frustration, but unfortunately the entire process is on the Unifi.

I don't have these devices myself to be able to have a say. I just can't think of anything useful that an adapter can do. At some point you would have to see whether something might be possible using the Unifi adapter.

mcm1957 commented 11 months ago

As discussed at developer meeting:

-) backitup adapter will only backup core data of ioBroker. An extension of backitup to save unify data is NOT planned.

-) Developing a seperated and dedicated adapter which handles backups of unify is of course ok. So if someone wants to implement this, please let us know.