Applying retention policies to existing measurments

Hey all,
I’m trying create some RPs on an existing database. Within this database I have some measurements that we only need for a few months and have a huge data footprint, and others that we’d like to keep basically forever as they’ll never fill up the disk.

I’ve setup up the correct retention policies and now have my app writing new data to the correct RP. My question is what to do with the old data written to the old retention policy?

Is there a nice way to change the RP of a measurement once it’s been written?

Any help much appreciated!

Paul

@Paul_Wolfe What I’d recommend is that you move the old data to the correct RPs and then drop the old data.

Essentially what that means is

SELECT * INTO "db"."newrp"."newmeasurement" FROM "db"."oldrp"."oldmeasurement" GROUP BY *

Once you’re confident that you’ve moved all the data into the correct RP, I’d run

DROP RETENTION POLICY "oldrp" ON "db"
2 Likes