Clear historical data from netdata docker container

Environment

Netdata docker container v1.28.0

Question

I was wondering how to clear the historical data from a netdata docker container to start afresh. I have deployed my docker container using
-v netdataconfig:/etc/netdata
-v netdatalib:/var/lib/netdata
-v netdatacache:/var/cache/netdata
Can it be done by deleting the netdatacache volume manually and deploying the container again ? I do not want to effect the cloud integrations.

1 Like

Hey @rahul.sinha,

Just to make sure I understand. You want to delete the data that exists in the Netdata DB without deleting the files that affect the Netdata cloud connectivity. Correct?

1 Like

Hi @OdysLam … yes you are absolutely correct.

@rahul.sinha hi :wave:

There is only historical data (database) in the /var/cache/netdata. Cloud related things in the /var/lib/netdata/

1 Like

There is an example how to do it (assuming the container name is netdata):

0 ~ $ docker exec -it netdata rm -rv /var/cache/netdata/dbengine/ && docker restart netdata
removed '/var/cache/netdata/dbengine/journalfile-1-0000000001.njf'
removed '/var/cache/netdata/dbengine/datafile-1-0000000001.ndf'
removed directory: '/var/cache/netdata/dbengine'
netdata
2 Likes

Thanks a ton @ilyam8 …That is what I needed.