# Manual copy of indices

**URL:** https://discuss.elastic.co/t/manual-copy-of-indices/17011
**Category:** Elasticsearch
**Created:** [April 14, 2014, 11:21pm UTC](https://discuss.elastic.co/t/manual-copy-of-indices/17011 "2014-04-14T23:21:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discuss.elastic.co/u/varun)
#### Post date: [April 14, 2014, 11:21pm UTC](https://discuss.elastic.co/t/manual-copy-of-indices/17011/1 "2014-04-14T23:21:27Z")

</div>

Hi All,

I want to copy indexes created by embedded elastic search and copy that data  
into a live elastic search and use it. So these are the steps I followed.

1. Generated indices using Node Client (like embedded elastic search) with a  
index name testindex  
[http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html](http://www.elasticsearch.org/guide/en/elasticsearch/client/java-api/current/client.html)

2. After that I had a live elastic search cluster with one node and I  
created an empty index by the same name testindex and the same mappings as  
used to generate indices using NodeClient.

3. After that I closed testindex and copied the index data from the embedded  
elasticsearch to the data directory for testindex in elastic search

4. Opened the index testindex. After opening the index the copied data is  
deleted.

Any ideas why that could have happend. If I want to reused the indices  
generated by embedded elasticsearch by copying them to the data folder in  
elastic search, what all files should I copy.

Please advise

Thanks  
Varun

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a0f863f1-42b9-40e5-bf1f-03e73768a4f3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a0f863f1-42b9-40e5-bf1f-03e73768a4f3%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)
#### Post date: [April 16, 2014, 4:51pm UTC](https://discuss.elastic.co/t/manual-copy-of-indices/17011/2 "2014-04-16T16:51:13Z")

</div>

The safest way is to not have the index at all in the destination node in  
the first place. Then you shutdown the the destination node, copy  
everything from the named index folder from the source node and put it  
under the indices folder in the destination node, and then start it back up  
again.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f854d07c-76c4-421d-92c7-62b75d7f7570%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f854d07c-76c4-421d-92c7-62b75d7f7570%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:35am UTC](https://discuss.elastic.co/t/manual-copy-of-indices/17011/3 "2017-07-06T01:35:28Z")

</div>


