# How to take Manual backup of AWS elasticsearch to s3 bucket with indexname

**URL:** https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540
**Category:** Elasticsearch
**Created:** [November 28, 2018, 10:35am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540 "2018-11-28T10:35:00Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [November 28, 2018, 10:35am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/1 "2018-11-28T10:35:00Z")

</div>

Hi I am trying to take back up of my AWS elasticsearch indices . and I configured IAM role and policy and using curl to take the back . All the indices are backed up in s3 bucket. But inside the indices folder in s3 bucket new folder is created with 0RZdYteiQLCbvGJacpC5IA name not the index name used in elastic search. I am not able find which index back up . How to take the back up with index name.

For ex : my aws elasticsearch index name :alb-accesslog-2018.11.28  
folder inside the s3 bucket is like 0RZdYteiQLCbvGJacpC5IA

---

<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 28, 2018, 10:54am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/2 "2018-11-28T10:54:11Z")

</div>

You can call the \_cat/indices API to get the index id.

BUT you should use snapshot and restore feature instead of going to the hard disk manually...

---

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [November 28, 2018, 11:19am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/3 "2018-11-28T11:19:16Z")

</div>

> [@dadoonet](#):
>
> \_cat/indices

i am taking the snapshot for manual backup inside s3 ,but inside the s3 bucket i am not getting snapshot with indices name. its something other than indices number.

i am using this command to take backup

curl -XPUT '[https://search-mb-production-app-bhbhhbh.us-west-2.es.amazonaws.com/\_snapshot/my-snapshot-repo/28-11-2018](https://search-mb-production-app-bhbhhbh.us-west-2.es.amazonaws.com/_snapshot/my-snapshot-repo/28-11-2018)'

and getting output in s3 bucket like  
[https://s3.console.aws.amazon.com/s3/buckets/elasticsearch-backup-indices/indices/](https://s3.console.aws.amazon.com/s3/buckets/elasticsearch-backup-indices/indices/) 0RZdYteiQLCbvGJacpC5IA

i want like  
[https://s3.console.aws.amazon.com/s3/buckets/elasticsearch-backup-indices/indices/alb-access.log-2018-11-28](https://s3.console.aws.amazon.com/s3/buckets/elasticsearch-backup-indices/indices/alb-access.log-2018-11-28)

access.log-2018-11-28 in index name in Elasticsearch

---

<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 28, 2018, 12:08pm UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/4 "2018-11-28T12:08:01Z")

</div>

But why do you want to manually access to those directories ?

BTW did you look at [https://www.elastic.co/cloud](https://www.elastic.co/cloud) and [https://aws.amazon.com/marketplace/pp/B01N6YCISK](https://aws.amazon.com/marketplace/pp/B01N6YCISK) ?

Cloud by elastic is one way to have access to all features, all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL and what is coming like Canvas...

---

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [November 29, 2018, 7:11am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/5 "2018-11-29T07:11:21Z")

</div>

I want to know which folder backup is for which index.

I have 17 index in aws elastic search 17 folder are created in s3 with different name. I dont know which folder belong to which index.

---

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [November 29, 2018, 8:23am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/6 "2018-11-29T08:23:28Z")

</div>

\_cat/indices

could please advice the full command

---

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [November 29, 2018, 8:25am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/7 "2018-11-29T08:25:14Z")

</div>

I am following below link for "Use Amazon S3 to Store a Single Amazon Elasticsearch Service Index"[https://aws.amazon.com/blogs/database/use-amazon-s3-to-store-a-single-amazon-elasticsearch-service-index/](https://aws.amazon.com/blogs/database/use-amazon-s3-to-store-a-single-amazon-elasticsearch-service-index/)

I am successfully able to upload the indices from AWS Elasticseach to S3 bucket, but also noticed that folder name has changed on S3 bucket.

Folder name on ElasticSearch: [enter image description here](https://i.stack.imgur.com/8P2Xy.png)

Folder name on S3 bucket: [enter image description here](https://i.stack.imgur.com/rh6dC.png)

---

<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 29, 2018, 9:20am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/8 "2018-11-29T09:20:21Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html)

---

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [November 29, 2018, 10:40am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/9 "2018-11-29T10:40:06Z")

</div>

> [@dadoonet](#):
>
> [cat indices API | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html)

thank you

---

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [November 29, 2018, 1:18pm UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/10 "2018-11-29T13:18:00Z")

</div>

\_cat-indices we will get the UUID allocated for index . but s3 bucket name are different  
index : alb-accesslog-2018.11.24  
uuid : z6R3py0mQNWFC0y6\_oIULw

in s3 bucket folder name is 4hIH1pCTQlG5rFkatJA7fg

---

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [November 29, 2018, 2:22pm UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/11 "2018-11-29T14:22:55Z")

</div>

I want to know how to relate s3 folder name with aws elastic search index name?

because I have 16 index in AWS elastic search and 16 folder are there inside the indices folder in s3 bucket. I want to know which index snapshot is stored in which folder in s3?

---

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [December 3, 2018, 9:58am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/13 "2018-12-03T09:58:52Z")

</div>

Hi dadoonet

could please advice how to take back up of single index. I used the command like  
curl -XPUT '[http://search-mb-production-app-ssssssss.us-west-2.es.amazonaws.com/\_snapshot/my-snapshot-repo/alb-accesslog-2018.11.29](http://search-mb-production-app-ssssssss.us-west-2.es.amazonaws.com/_snapshot/my-snapshot-repo/alb-accesslog-2018.11.29)'  
-d'{  
"indices": "alb-accesslog-2018.11.29",  
"ignore\_unavailable": true,  
"include\_global\_state": false  
}'  
but got response like  
{"accepted":true}./sample.sh: line 6: $'-d{\n "indices": "alb-accesslog-2018.11.29",\n "ignore\_unavailable": true,\n "include\_global\_state": false\n }': command not found  
and when i check the status all the indices are backed up

---

<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: [December 3, 2018, 10:22am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/14 "2018-12-03T10:22:23Z")

</div>

Your shell script is probably wrong. Try with a space may be between `-d` and ` ?

Like:

```auto
curl -XPUT 'http://search-mb-production-app-tissfibb4qog2kiscfoghb7lfe.us-west-2.es.amazonaws.com/_snapshot/my-snapshot-repo/alb-accesslog-2018.11.29' -d '{
  "indices": "alb-accesslog-2018.11.29",
  "ignore_unavailable": true,
  "include_global_state": false
}'

```

---

<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: [December 3, 2018, 10:25am UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/15 "2018-12-03T10:25:25Z")

</div>

BTW are you sure you really want to have your cluster exposed to internet?

---

<div class="post-metadata">

### Author: ![arun5635](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@arun5635](https://discuss.elastic.co/u/arun5635)
#### Post date: [December 3, 2018, 1:15pm UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/16 "2018-12-03T13:15:25Z")

</div>

nope

---

<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 31, 2018, 1:22pm UTC](https://discuss.elastic.co/t/how-to-take-manual-backup-of-aws-elasticsearch-to-s3-bucket-with-indexname/158540/17 "2018-12-31T13:22:21Z")

</div>

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