# How to preserve timestamp while re-indexing?

**URL:** https://discuss.elastic.co/t/how-to-preserve-timestamp-while-re-indexing/251461
**Category:** Elasticsearch
**Created:** [October 8, 2020, 2:18pm UTC](https://discuss.elastic.co/t/how-to-preserve-timestamp-while-re-indexing/251461 "2020-10-08T14:18:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![srbhklkrn](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@srbhklkrn](https://discuss.elastic.co/u/srbhklkrn)
#### Post date: [October 8, 2020, 2:18pm UTC](https://discuss.elastic.co/t/how-to-preserve-timestamp-while-re-indexing/251461/1 "2020-10-08T14:18:31Z")

</div>

I'm reindexing from 6.4 to 7.9 and while I got all documents as it is one thing I noticed timestamp is different, how do I preserve old timestamp in the document?

---

<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: [October 8, 2020, 2:29pm UTC](https://discuss.elastic.co/t/how-to-preserve-timestamp-while-re-indexing/251461/2 "2020-10-08T14:29:33Z")

</div>

How did you reindex?

---

<div class="post-metadata">

### Author: ![srbhklkrn](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@srbhklkrn](https://discuss.elastic.co/u/srbhklkrn)
#### Post date: [October 8, 2020, 2:33pm UTC](https://discuss.elastic.co/t/how-to-preserve-timestamp-while-re-indexing/251461/3 "2020-10-08T14:33:29Z")

</div>

Hi dadoonet,

Thanks for the quick replay, here is how I'm reindexing it:

```
 curl -X POST "https://els02:9200/_reindex?pretty" -u admin:admin --insecure -H 'Content-Type: application/json' -d'
    {
      "source": {
        "remote": {
          "host": "http://elk01:9200"
        },
        "index": "logstash-2020.10.07"
      },
      "dest": {
        "index": "logstash-2020.10.07"
      }
    }
    '
```

---

<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: [October 8, 2020, 2:48pm UTC](https://discuss.elastic.co/t/how-to-preserve-timestamp-while-re-indexing/251461/4 "2020-10-08T14:48:14Z")

</div>

Do you have an example of a document from the source which has a different content in the destination? Could you share both?

---

<div class="post-metadata">

### Author: ![srbhklkrn](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@srbhklkrn](https://discuss.elastic.co/u/srbhklkrn)
#### Post date: [October 8, 2020, 2:51pm UTC](https://discuss.elastic.co/t/how-to-preserve-timestamp-while-re-indexing/251461/5 "2020-10-08T14:51:03Z")

</div>

dadoonet I'm sorry for the trouble I misread it, this is embarrassing 🤦‍♂️  
the timestamp is preserved.

---

<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: [November 5, 2020, 2:51pm UTC](https://discuss.elastic.co/t/how-to-preserve-timestamp-while-re-indexing/251461/6 "2020-11-05T14:51:03Z")

</div>

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