# How to migrate data from localhost to Azure host

**URL:** <https://discuss.elastic.co/t/how-to-migrate-data-from-localhost-to-azure-host/175743>\
**Category:** Elasticsearch\
**Created:** [April 8, 2019, 12:34am UTC](https://discuss.elastic.co/t/how-to-migrate-data-from-localhost-to-azure-host/175743 "2019-04-08T00:34:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![talqadi7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talqadi7/32/43703_2.png) [@talqadi7](https://discuss.elastic.co/u/talqadi7)\
**Post date:** [April 8, 2019, 12:34am UTC](https://discuss.elastic.co/t/how-to-migrate-data-from-localhost-to-azure-host/175743/1 "2019-04-08T00:34:25Z")

</div>

Hi, I'm fairly new to ES, and would appreciate any help!  
I've attempted to follow the two different ways to migrate data that was stated in [https://www.elastic.co/guide/en/cloud/current/ec-migrate-data.html](https://www.elastic.co/guide/en/cloud/current/ec-migrate-data.html)

However, I'm facing issues with both. With the reindexing from a remote cluster, i added reindex.remote.whitelist: localhost:\* , to the remote host elasticsearch.yml. And then I ran the following code on my new azure es host:

POST \_reindex  
{  
"source": {  
"remote": {  
"host": "[http://localhost:5601](http://localhost:5601)"  
},  
"index": "xxx",  
"query": {  
"match\_all": {}  
}  
},  
"dest": {  
"index": "xxx"  
}  
}

However, I get this error: Response didn't include Content-Type: body=var hashRoute = '/app/kibana';\nvar defaultRoute = '/app/kibana';\n\nvar hash = window.location.hash.....

I then tried the snapshot method, on the localhost I ran:

PUT /\_snapshot/my\_backup  
{  
"type": "fs",  
"settings": {  
"location": "my\_backup",  
"compress": "true"  
}  
}  
With the path included in the local host .yml. The get command runs fine on the new snapshot. But, I get repository errors on the remote host when i try to use PUT, to migrate the data.

My remote host is on the azure portal, but I can't do anything until I transfer the work done on my local computer. Any help would be appreciated!  
Thank you.

---

<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:** [April 8, 2019, 3:47am UTC](https://discuss.elastic.co/t/how-to-migrate-data-from-localhost-to-azure-host/175743/2 "2019-04-08T03:47:43Z")

</div>

You can't use reindex from remote when the remote host is not accessible from the Azure node which is obviously the case here.

You can may be configure an azure snapshot repository in both clusters, snapshot from localhost the and then restore on Azure node.

---

<div class="post-metadata">

**Author:** ![talqadi7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talqadi7/32/43703_2.png) [@talqadi7](https://discuss.elastic.co/u/talqadi7)\
**Post date:** [April 9, 2019, 4:13am UTC](https://discuss.elastic.co/t/how-to-migrate-data-from-localhost-to-azure-host/175743/3 "2019-04-09T04:13:11Z")

</div>

Creating the snapshot on my local computer works, but when i try to retrieve it on the ES which is running on azure vm, I still get repository errors when I use PUT.

If i were to reindex, how do I make the local ES accessible to the ES on azure?

---

<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:** [April 9, 2019, 6:04am UTC](https://discuss.elastic.co/t/how-to-migrate-data-from-localhost-to-azure-host/175743/4 "2019-04-09T06:04:24Z")

</div>

> [@talqadi7](#):
>
> I still get repository errors when I use PUT.

Which are?

> [@talqadi7](#):
>
> how do I make the local ES accessible to the ES on azure?

You need to expose your machine on internet. That's a network question, not really an elasticsearch one. And I doubt you want to expose your elasticsearch cluster to internet without any kind of security. Or at least I'd not do that.

Another solution is to use Logstash.  
You can run Logstash locally and use an elasticsearch input which reads your local data and use an elasticsearch output which writes to your azure instance.

---

<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:** [May 7, 2019, 6:04am UTC](https://discuss.elastic.co/t/how-to-migrate-data-from-localhost-to-azure-host/175743/5 "2019-05-07T06:04:24Z")

</div>

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