Back up influxdb data only

HI All,

This is my very frist interaction with this comunity and it goes without saying Im a completely newbie with HA and stuff but having heaps of fun with my new home automation hobby.

I’m running HA on a HABlue, MariaDB and InfluxDB /Grafana for facy graphs with my sensors data.

I run full backup every couple of days and upload them to Google.

Question: is there a way to run partial backup (just for the influxdb data) everyday? Would the partial back for the addon (Influxdbg) backup the data or only the app?

Sorry if question not properly articulated but you probably catch the gist of what I’m trying to do here.

I found similar topics but the info does not suit my configuration (too complicated/overkill)

I’m begining to think the best and simplest way is to run full backups everyday as I’m sure (???) the data will be included.

Many Tnx
Dan

1 Like

Hi there, welcome to the community.

Now are you making the backups manually or using any addons?

HI,

Automated full backups every 3 days using Home Assistant Google Drive Backup addon

Manual backups every now and then if Im about to install/chenge anything via supervisor

Thanks

BTW everything installed few days ago so all in the latest version. (Including core, etc…)

In that case you just need to deploy an automation which will make a partial backup of just the influxdb addon. When this backup is made, the google drive backup addon will automatically upload that to google drive. Make sure that you have no enabled ignore other backups in google drive addon which is disable by default. The automation should look like this.

alias: Influxdb Daily Backup
description: ''
mode: single
trigger:
  - platform: time
    at: '03:00:00'
condition: []
action:
  - service: hassio.backup_partial
    data:
      addons: a0d7b954_influxdb

Here the automation is triggered at 3 am everyday. You can change it according to your system. If you have any trouble deploying automation please check the below gif.

1 Like

Awesome, thanks.
So you are saying that the partial backup of the addon would save both the application and the related data, right?

Now I will try my frist automation.

Thanks heaps.
Daniel

Yes in most cases it will backup the settings and also the data.

It appears that the actual data in InfluxDB is being backed up. I downloaded one of my tar snapshot/backups and looked at the contents (pasted below). The size of this folder was 81MB and I’ve only been running InfluxDB for a few weeks.

Note that I did not try restoring this backup to ensure that the backup has integrity. If someone could post if they’ve successfully restored an InfluxDB from HA backup, that would be good info.

du -ah influxdb

  0B	influxdb/wal/_internal/monitor/20/_00016.wal
  0B	influxdb/wal/_internal/monitor/20
  0B	influxdb/wal/_internal/monitor/18/_00016.wal
  0B	influxdb/wal/_internal/monitor/18
  0B	influxdb/wal/_internal/monitor/16/_00015.wal
  0B	influxdb/wal/_internal/monitor/16
  0B	influxdb/wal/_internal/monitor/17/_00015.wal
  0B	influxdb/wal/_internal/monitor/17
 10M	influxdb/wal/_internal/monitor/21/_00001.wal
1.5M	influxdb/wal/_internal/monitor/21/_00002.wal
 11M	influxdb/wal/_internal/monitor/21
  0B	influxdb/wal/_internal/monitor/15/_00015.wal
  0B	influxdb/wal/_internal/monitor/15
  0B	influxdb/wal/_internal/monitor/13/_00011.wal
  0B	influxdb/wal/_internal/monitor/13
  0B	influxdb/wal/_internal/monitor/14/_00014.wal
  0B	influxdb/wal/_internal/monitor/14
 11M	influxdb/wal/_internal/monitor
 11M	influxdb/wal/_internal
  0B	influxdb/wal/home_assistant/autogen/11/_00003.wal
  0B	influxdb/wal/home_assistant/autogen/11
6.1M	influxdb/wal/home_assistant/autogen/19/_00001.wal
6.1M	influxdb/wal/home_assistant/autogen/19
  0B	influxdb/wal/home_assistant/autogen/4
6.1M	influxdb/wal/home_assistant/autogen
6.1M	influxdb/wal/home_assistant
 18M	influxdb/wal
