# Reindex using bulk api

**URL:** <https://discuss.elastic.co/t/reindex-using-bulk-api/31713>\
**Category:** Elasticsearch\
**Created:** [October 6, 2015, 3:44pm UTC](https://discuss.elastic.co/t/reindex-using-bulk-api/31713 "2015-10-06T15:44:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![noelyim](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@noelyim](https://discuss.elastic.co/u/noelyim)\
**Post date:** [October 6, 2015, 3:44pm UTC](https://discuss.elastic.co/t/reindex-using-bulk-api/31713/1 "2015-10-06T15:44:17Z")

</div>

"To reindex all of the documents from the old index efficiently, use scan-and-scroll to retrieve batches of documents from the old index, and the bulk API to push them into the new index."

1. Is there an example for the above statement? I have followed [Index Aliases and Zero Downtime](https://www.elastic.co/guide/en/elasticsearch/guide/current/index-aliases.html) and my existing doc are still under the old index, I want them in my new index (because I have new mapping). Both indices have the same typename.  
What is the exact syntax?  
`POST /newIndexName/_bulk { "index" : { "_index" : "oldIndexName" ,"_type" : "theOnlyType" } }`
2. I have elasticsearch 1.7 and I do not see \_bulk show up using Sense. As if there is no \_bulk API? When I use `POST /oldIndexName/_bulk` and Sense shows `error:JsonParseException[Unexpected end-of-input: expected close marker for OBJECT (from [Source [B@54721lee5; line: 1, column: 0])\n at [Source: [B@54721ee5; line: 1, column:3]]", "status": 500}`

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 6, 2015, 10:39pm UTC](https://discuss.elastic.co/t/reindex-using-bulk-api/31713/2 "2015-10-06T22:39:50Z")

</div>

I just use Logstash with this config - [https://gist.github.com/markwalkom/8a7201e3f6ea4354ae06](https://gist.github.com/markwalkom/8a7201e3f6ea4354ae06)

---

<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, 11:46pm UTC](https://discuss.elastic.co/t/reindex-using-bulk-api/31713/3 "2017-07-05T23:46:19Z")

</div>


