# Migrate parent-child documents from ES 1.5.2 to 2.3

**URL:** https://discuss.elastic.co/t/migrate-parent-child-documents-from-es-1-5-2-to-2-3/56079
**Category:** Elasticsearch
**Created:** [July 21, 2016, 9:43am UTC](https://discuss.elastic.co/t/migrate-parent-child-documents-from-es-1-5-2-to-2-3/56079 "2016-07-21T09:43:26Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Moshe\_Sucaz](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@Moshe\_Sucaz](https://discuss.elastic.co/u/Moshe_Sucaz)
#### Post date: [July 21, 2016, 9:43am UTC](https://discuss.elastic.co/t/migrate-parent-child-documents-from-es-1-5-2-to-2-3/56079/1 "2016-07-21T09:43:26Z")

</div>

Hi,  
I am writing a python script to migrate all our docs from 1.5.2 cluster to 2.3 cluster. I am using my own script because we have to change the parent docs, due to fields with dots and some more mapping changes, and also because we are using 2 clusters to do it. I have a question regarding the children docs:  
What is the best way to migrate children documents which have only mapping changes? -

1. For each parent doc, change it to fit 2.3, index it to the new cluster, search for its children in the old cluster and index them also to the new one using the bulk API that will have 0-100 documents

2. Take all parent docs, change them, index them all and only when done index all children using the bulk API that will have default number of docs

Thanks!

---

<div class="post-metadata">

### Author: ![a2tirb](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@a2tirb](https://discuss.elastic.co/u/a2tirb)
#### Post date: [July 21, 2016, 12:29pm UTC](https://discuss.elastic.co/t/migrate-parent-child-documents-from-es-1-5-2-to-2-3/56079/2 "2016-07-21T12:29:53Z")

</div>

Hi,  
you should be able to index all documents independently. There should be no need to index parents first and then the children. Children documents can be indexed as orphans. Or maybe I am misunderstanding the question?

---

<div class="post-metadata">

### Author: ![Moshe\_Sucaz](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@Moshe\_Sucaz](https://discuss.elastic.co/u/Moshe_Sucaz)
#### Post date: [July 21, 2016, 12:57pm UTC](https://discuss.elastic.co/t/migrate-parent-child-documents-from-es-1-5-2-to-2-3/56079/3 "2016-07-21T12:57:23Z")

</div>

Cool! I didn't know that. So, If I index in new cluster, an orphan child (with specified parent ID that not exist yet) and later on its parent, I will not get any errors? And when finish to re-index all, searching for parent with child will return results as usual?

Thanks!

---

<div class="post-metadata">

### Author: ![a2tirb](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@a2tirb](https://discuss.elastic.co/u/a2tirb)
#### Post date: [July 21, 2016, 1:25pm UTC](https://discuss.elastic.co/t/migrate-parent-child-documents-from-es-1-5-2-to-2-3/56079/4 "2016-07-21T13:25:52Z")

</div>

Yes, that should work. Try it out and come back here if you run into an issue.

---

<div class="post-metadata">

### Author: ![Moshe\_Sucaz](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@Moshe\_Sucaz](https://discuss.elastic.co/u/Moshe_Sucaz)
#### Post date: [July 21, 2016, 1:27pm UTC](https://discuss.elastic.co/t/migrate-parent-child-documents-from-es-1-5-2-to-2-3/56079/5 "2016-07-21T13:27:24Z")

</div>

Thanks! I will do that.

---

<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 5, 2017, 10:33pm UTC](https://discuss.elastic.co/t/migrate-parent-child-documents-from-es-1-5-2-to-2-3/56079/6 "2017-07-05T22:33:42Z")

</div>