4.0K	influxdb/meta/meta.db
4.0K	influxdb/meta
436K	influxdb/data/_internal/monitor/20/000000002-000000001.tsm
460K	influxdb/data/_internal/monitor/20/000000001-000000001.tsm
4.0K	influxdb/data/_internal/monitor/20/fields.idx
324K	influxdb/data/_internal/monitor/20/000000004-000000001.tsm
444K	influxdb/data/_internal/monitor/20/000000003-000000001.tsm
1.6M	influxdb/data/_internal/monitor/20
4.0K	influxdb/data/_internal/monitor/18/fields.idx
1.1M	influxdb/data/_internal/monitor/18/000000004-000000002.tsm
1.1M	influxdb/data/_internal/monitor/18
4.0K	influxdb/data/_internal/monitor/16/fields.idx
1.1M	influxdb/data/_internal/monitor/16/000000004-000000002.tsm
1.1M	influxdb/data/_internal/monitor/16
4.0K	influxdb/data/_internal/monitor/17/fields.idx
1.1M	influxdb/data/_internal/monitor/17/000000004-000000002.tsm
1.1M	influxdb/data/_internal/monitor/17
4.0K	influxdb/data/_internal/monitor/21/fields.idx
4.0K	influxdb/data/_internal/monitor/21
4.0K	influxdb/data/_internal/monitor/15/fields.idx
1.1M	influxdb/data/_internal/monitor/15/000000004-000000002.tsm
1.1M	influxdb/data/_internal/monitor/15
4.0K	influxdb/data/_internal/monitor/13/fields.idx
864K	influxdb/data/_internal/monitor/13/000000004-000000002.tsm
868K	influxdb/data/_internal/monitor/13
4.0K	influxdb/data/_internal/monitor/14/fields.idx
1.1M	influxdb/data/_internal/monitor/14/000000004-000000002.tsm
1.1M	influxdb/data/_internal/monitor/14
7.9M	influxdb/data/_internal/monitor
8.0K	influxdb/data/_internal/.DS_Store
4.0M	influxdb/data/_internal/_series/03/0000
4.0M	influxdb/data/_internal/_series/03
4.0M	influxdb/data/_internal/_series/04/0000
4.0M	influxdb/data/_internal/_series/04
4.0M	influxdb/data/_internal/_series/05/0000
4.0M	influxdb/data/_internal/_series/05
4.0M	influxdb/data/_internal/_series/02/0000
4.0M	influxdb/data/_internal/_series/02
4.0M	influxdb/data/_internal/_series/07/0000
4.0M	influxdb/data/_internal/_series/07
4.0M	influxdb/data/_internal/_series/00/0000
4.0M	influxdb/data/_internal/_series/00
4.0M	influxdb/data/_internal/_series/01/0000
4.0M	influxdb/data/_internal/_series/01
4.0M	influxdb/data/_internal/_series/06/0000
4.0M	influxdb/data/_internal/_series/06
 32M	influxdb/data/_internal/_series
 40M	influxdb/data/_internal
8.0K	influxdb/data/home_assistant/.DS_Store
4.0M	influxdb/data/home_assistant/_series/03/0000
4.0M	influxdb/data/home_assistant/_series/03
4.0M	influxdb/data/home_assistant/_series/04/0000
4.0M	influxdb/data/home_assistant/_series/04
4.0M	influxdb/data/home_assistant/_series/05/0000
4.0M	influxdb/data/home_assistant/_series/05
4.0M	influxdb/data/home_assistant/_series/02/0000
4.0M	influxdb/data/home_assistant/_series/02
8.0K	influxdb/data/home_assistant/_series/.DS_Store
4.0M	influxdb/data/home_assistant/_series/07/0000
4.0M	influxdb/data/home_assistant/_series/07
4.0M	influxdb/data/home_assistant/_series/00/0000
4.0M	influxdb/data/home_assistant/_series/00
4.0M	influxdb/data/home_assistant/_series/01/0000
4.0M	influxdb/data/home_assistant/_series/01
4.0M	influxdb/data/home_assistant/_series/06/0000
4.0M	influxdb/data/home_assistant/_series/06
 32M	influxdb/data/home_assistant/_series
8.0K	influxdb/data/home_assistant/autogen/.DS_Store
1.7M	influxdb/data/home_assistant/autogen/11/000000001-000000001.tsm
8.0K	influxdb/data/home_assistant/autogen/11/fields.idx
1.7M	influxdb/data/home_assistant/autogen/11
8.0K	influxdb/data/home_assistant/autogen/19/fields.idx
8.0K	influxdb/data/home_assistant/autogen/19
1.5M	influxdb/data/home_assistant/autogen/4/000000001-000000001.tsm
8.0K	influxdb/data/home_assistant/autogen/4/fields.idx
1.5M	influxdb/data/home_assistant/autogen/4
3.2M	influxdb/data/home_assistant/autogen
 35M	influxdb/data/home_assistant
 75M	influxdb/data
 93M	influxdb

I’ve recently restored from a full backup where I’ve been running Influxdb.

And unless I’m doing something wrong, the Influxdb database are not part of the backup. But would be happy to be proven wrong :slight_smile:

I recentlyhad an SSD fail and had to restore from a full backup this week. The data in Influx DID get restored. (I run a Pi 4 with an external disk and no SD card).

I only had a gap from the time of the previous full-backup to when I got a new drive on-line.
Here’s a screen-grab from one of my sensors, showing data from before the drive was replaced.

Like the OP, I only have full-backups going to Google every 3 days. So, I plan on adding nightly backups of Influx.

Can you backup a running influxdb, or does it need to be stopped? I stop it, but I’d rather keep it running so I won’t lose anything during the backup. But I can imagine this is the difference between a successful restore and loss of data.