# Using ES Spark to copy data from one instance to another

**URL:** <https://discuss.elastic.co/t/using-es-spark-to-copy-data-from-one-instance-to-another/34568>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [November 13, 2015, 10:15pm UTC](https://discuss.elastic.co/t/using-es-spark-to-copy-data-from-one-instance-to-another/34568 "2015-11-13T22:15:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramdev\_Wudali](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramdev_wudali/32/7894_2.png) [@Ramdev\_Wudali](https://discuss.elastic.co/u/Ramdev_Wudali)\
**Post date:** [November 13, 2015, 10:15pm UTC](https://discuss.elastic.co/t/using-es-spark-to-copy-data-from-one-instance-to-another/34568/1 "2015-11-13T22:15:13Z")

</div>

Hi:  
Is it possible to use the Spark API to read an index from one ES Cluster and write the same data into a different ES Cluster ? If so, how can I do it ? basically how would the configuration look like and how can I get the RDD to line up with the different SparkContexts???

Thanks much

Ramdev

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [November 14, 2015, 7:56pm UTC](https://discuss.elastic.co/t/using-es-spark-to-copy-data-from-one-instance-to-another/34568/2 "2015-11-14T19:56:22Z")

</div>

No, ES-Hadoop works only against the same cluster. You could try using tribe nodes however this is an unsupported scenario.

You can simply read the data and store it on disk/spark/hdfs/s3/etc.. and start another job to write it to the other ES cluster.

---

<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:27pm UTC](https://discuss.elastic.co/t/using-es-spark-to-copy-data-from-one-instance-to-another/34568/3 "2017-07-06T13:27:15Z")

</div>


