Replay/Copy measurement while changing timestamps


we want to “playback” data we recorded some time ago from an influx DB into an influx DB, to emulate sensors so that we can test a software that reads their values from an influx DB. This would work very well with a rather simple SELECT INTO statement, however we need to change the timestamps to current ones, because the software is supposed to ignore old data and work on short recent intervals. A simple offset to the whole time column(s) would be enough, however we could not found a way to do this yet, without reading, changing and re-inserting every single entry. We want to avoid this mainly because of performance considerations.
It seems to be impossible to change time values at all, is that true? Is there a possible workaround for this scenario? Like copying the data without the time column and letting influx generate it on insertion?


Hello @ptoews,
You could run a task to change the timestamp with use the timeShift function with Flux and write the data to a new measurement.

Alternative, I can think of these two repos where this has been implemented:

I hope one of these helps!

1 Like