# How to migrate old index from Old Server to New Server

**URL:** <https://discuss.elastic.co/t/how-to-migrate-old-index-from-old-server-to-new-server/232460>\
**Category:** Elasticsearch\
**Created:** [May 13, 2020, 2:40pm UTC](https://discuss.elastic.co/t/how-to-migrate-old-index-from-old-server-to-new-server/232460 "2020-05-13T14:40:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dattack13](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dattack13/32/70452_2.png) [@dattack13](https://discuss.elastic.co/u/dattack13)\
**Post date:** [May 13, 2020, 2:40pm UTC](https://discuss.elastic.co/t/how-to-migrate-old-index-from-old-server-to-new-server/232460/1 "2020-05-13T14:40:25Z")

</div>

Hi,

I have one index in old elasticsearch server in 6.2.0 version (windows server) and now I am trying to move it to new server (Linux) on 7.6.2 version of elasticsearch. I tried below command to migrate my index from old to new server but it is throwing an exception.

POST \_reindex  
{  
"source": {  
"remote": {  
"host": "[http://oldelasticsearchdns:9200](http://oldelasticsearchdns:9200)"  
},  
"index": "testIndex",  
"query": {  
"match\_all": {}  
}  
},  
"dest": {  
"index": "testIndex"  
}  
}

Exception I am getting is -

"type" : "illegal\_argument\_exception",  
"reason" : "[oldelasticsearchdns:9200] not whitelisted in reindex.remote.whitelist"

Note : I did not created any index in new elastic search server. do I have to create it with my old schema and then try to execute the above command ?

---

<div class="post-metadata">

**Author:** ![dattack13](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dattack13/32/70452_2.png) [@dattack13](https://discuss.elastic.co/u/dattack13)\
**Post date:** [May 13, 2020, 3:50pm UTC](https://discuss.elastic.co/t/how-to-migrate-old-index-from-old-server-to-new-server/232460/2 "2020-05-13T15:50:42Z")

</div>

As per instruction I created the index in new server with old mappings. then I tried the same command. still getting same issue :

{  
"error" : {  
"root\_cause" : [  
{  
"type" : "illegal\_argument\_exception",  
"reason" : "[dns:9200] not whitelisted in reindex.remote.whitelist"  
}  
],  
"type" : "illegal\_argument\_exception",  
"reason" : "[dns:9200] not whitelisted in reindex.remote.whitelist"  
},  
"status" : 400  
}

---

<div class="post-metadata">

**Author:** ![xeraa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xeraa/32/48181_2.png) [@xeraa](https://discuss.elastic.co/u/xeraa)\
**Post date:** [May 13, 2020, 3:59pm UTC](https://discuss.elastic.co/t/how-to-migrate-old-index-from-old-server-to-new-server/232460/3 "2020-05-13T15:59:09Z")

</div>

Please read the docs on remote reindexing and especially the part on whitelisting: [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#reindex-from-remote](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#reindex-from-remote)

---

<div class="post-metadata">

**Author:** ![dattack13](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dattack13/32/70452_2.png) [@dattack13](https://discuss.elastic.co/u/dattack13)\
**Post date:** [May 13, 2020, 4:29pm UTC](https://discuss.elastic.co/t/how-to-migrate-old-index-from-old-server-to-new-server/232460/4 "2020-05-13T16:29:46Z")

</div>

I did almost same thing but still not sure why I am keep getting the same error.

---

<div class="post-metadata">

**Author:** ![dattack13](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dattack13/32/70452_2.png) [@dattack13](https://discuss.elastic.co/u/dattack13)\
**Post date:** [May 13, 2020, 4:32pm UTC](https://discuss.elastic.co/t/how-to-migrate-old-index-from-old-server-to-new-server/232460/5 "2020-05-13T16:32:32Z")

</div>

while passing server name in reindex.remote.whitelist: do we need to provide **old server name** or **current server name**

---

<div class="post-metadata">

**Author:** ![xeraa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xeraa/32/48181_2.png) [@xeraa](https://discuss.elastic.co/u/xeraa)\
**Post date:** [May 14, 2020, 1:24am UTC](https://discuss.elastic.co/t/how-to-migrate-old-index-from-old-server-to-new-server/232460/6 "2020-05-14T01:24:03Z")

</div>

You run the `_reindex` the current cluster (against `otherhost:9200` from the docs) and you also need to whitelist `otherhost:9200` on the current 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:** [June 11, 2020, 1:24am UTC](https://discuss.elastic.co/t/how-to-migrate-old-index-from-old-server-to-new-server/232460/7 "2020-06-11T01:24:03Z")

</div>

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