# Reindex data from Elasticsearch 1.X to ElastichSearch with old \_timeStamp to new Field

**URL:** https://discuss.elastic.co/t/reindex-data-from-elasticsearch-1-x-to-elastichsearch-with-old--timestamp-to-new-field/80597
**Category:** Elasticsearch
**Created:** [March 30, 2017, 6:42am UTC](https://discuss.elastic.co/t/reindex-data-from-elasticsearch-1-x-to-elastichsearch-with-old--timestamp-to-new-field/80597 "2017-03-30T06:42:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Joachim\_Andersson](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Joachim\_Andersson](https://discuss.elastic.co/u/Joachim_Andersson)
#### Post date: [March 30, 2017, 6:42am UTC](https://discuss.elastic.co/t/reindex-data-from-elasticsearch-1-x-to-elastichsearch-with-old--timestamp-to-new-field/80597/1 "2017-03-30T06:42:15Z")

</div>

I am trying to migrate my data from an old Elasticsearch(Version 1.4.4) Cluster to a new one (5.1)

I am using the reindex api in the new Elasticsearch, but can't get the old \_timestamp to a new field timestamp. Everything else works fine.

trying to do something like this.

```
POST _reindex
{
  "source": {
    "remote": {
      "host": "http://oldhost:9200"
    },
    "index": "source"
    "query": {
       "match_all": {}
    }
  },
  "dest": {
    "index": "dest"
  },
  "script": {
    "lang": "painless",
    "inline": "ctx._source.timestamp = ctx._timestamp
  }
}

```

but the field timestamp in the new index is null.

---

<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: [April 27, 2017, 6:42am UTC](https://discuss.elastic.co/t/reindex-data-from-elasticsearch-1-x-to-elastichsearch-with-old--timestamp-to-new-field/80597/2 "2017-04-27T06:42:23Z")

</div>

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