Hi is their a policy running on openremote to delete the data from the postgresql? after some period of time , because few months data has been deleted from postgresql db even though this has not been done manually.
Hi!
If you are talking about data points (attribute values);
Every 24 hours, it will automatically delete data points that are more than 30 days old.
You can adjust it using an environment variable on the Manager container;
# Configure the default max age for data points stored in the database (individual attributes can use a custom
# value by using the DATA_POINTS_MAX_AGE_DAYS AssetMeta item).
# OR_DATA_POINTS_MAX_AGE_DAYS: 30
.
Optionally, you can also adjust it for individual attributes, by adding the meta item.
Thanks, it works for me
Hi
To invoke this globally, I added ‘OR_DATA_POINTS_MAX_AGE_DAYS: 37000’ to the docker-compose.yml files and stopped are restarted docker i.e. ‘docker-compose up -d’.
The change did not work i.e still only retaining 30 day’s data. Do I need to do anything else?
Thanks
try below command
docker compose -p openremote up
Thanks Apurba
I have used ‘docker compose -p openremote up’ as suggested and will see it it works.
Clint
Thanks Apurba - much appreciated.
Hi!
I don’t know if there is a specific reason for using 37000 days?
I should have mentioned that you can use -1
to disable the cleaning mechanic.
Hope this helps!
FYI: “Data points max age days” meta items should still work after that.
Hi Martin
The 37000 days was arbitrary. I will use -1 to disable the cleaning mechanism as suggested. Also, noted that the meta item will still work.
Thanks
No problem!
The meta item should indeed still work. But let us know if it doesn’t, then we’ll put in a fix for it
Hey Martin,
I am pretty new here but played a lot of times with openremote around. Now I saw the option to store Data Points over 30 days with putting -1 into it.
The only problem I got, is that there is an WARNING SIGN showing up on the right top corner that says: Asset is not valid. If i put in any other positive number it works fine.
Should i ignore the Warning?
Thanks.
With the risk that I give the wrong answer. I think the ‘-1’ relates to the environment variable, for the configuration item ‘Data points max age days’ of an individual attribute, you need to use a positive number, or just remove the item, if the env variable is set correctly.
Hey Pierre. Thanks for ur reply.
Yeah i fixed it in the docker-compose.yml data and hope it works. I will see it. Thanks
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.