# Archival And Retention Period

**URL:** <https://community.temporal.io/t/archival-and-retention-period/7358>\
**Category:** Community Support\
**Created:** [February 22, 2023, 1:15pm UTC](https://community.temporal.io/t/archival-and-retention-period/7358 "2023-02-22T13:15:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarvesh](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Sarvesh](https://community.temporal.io/u/Sarvesh)\
**Post date:** [February 22, 2023, 1:15pm UTC](https://community.temporal.io/t/archival-and-retention-period/7358/1 "2023-02-22T13:15:43Z")

</div>

Hi,

If we set Retention Period to 5 days and Archival is not enabled then all closed workflows data will be lost ? Is both Archival And Retention Period are dependent on each other ?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [February 22, 2023, 5:15pm UTC](https://community.temporal.io/t/archival-and-retention-period/7358/2 "2023-02-22T17:15:04Z")

</div>

Yeah if you don’t configure archival all completed execs that hit your namespace retention period are removed from both primary persistence store as well as your configured visibility store.

---

<div class="post-metadata">

**Author:** ![Sarvesh](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Sarvesh](https://community.temporal.io/u/Sarvesh)\
**Post date:** [February 22, 2023, 5:58pm UTC](https://community.temporal.io/t/archival-and-retention-period/7358/3 "2023-02-22T17:58:57Z")

</div>

Thanks for prompt reply.

Is there any way to access archive workflow execution data ?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [February 22, 2023, 6:04pm UTC](https://community.temporal.io/t/archival-and-retention-period/7358/4 "2023-02-22T18:04:27Z")

</div>

Yes, you can access it via tctl or via api (ListArchivedExecutions). The “visibility” query you use can differ but you can see the exposed fields in readmes for each archive plugin, see [here](https://github.com/temporalio/temporal/tree/master/common/archiver/gcloud#visibility-query-syntax) and [here](https://github.com/temporalio/temporal/tree/master/common/archiver/s3store#visibility-query-syntax).

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [February 22, 2023, 6:06pm UTC](https://community.temporal.io/t/archival-and-retention-period/7358/5 "2023-02-22T18:06:38Z")

</div>

Also if you think about starting using archival feature would consider using server version [1.20.0](https://github.com/temporalio/temporal/releases/tag/v1.20.0) which includes some improvements to archival for stability.

---

<div class="post-metadata">

**Author:** ![Sarvesh](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Sarvesh](https://community.temporal.io/u/Sarvesh)\
**Post date:** [February 24, 2023, 9:49am UTC](https://community.temporal.io/t/archival-and-retention-period/7358/6 "2023-02-24T09:49:46Z")

</div>

For default namespace when retention period is 1 day, its still not deleting workflow executions older than 1 day. Is this behaviour correct? We are persisiting data in MySQL DB.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [February 24, 2023, 4:10pm UTC](https://community.temporal.io/t/archival-and-retention-period/7358/7 "2023-02-24T16:10:48Z")

</div>

Retention period only applies to completed executions. Also when you change your ns retention period the change would apply only to completed execs after this update. Execs that completed before the retention period change/update on ns would still have the older retention period timer set.

---

<div class="post-metadata">

**Author:** ![Sarvesh](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Sarvesh](https://community.temporal.io/u/Sarvesh)\
**Post date:** [February 24, 2023, 5:11pm UTC](https://community.temporal.io/t/archival-and-retention-period/7358/8 "2023-02-24T17:11:42Z")

</div>

Is this behaviour differ in case of default namespace ? Cause for custom namespace it is deleting completed executions.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [February 24, 2023, 6:11pm UTC](https://community.temporal.io/t/archival-and-retention-period/7358/9 "2023-02-24T18:11:43Z")

</div>

It should be same for all namespaces. Note retention period is per namespace, you can check via tctl:

`tctl --ns <ns_name> namespace desc`

You can use the `--ns` option when you update your namespace (change retention too).
