# How to understand snapshot repositories on s3?

**URL:** <https://discuss.elastic.co/t/how-to-understand-snapshot-repositories-on-s3/107665>\
**Category:** Elasticsearch\
**Created:** [November 15, 2017, 6:04am UTC](https://discuss.elastic.co/t/how-to-understand-snapshot-repositories-on-s3/107665 "2017-11-15T06:04:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lhong1](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@lhong1](https://discuss.elastic.co/u/lhong1)\
**Post date:** [November 15, 2017, 6:04am UTC](https://discuss.elastic.co/t/how-to-understand-snapshot-repositories-on-s3/107665/1 "2017-11-15T06:04:27Z")

</div>

Hello,

We have our ES snapshot stored on S3 currently via repository-s3 plugin. Per this post:

> [@Snapshots: are type "fs" compatible with type "s3"?](https://discuss.elastic.co/t/snapshots-are-type-fs-compatible-with-type-s3/74655):
>
> Is it possible to do a snapshot type "fs" (locally), sync the local snapshot location to an s3 bucket, and then from an AWS elasticsearch instance run a restore using the s3 bucket containing the snapshot generated with type "fs"? Know I could directly sync the snapshot to "s3" with a local install of repository-s3 plugin ; however find this to be incredibly slow with little to no feedback as to what is happening. Prefer the speed of a local snapshot (local is source of truth) and then to see t…

I'd like to copy repository data of certain indices to local disk.

I see each snapshot has an UUID ( /\_snapshot/REPOSITORY/my\_snapshot/\_status), but in my S3 bucket, I cannot use this UUID to locate the index.

And I cannot find any elastic doc talking about this.

Any help is appreciated!

LH

PS: in the index-###.dms file in the REPOSITORY bucket on s3, I also see some snapshots has a "state:1" attribute while not others. But /\_status reports all are "SUCCESS". Any thought?

index-111.dms

{"snapshots":[{"name":"snapshot\_1508396416","uuid":"lGcXoXU7QDeE9MWyPjd3vA","state":1},{"name":"snapshot\_20171001","uuid":"CHvjCqBqQ7S6waMpymAyeA"}

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 15, 2017, 7:33am UTC](https://discuss.elastic.co/t/how-to-understand-snapshot-repositories-on-s3/107665/2 "2017-11-15T07:33:38Z")

</div>

> I'd like to copy repository data of certain indices to local disk.

Why do you want to do this?

---

<div class="post-metadata">

**Author:** ![lhong1](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@lhong1](https://discuss.elastic.co/u/lhong1)\
**Post date:** [November 15, 2017, 8:07am UTC](https://discuss.elastic.co/t/how-to-understand-snapshot-repositories-on-s3/107665/3 "2017-11-15T08:07:10Z")

</div>

mainly to avoid waiting for downloading from s3.

I figure this way I can use aws cli to sync/download a particular snapshot to my local fs, then restore from it at much faster speed. Otherwise, every time I need to wait for the data to be downloaded on demand from s3.

The other dumb choice is then to just sync the whole repository bucket to local disk, configure the repository-fs plugin pointing to local dir, then restore the particular snapshot using the \_snapshot api.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 15, 2017, 9:56am UTC](https://discuss.elastic.co/t/how-to-understand-snapshot-repositories-on-s3/107665/4 "2017-11-15T09:56:32Z")

</div>

I see.

Then yes, copying the whole S3 repo locally is probably what you could do.

Note that you can also:

- Restore from S3
- Backup to local FS

Then you will just have to restore from Local FS again.

That's better IMO as you will use only elasticsearch API instead of having to copy "files" manually.

---

<div class="post-metadata">

**Author:** ![lhong1](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@lhong1](https://discuss.elastic.co/u/lhong1)\
**Post date:** [November 15, 2017, 2:55pm UTC](https://discuss.elastic.co/t/how-to-understand-snapshot-repositories-on-s3/107665/5 "2017-11-15T14:55:09Z")

</div>

Got it. Thanks for confirming David!

OTOH, won't disclose how the repository directory is populated on S3? 🙂

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 15, 2017, 3:19pm UTC](https://discuss.elastic.co/t/how-to-understand-snapshot-repositories-on-s3/107665/6 "2017-11-15T15:19:22Z")

</div>

I don't know from the top of my head.  
And the source code is open! 😃

---

<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:** [December 13, 2017, 3:19pm UTC](https://discuss.elastic.co/t/how-to-understand-snapshot-repositories-on-s3/107665/7 "2017-12-13T15:19:25Z")

</div>

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