I´m running Node red in a Sonoff iHost. I have running the Nodered container and running too an influxdb container, so I´m hosting my own database (it´s influx 1.x , not 1.8 or 2.0). As iHost relays on an SD card (like Raspberry) one day I thought I will loose my database the day my SD card dies and decided to try to move the influx database to a server or any other site not hosted inside the iHost, and here starts the problem. I don´t know how to make a backup of my database. I discovered the node "influxdb-backup" and installed it in node red. I configured everything and when I launch the backup I receive this message trough the second output of the node: "/bin/bash: line 1: influxd: command not found". And that´s the end, my end. I can´t move forward that point. Tried to copy manually the database files but I can´t find them in the complicated and closed system of iHost, if fact I don´t know what filnames to look for. I tried to look for any response in the node page or contact with the author, but the page it´s innaccessible from the web explorer at the moment.Any help would be apreciated, because I don´t want to loose 10 months of dates.
That is because the node assumes that node red can run the backup utility via the command line, but that is running inside the node-red container, whereas you need to run it inside the influxdb container. You should be able to do it manually if you open a terminal in the influxdb container then you should be able to run the commands.
1.x is not a version, it just means 1.anything. Probably you are running 1.8.
The backup and restore commands are documented in Back up and restore data in InfluxDB v1.11 | InfluxDB OSS v1 Documentation
Probably the command you need is just
influxd backup -portable path/to/where/to/save/the/backup
Thanks for your answer. The thing is that there is no terminal where running commands. iHost is a "closed system". It has another functionalities (not interesting for this thing) and a Docker tab, where you can download and install containers from Docker and "they run inside that tab." Once they are running you only have a tab for each container running where you can stop and restart the container and read its log. Nothing else. I´m sure your option would be valid if it were running in a Raspberry but not for iHost. We could say that everything must be done inside Node red and from Node red.
I think you need to ask the question in an ihost forum. There must be some way of accessing the internals of the influxdb container.
That´s another thing, not very much information about this hardware, it´s not very extended in the domotic comunity...
I have tried your idea but same result. In the output 2 of the Exec node I get this message "/bin/bash: line 1: influxd: command not found" and in the output 3 this message "code: 127 -- message: Command failed: influxd backup -portable /data/backups
/bin/bash: line 1: influxd: command not found"
Sorry, didn't read your question properly.
I see now that you influx is running in another Docker container.
No idea how to make a backup then.
Normally one would run
docker exec –it container_id /bin/bash
where container_id is the id of the container, but if there is nowhere you can run that command then that is no good.
docker exec
is the way to go in this case.
But keep in mind, you'd also need to install the docker cli tools in your Node-RED container AND grant it access to the Docker host via /var/run/docker.sock
.
That's something I'd consider a security risk...
No way to do that. iHost is a closed system, you can´t do anything about the containers more than installing and running them. So i think there´s no solution for my problem.
If I could access the files in the SD card from anywhere in Windos, something like the file explorer I could save a copy in the hard drive, then I would run a new database in a server, put some data inside and look how the file structure is created. Then replace the same files from my SD backup and see if it works. Yes, there´s nothing more dirty than this, the alternative is acept loosing all my data and starting new clean database in a server.
I don´t know why do I involve myself in this shitty problems....
The other way is to use node red to read all the data using the influxdb In node and send it all somewhere else using MQTT or http or similar.
The moral is don't use closed systems.
Yes, before this hardware I was running node red in a Raspberry P, but I changed to the iHost because another benefits, like no cloud dependant for the hardware modules installed in my house for the lights, sockets... Integreted hub for Matter, Zigbee... You win various tecnical advantages, but you loose the easy accesibility to configs, file access... More that one time I have been thinking to return to the Raspberry, but until now I was able to solve the problems and consider still a benefit the use of the iHost.
I will meditate about reading all the data and sending to a new database. I think it won´t be easy because too much data may block the iHost or the container itself. Maybe doing it in various readings of 1 month max data... Maybe I will give a try.
You don't need to use an iHost in order to get a zigbee2mqtt hub, there are others.