# How to copy and paste data

**URL:** <https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852>\
**Category:** Elasticsearch\
**Created:** [March 24, 2017, 6:52am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852 "2017-03-24T06:52:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharon\_wsf](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Sharon\_wsf](https://discuss.elastic.co/u/Sharon_wsf)\
**Post date:** [March 24, 2017, 6:52am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852/1 "2017-03-24T06:52:42Z")

</div>

Hi team,

How to merges data from cluster A to cluster B?  
i use  
POST /\_snapshot/backup/snapshot\_one/\_restore  
{  
"indices": "news",  
"ignore\_unavailable": "true"

}

but it will overwrite my original data inside the nodes.  
How to only copy and paste the index?

Thanks and best regards  
Sharon

---

<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:** [March 24, 2017, 7:12am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852/2 "2017-03-24T07:12:09Z")

</div>

May be reindex from remote API can help

---

<div class="post-metadata">

**Author:** ![Sharon\_wsf](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Sharon\_wsf](https://discuss.elastic.co/u/Sharon_wsf)\
**Post date:** [March 24, 2017, 7:37am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852/3 "2017-03-24T07:37:52Z")

</div>

Hi...  
Reindex mean my original index name rename?

POST /\_reindex  
{  
"source": {  
"index": "news"  
},  
"dest": {  
"index": "news\_data"  
}  
}  
For example: my current index name is /news/, after reindex will be "/news\_data",

is correct my understanding?  
Sorry ya, i already saw this command before, but i not very understand about reindexx..

Thanks

---

<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:** [March 24, 2017, 7:49am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852/4 "2017-03-24T07:49:04Z")

</div>

You can reindex from another cluster

---

<div class="post-metadata">

**Author:** ![Sharon\_wsf](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Sharon\_wsf](https://discuss.elastic.co/u/Sharon_wsf)\
**Post date:** [March 24, 2017, 7:51am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852/5 "2017-03-24T07:51:57Z")

</div>

The command is as below right:

POST \_reindex  
{  
"source": {  
"remote": {  
"host": "[http://otherhost:9200](http://otherhost:9200)",  
"username": "user",  
"password": "pass"  
},  
"index": "source",  
"query": {  
"match": {  
"test": "data"  
}  
}  
},  
"dest": {  
"index": "dest"  
}  
}

for host, how to configuration if local host to local host, and 9200 is same?  
"host": "[http://otherhost:9200](http://otherhost:9200)",

is this "test": "data" is default? what meaning of it?

---

<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:** [March 24, 2017, 8:33am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852/6 "2017-03-24T08:33:14Z")

</div>

You said you want to merge from cluster A to cluster B? So you have different nodes, right?

---

<div class="post-metadata">

**Author:** ![Sharon\_wsf](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Sharon\_wsf](https://discuss.elastic.co/u/Sharon_wsf)\
**Post date:** [March 24, 2017, 8:44am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852/7 "2017-03-24T08:44:00Z")

</div>

I need merge together into same nodes.  
Mean is my data at D:\Backup\_data, but this backup data need paste into elasticsearch 2.4 D:\elasticsearch\data\elasticsearch\nodes\0\indices\news.  
i need only paste into same index without affected my current data at elasticsearch 2.4 and without change index name.

I'm sorry for confuse you all..

Thanks and best regards  
Sharon

---

<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:** [March 24, 2017, 8:57am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852/8 "2017-03-24T08:57:39Z")

</div>

Merging data on file system level is not possible.

If you have 2 clusters you can read from one the documents and index them into the second cluster. So technically it will "merge" data on a document level.

---

<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:** [April 21, 2017, 8:57am UTC](https://discuss.elastic.co/t/how-to-copy-and-paste-data/79852/9 "2017-04-21T08:57:46Z")

</div>

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