# Metric Data Archiving

**URL:** <https://forums.percona.com/t/metric-data-archiving/5341>\
**Category:** PMM 1.x\
**Created:** [January 12, 2017, 10:16am UTC](https://forums.percona.com/t/metric-data-archiving/5341 "2017-01-12T10:16:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mldba](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@mldba](https://forums.percona.com/u/mldba)\
**Post date:** [January 12, 2017, 10:16am UTC](https://forums.percona.com/t/metric-data-archiving/5341/1 "2017-01-12T10:16:14Z")

</div>

Are there any tool(s)/scripts to archive historical data from PMM to avoid having the data store grow and grow and grow?

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [January 13, 2017, 1:01am UTC](https://forums.percona.com/t/metric-data-archiving/5341/2 "2017-01-13T01:01:51Z")

</div>

Hi mldba,

inside PMM exists two space eaters:  
[LIST]  
[_]Prometheus database (data for graphs)  
[_]Query Analytics database (mysql)  
[/LIST] Periodic purge for both of them are configurable.  
[LIST]  
[_]QUERIES\_RETENTION in days for Query Analytics (“8” default value)  
[_]METRICS\_RETENTION in hours for Prometheus database (“720h” default value)  
[/LIST] please use the following command for set them

```auto

docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
-e METRICS_RETENTION=360h \
-e QUERIES_RETENTION=4 \
percona/pmm-server:1.0.7

```
