# Migrating indices from one machine to another

**URL:** <https://discuss.elastic.co/t/migrating-indices-from-one-machine-to-another/369092>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [October 19, 2024, 7:28pm UTC](https://discuss.elastic.co/t/migrating-indices-from-one-machine-to-another/369092 "2024-10-19T19:28:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamehSaeed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samehsaeed/32/145262_2.png) [@SamehSaeed](https://discuss.elastic.co/u/SamehSaeed)\
**Post date:** [October 19, 2024, 7:28pm UTC](https://discuss.elastic.co/t/migrating-indices-from-one-machine-to-another/369092/1 "2024-10-19T19:28:17Z")

</div>

Hello, I'm trying to migrate indices from a windows machine to a linux machine. For security reasons, I cannot use anything related to cloud.  
Is there a way to migrate indices using local file system? I tried copying the snapshot to the new machine but it did not work.

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [October 20, 2024, 10:26pm UTC](https://discuss.elastic.co/t/migrating-indices-from-one-machine-to-another/369092/2 "2024-10-20T22:26:26Z")

</div>

Remote remindex?

---

<div class="post-metadata">

**Author:** ![SamehSaeed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samehsaeed/32/145262_2.png) [@SamehSaeed](https://discuss.elastic.co/u/SamehSaeed)\
**Post date:** [October 28, 2024, 10:43am UTC](https://discuss.elastic.co/t/migrating-indices-from-one-machine-to-another/369092/3 "2024-10-28T10:43:53Z")

</div>

I'm trying to add a remote cluster though I cant get it to work, I tried adding the linux server in under the remote cluster option but it says "establish trust" which I don't know what it means, if I skip this and add the server it wont work.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/3/037e55da3b013cfc458218c7ca0f771f12378aa0.png)

Error :

```auto
[2024-10-28T13:15:47,626][WARN][r.suppressed] [SCPRWUWS05] path: /*%3A.monitoring-es-*%2C.monitoring-es-*%2C*%3Ametrics-elasticsearch.stack_monitoring.cluster_stats-*%2Cmetrics-elasticsearch.stack_monitoring.cluster_stats-*/_search, params: {index=*:.monitoring-es-*,.monitoring-es-*,*:metrics-elasticsearch.stack_monitoring.cluster_stats-*,metrics-elasticsearch.stack_monitoring.cluster_stats-*, filter_path=hits.hits._source.cluster_settings.cluster.metadata.display_name,hits.hits._source.cluster_uuid,hits.hits._source.elasticsearch.cluster.id,hits.hits._source.cluster_name,hits.hits._source.elasticsearch.cluster.name}, status: 500
org.elasticsearch.transport.RemoteTransportException: [error while communicating with remote cluster [Linux_Cluster]]
Caused by: org.elasticsearch.transport.ConnectTransportException: [][10.21.144.85:443] general node connection failure
	at org.elasticsearch.transport.TcpTransport$ChannelsConnectedListener.lambda$onResponse$2(TcpTransport.java:1132) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.ActionListenerImplementations.safeAcceptException(ActionListenerImplementations.java:62) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.ActionListener$2.onFailure(ActionListener.java:179) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.transport.TransportHandshaker$HandshakeResponseHandler.handleLocalException(TransportHandshaker.java:263) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.transport.TransportHandshaker.lambda$sendHandshake$0(TransportHandshaker.java:154) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:131) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.support.SubscribableListener$SuccessResult.complete(SubscribableListener.java:366) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.support.SubscribableListener.tryComplete(SubscribableListener.java:286) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.support.SubscribableListener.setResult(SubscribableListener.java:315) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.support.SubscribableListener.onResponse(SubscribableListener.java:229) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.transport.netty4.Netty4Utils.lambda$addListener$2(Netty4Utils.java:173) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:625) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:105) ~[?:?]
	at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) ~[?:?]
	at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1164) ~[?:?]
	at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:755) ~[?:?]
	at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:731) ~[?:?]
	at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:620) ~[?:?]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.closeOnRead(AbstractNioByteChannel.java:105) ~[?:?]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:174) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:689) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:652) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[?:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[?:?]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
	at java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: org.elasticsearch.transport.TransportException: handshake failed because connection reset
	at org.elasticsearch.transport.TransportHandshaker.lambda$sendHandshake$0(TransportHandshaker.java:154) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:131) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.support.SubscribableListener$SuccessResult.complete(SubscribableListener.java:366) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.support.SubscribableListener.tryComplete(SubscribableListener.java:286) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.support.SubscribableListener.setResult(SubscribableListener.java:315) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.action.support.SubscribableListener.onResponse(SubscribableListener.java:229) ~[elasticsearch-8.13.2.jar:?]
	at org.elasticsearch.transport.netty4.Netty4Utils.lambda$addListener$2(Netty4Utils.java:173) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:625) ~[?:?]
	at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:105) ~[?:?]
	at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) ~[?:?]
	at io.netty.channel.AbstractChannel$CloseFuture.setClosed(AbstractChannel.java:1164) ~[?:?]
	at io.netty.channel.AbstractChannel$AbstractUnsafe.doClose0(AbstractChannel.java:755) ~[?:?]
	at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:731) ~[?:?]
	at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:620) ~[?:?]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.closeOnRead(AbstractNioByteChannel.java:105) ~[?:?]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:174) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:689) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:652) ~[?:?]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[?:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[?:?]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
	at java.lang.Thread.run(Thread.java:1583) ~[?:?]

```

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [October 28, 2024, 1:04pm UTC](https://discuss.elastic.co/t/migrating-indices-from-one-machine-to-another/369092/4 "2024-10-28T13:04:36Z")

</div>

It's been awhile since I did this, and I don't have a place to test, but I don't think reindex needs a remote cluster definition. See [Reindex API | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.15/docs-reindex.html#reindex-from-remote)

But, it may need "good" ssl certs, self-signed may not work. Certs is probably your "establish trust" issue above.

---

<div class="post-metadata">

**Author:** ![SamehSaeed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samehsaeed/32/145262_2.png) [@SamehSaeed](https://discuss.elastic.co/u/SamehSaeed)\
**Post date:** [October 30, 2024, 6:32am UTC](https://discuss.elastic.co/t/migrating-indices-from-one-machine-to-another/369092/5 "2024-10-30T06:32:08Z")

</div>

Thnx alot for the info, that really helped!

I read in this [post](https://discuss.elastic.co/t/s-s-l-handshake-exception-in-kibana-while-using-reindex-api/139824/3) how to solve the SSL handshake exception, after adding the "source host" certificate to the "destination host" jvm cacerts file, the process ran without any exceptions.

Just a quick question, is there a way to run this process once to migrate all indices? we have around 400 😕

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [October 30, 2024, 2:11pm UTC](https://discuss.elastic.co/t/migrating-indices-from-one-machine-to-another/369092/6 "2024-10-30T14:11:58Z")

</div>

This might work, but I've never used it [Bash script to re-index all indices matching apattern from a remote Elasticsearch cluster to a local one · GitHub](https://gist.github.com/hartfordfive/e507bc47e17f4e03a89055918900e44d)
