Retention policies control how long TSDB for InfluxDB®️ keeps data in a database. By default, every database starts with a policy called autogen that stores data permanently and keeps shards for seven days. Create custom policies to limit storage duration, manage storage costs, or support multiple data lifecycles within the same database.
Prerequisites
Before you begin, ensure that you have:
A TSDB for InfluxDB®️ database. For more information, see Create a database
How retention policies work
A retention policy defines two independent time dimensions:
| Dimension | Description | Default (autogen) |
|---|---|---|
| Storage duration | How long data is kept in the database | Permanent (no expiry) |
| Shard duration | How long individual shards are retained | 7 days |
A database can have multiple retention policies, but only one can be the default at a time. When you set a custom policy as the default, autogen is no longer the default.
Get to the Storage Policy Management page
All retention policy operations start from the same page. Before following the steps in any section below, open the Storage Policy Management page for your database:
Log on to the TSDB console.
In the upper-left corner, select the region where your instance is located.
On the Instances page, click Manage in the Actions column for your instance.
Choose Time Series Data Management > Databases. On the Databases page, click Storage Policy Management in the Actions column for your database.
Create a retention policy
On the Storage Policy Management page, click Create in the upper-right corner.

In the dialog box, configure the following parameters.
Parameter Description Retention Policy Name A unique name for the policy. Storage Duration How long data is retained in the database. default Whether to set this policy as the default. When enabled, autogenis no longer the default. A database can have only one default policy at a time.Click OK.
You can also configure the Storage Duration of Shards parameter by modifying an existing retention policy after creation. For more information, see Modify a retention policy.
Modify a retention policy
On the Storage Policy Management page, select the policies to modify:
Single policy: Click Modify in the Actions column for the policy.
Multiple policies: Select the policies, then click Modify Selected.
When modifying multiple policies at once, only the Storage Duration parameter is available. To update the Storage Duration of Shards, modify each policy individually.
In the dialog box, update the parameters.
Click OK.
Set the default retention policy
On the Storage Policy Management page, click Set As Default in the Actions column for the policy.
After the change, Yes appears in the Whether Is default column for that policy.
Delete a retention policy
On the Storage Policy Management page, click Delete in the Actions column for the policy you want to remove.
In the confirmation dialog, click OK.