# RETENTION is not working

**URL:** <https://community.influxdata.com/t/retention-is-not-working/12746>\
**Category:** InfluxDB 2\
**Created:** [January 23, 2020, 2:14pm UTC](https://community.influxdata.com/t/retention-is-not-working/12746 "2020-01-23T14:14:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rguptarg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rguptarg/32/4265_2.png) [@rguptarg](https://community.influxdata.com/u/rguptarg)\
**Post date:** [January 23, 2020, 2:14pm UTC](https://community.influxdata.com/t/retention-is-not-working/12746/1 "2020-01-23T14:14:12Z")

</div>

HI Team,

As I have checked retention policy on influxDB, but on influxdb i can see last 6 months data on influx.

> SHOW RETENTION POLICIES ON telegraf  
> name duration shardGroupDuration replicaN default

* * *

autogen 2016h0m0s 168h0m0s 1 true

name: telegraf  
id database retention\_policy shard\_group start\_time end\_time expiry\_time owners

* * *

569 telegraf autogen 569 2019-10-28T00:00:00Z 2019-11-04T00:00:00Z 2020-01-27T00:00:00Z  
578 telegraf autogen 578 2019-11-04T00:00:00Z 2019-11-11T00:00:00Z 2020-02-03T00:00:00Z  
587 telegraf autogen 587 2019-11-11T00:00:00Z 2019-11-18T00:00:00Z 2020-02-10T00:00:00Z  
596 telegraf autogen 596 2019-11-18T00:00:00Z 2019-11-25T00:00:00Z 2020-02-17T00:00:00Z  
605 telegraf autogen 605 2019-11-25T00:00:00Z 2019-12-02T00:00:00Z 2020-02-24T00:00:00Z  
614 telegraf autogen 614 2019-12-02T00:00:00Z 2019-12-09T00:00:00Z 2020-03-02T00:00:00Z  
623 telegraf autogen 623 2019-12-09T00:00:00Z 2019-12-16T00:00:00Z 2020-03-09T00:00:00Z  
632 telegraf autogen 632 2019-12-16T00:00:00Z 2019-12-23T00:00:00Z 2020-03-16T00:00:00Z  
641 telegraf autogen 641 2019-12-23T00:00:00Z 2019-12-30T00:00:00Z 2020-03-23T00:00:00Z  
650 telegraf autogen 650 2019-12-30T00:00:00Z 2020-01-06T00:00:00Z 2020-03-30T00:00:00Z  
659 telegraf autogen 659 2020-01-06T00:00:00Z 2020-01-13T00:00:00Z 2020-04-06T00:00:00Z  
668 telegraf autogen 668 2020-01-13T00:00:00Z 2020-01-20T00:00:00Z 2020-04-13T00:00:00Z  
677 telegraf autogen 677 2020-01-20T00:00:00Z 2020-01-27T00:00:00Z 2020-04-20T00:00:00Z

version :- influxdb-1.7.9-1.x86\_64

How can I configure RETENTION policy for 3 months ?

---

<div class="post-metadata">

**Author:** ![philb](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/philb/32/1805_2.png) [@philb](https://community.influxdata.com/u/philb)\
**Post date:** [January 23, 2020, 2:45pm UTC](https://community.influxdata.com/t/retention-is-not-working/12746/2 "2020-01-23T14:45:50Z")

</div>

Hi

`alter retention policy "autogen" on "yourdatabase" duration 90d replication 1 default`

That should do it, [database and retention policy management](https://docs.influxdata.com/influxdb/v1.7/query_language/database_management/#modify-retention-policies-with-alter-retention-policy)

---

<div class="post-metadata">

**Author:** ![rguptarg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rguptarg/32/4265_2.png) [@rguptarg](https://community.influxdata.com/u/rguptarg)\
**Post date:** [January 24, 2020, 5:08am UTC](https://community.influxdata.com/t/retention-is-not-working/12746/3 "2020-01-24T05:08:46Z")

</div>

Thanks for replying.

As I can see current retention policy is deployed for 84 days (2016h), but I can see last 6 months data in influxDB.

> show retention policies on “telegraf”  
> name duration shardGroupDuration replicaN default

* * *

autogen 2016h0m0s 168h0m0s 1 true

So is there any other configuration required for this?

---

<div class="post-metadata">

**Author:** ![philb](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/philb/32/1805_2.png) [@philb](https://community.influxdata.com/u/philb)\
**Post date:** [January 27, 2020, 12:54pm UTC](https://community.influxdata.com/t/retention-is-not-working/12746/4 "2020-01-27T12:54:52Z")

</div>

Hi, no that should do it i think. If the RP is 84 days you shouldn’t have any data older than that. Have you tried making a new RP and assigning it to your database?
