# Make a copy of a document (index template)

**URL:** <https://discuss.elastic.co/t/make-a-copy-of-a-document-index-template/25187>\
**Category:** Elasticsearch\
**Created:** [July 8, 2015, 9:35pm UTC](https://discuss.elastic.co/t/make-a-copy-of-a-document-index-template/25187 "2015-07-08T21:35:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vilas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vilas/32/613_2.png) [@vilas](https://discuss.elastic.co/u/vilas)\
**Post date:** [July 8, 2015, 9:35pm UTC](https://discuss.elastic.co/t/make-a-copy-of-a-document-index-template/25187/1 "2015-07-08T21:35:49Z")

</div>

Hi,

I want to make a copy of a document. How can I do that?  
My main interest is to create a **index template** similar to _logstash-_.\*  
So, I would like to copy the template into another duplicate template.

Can you please suggest how can I do this.

---

<div class="post-metadata">

**Author:** ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)\
**Post date:** [July 8, 2015, 10:11pm UTC](https://discuss.elastic.co/t/make-a-copy-of-a-document-index-template/25187/2 "2015-07-08T22:11:15Z")

</div>

If you want to make a copy of the logstash template then you can the file elasticsearch-template.json from the logstash installation. Otherwise you need to use:

1. curl -XGET [http://localhost:9200/\_template/template\_name](http://localhost:9200/_template/template_name) \> template.json

2. Edit template.json and remove the the second line which is "template\_name: {" and the second last line which is "}".

3. Make any changes you want then add it with a new name:

curl -XPUT [http://localhost:9200/\_template/new\_template\_name](http://localhost:9200/_template/new_template_name) -d @template.json

---

<div class="post-metadata">

**Author:** ![vilas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vilas/32/613_2.png) [@vilas](https://discuss.elastic.co/u/vilas)\
**Post date:** [July 9, 2015, 4:53pm UTC](https://discuss.elastic.co/t/make-a-copy-of-a-document-index-template/25187/3 "2015-07-09T16:53:19Z")

</div>

Thanks a ton @msimos . It worked.

---

<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:** [July 6, 2017, 12:02am UTC](https://discuss.elastic.co/t/make-a-copy-of-a-document-index-template/25187/4 "2017-07-06T00:02:32Z")

</div>


