Change the consolidation function of an existing rrd4j persitance

Hello

I have just realised that most of my rrd4j databases have a “LAST” consolidation function. This is normal as they were created when the items were numeric type (without quantity).

Is it possible to modify the consolidation function using AVERAGE? Of course the old consolidations will have an incorrect value but at least the new ones will be correct.

If possible automatically for all quantity type items.

That should already be the case.

According to the docs, plain number items use LAST but Items with dimensions use AVERAGE.

When you added dimensions to the Items, that should have moved those items to the default_quantifiable config.

If it didn’t change the function when you changed the item type I’m guessing you have your answer and it’s “no”. You’d have to delete the old file and have rrd4j recreate it, but you’ll lose your old data off course.

This is not the case. I think the function is defined when the database is created and not modified afterwards.

I’ve tried using rrd4j-inspector, but it doesn’t allow you to modify the consolidation function.

Does anyone know of a tool for changing the consolidation function or importing data from the old database into a new one?

If rrd4j inspector won’t let you do it, there is almost certainly a technical reason chasing it is not supported.

As for importing, there are several scripts and tutorials posted around the OH 3.0 release time frame showing how to migrate data from InfluxDB to rrd4j using OH’s REST API. You could use that but you’ll have to create a new Item with a different name to migrate the data to.

I’ll also not that your old data will already be kind of wing anyway. It might be better to start over instead of keeping the wing data around. Wrong can be worse than no data in most cases.

Thank you

I have seen a few tools during my research on the forum but none of them really suited my needs and I know almost nothing about java programming. But with oh api I should get out of it.

I’m still surprised not to find any tools to export/import a rrd4j database.

It’s not unique to rrd4j. There are no tools built into OH too import any database.

I was thinking of an external tool not an oh feature.

But I finally found [Persistence] Tool to fetch data from a persistence service and put it into an RRD4J type file on the forum after a few tests it seems to do what I want.