# How to archive snapshots

**URL:** <https://discuss.elastic.co/t/how-to-archive-snapshots/337959>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [July 9, 2023, 11:15am UTC](https://discuss.elastic.co/t/how-to-archive-snapshots/337959 "2023-07-09T11:15:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaykb77](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@jaykb77](https://discuss.elastic.co/u/jaykb77)\
**Post date:** [July 9, 2023, 11:15am UTC](https://discuss.elastic.co/t/how-to-archive-snapshots/337959/1 "2023-07-09T11:15:01Z")

</div>

Hi all,

We have a requirement to archive snapshots for long term retention. However since the snapshot directories are incremental, we do not want to simply zip it and send to archive storage. Is there a recommended alternate way to do this?

In short, we just want snapshots for last 7 days in the repository(which is in azure blob container) and want to send snapshots to archival storage (preferably onpremise) as they grow older than 7 days.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [July 9, 2023, 7:27pm UTC](https://discuss.elastic.co/t/how-to-archive-snapshots/337959/2 "2023-07-09T19:27:51Z")

</div>

Yes, see [these docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-register-repository.html#snapshots-repository-backup) for more information.

---

<div class="post-metadata">

**Author:** ![jaykb77](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@jaykb77](https://discuss.elastic.co/u/jaykb77)\
**Post date:** [July 11, 2023, 11:15am UTC](https://discuss.elastic.co/t/how-to-archive-snapshots/337959/3 "2023-07-11T11:15:24Z")

</div>

Thanks for the response. I understand that the way to do it is to take backup of the repository contents. But its not clear how this can be done in a scenario, where we want to archive one snapshot per day (and not a folder with a bunch of snapshots).

```auto
    "policy" : {
      "name" : "<auto_snapshot-{now{yyyy-MM-dd_HH-mm-ss}}>",
      "schedule" : "0 15 */6 * * ?",
      "repository" : "snapshots",
      "config" : {
        "feature_states" : [
          "watcher",
          "fleet",
          "transform",
          "logstash_management",
          "machine_learning",
          "enrich",
          "kibana",
          "tasks"
        ],
        "include_global_state" : true,
        "indices" : "*,-.*"
      },
      "retention" : {
        "expire_after" : "7d",
        "min_count" : 10,
        "max_count" : 20
      }

```

Should we define another repository and SLM policy that takes single snapshots per day and retains a single snapshot - and then archive the contents of that directory every day ?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [July 11, 2023, 11:44am UTC](https://discuss.elastic.co/t/how-to-archive-snapshots/337959/4 "2023-07-11T11:44:50Z")

</div>

Archiving a single snapshot doesn't really make sense, or at least it will be very expensive because it loses all the benefits of cross-snapshot data deduplication.

---

<div class="post-metadata">

**Author:** ![jaykb77](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@jaykb77](https://discuss.elastic.co/u/jaykb77)\
**Post date:** [July 11, 2023, 12:07pm UTC](https://discuss.elastic.co/t/how-to-archive-snapshots/337959/5 "2023-07-11T12:07:04Z")

</div>

The intention here is to have a recovery point in archive for every day, lets say for an year. Could you suggest any strategies?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [July 11, 2023, 12:27pm UTC](https://discuss.elastic.co/t/how-to-archive-snapshots/337959/6 "2023-07-11T12:27:59Z")

</div>

Yes, use the backup process I linked previously, combined with an archival process that handles incremental data properly. I.e. not this:

> simply zip it and send to archive storage

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 8, 2023, 12:28pm UTC](https://discuss.elastic.co/t/how-to-archive-snapshots/337959/7 "2023-08-08T12:28:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
