# Copy missing documents(from a specific date) from old to new index

**URL:** <https://discuss.elastic.co/t/copy-missing-documents-from-a-specific-date-from-old-to-new-index/37459>\
**Category:** Elasticsearch\
**Created:** [December 17, 2015, 11:09am UTC](https://discuss.elastic.co/t/copy-missing-documents-from-a-specific-date-from-old-to-new-index/37459 "2015-12-17T11:09:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neha\_Agarwal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neha_agarwal/32/6689_2.png) [@Neha\_Agarwal](https://discuss.elastic.co/u/Neha_Agarwal)\
**Post date:** [December 17, 2015, 11:09am UTC](https://discuss.elastic.co/t/copy-missing-documents-from-a-specific-date-from-old-to-new-index/37459/1 "2015-12-17T11:09:55Z")

</div>

I rebuilt the index. When the indexing was done, I deleted old index alias, and added the alias to the new index, as follows:-  
POST /\_aliases  
{  
"actions": [  
{ "remove": { "index": "dfse\_20151211", "alias": "dfse" }},  
{ "add": { "index": "dfse\_20151216", "alias": "dfse" }}  
]  
}

During the reindexing(making of the new index), documents were added to the old index.  
I tried getting the missing documents as below, but I get an error.

elasticdump --input=http://server:9200/dfse\_20151211 --output=http://server:9200/dfse\_20151216 --type=data --bulk=true --limit=500 --bulk-use-output-index-name=true --searchBody="{"query":{"bool":{"must":[{"range":{"asset.submitDate":{"gte":"2015-12-15","lte":"2015-12-17"}}}]}}}"

SyntaxError: Unexpected token q  
at Object.parse (native)  
at Object. (C:\Users\ab85gc\AppData\Roaming\npm\node\_modules\elasticdump\bin\elasticdump:46:23)  
at Module.\_compile (module.js:460:26)  
at Object.Module.\_extensions..js (module.js:478:10)  
at Module.load (module.js:355:32)  
at Function.Module.\_load (module.js:310:12)  
at Function.Module.runMain (module.js:501:10)  
at startup (node.js:129:16)  
at node.js:814:3

What am I doing wrong?

---

<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:30pm UTC](https://discuss.elastic.co/t/copy-missing-documents-from-a-specific-date-from-old-to-new-index/37459/2 "2017-07-05T23:30:13Z")

</div>


