# Reindexing Old index

**URL:** <https://discuss.elastic.co/t/reindexing-old-index/278360>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management, reindex\
**Created:** [July 11, 2021, 1:56pm UTC](https://discuss.elastic.co/t/reindexing-old-index/278360 "2021-07-11T13:56:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [July 11, 2021, 1:56pm UTC](https://discuss.elastic.co/t/reindexing-old-index/278360/1 "2021-07-11T13:56:38Z")

</div>

I want to reindex old index but the problem my alias is writing to current index

```auto
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open log-wlb-sysmon-2021.06.09-000007 9CmsyVUGT26UwxID3LT8Xw 1 1 82308203 53179 100gb 50gb
green open log-wlb-sysmon-2021.05.31-000006 nL70VTUmQ7iuPsJusGHBsw 1 1 85460152 89372 99.9gb 50gb
green open log-wlb-sysmon-2021.06.25-000009 HXwRnl8QRq6F_BCmztlBHw 1 1 78000899 38081 100gb 50gb
green open log-wlb-sysmon-2021.07.10-000010 cL1mz5t4RWyNXaoCFmU-cw 1 1 65473320 0 83.1gb 41.5gb
green open log-wlb-sysmon-2021.06.17-000008 VMIdvZhhQ7eDrtBrrk2t0w 1 1 81276018 46164 100gb 49.9gb
green open log-wlb-sysmon-2021.07.11-000011 rhKip49IRLeK2Ifjzodd-g 1 1 402028 38730 543.7mb 274.6mb

```

i am facing maping conflict problem in `log-wlb-sysmon-2021.06.17-000008` how can i reindex my old index  
i ran the following commands:  
1.

```auto
{
"aliases": {
   "log-wlb-sysmon": {
      "is_write_index": false  
   }
 }
}

```

1. 

```auto
POST _reindex?max_docs=	81276018&wait_for_completion=false
{
  "conflicts": "proceed"
  , "source": {
    "index": "log-wlb-sysmon-2021.06.17-000008"
    },
   "dest": {
    "index": "log-wlb-sysmon-2021.07.11-000008"
  }
}

```

after a minute i phase `java.lang.IllegalArgumentException: index.lifecycle.rollover_alias [log-wlb-sysmon] does not point to index [log-wlb-sysmon-2021.07.11-000008] `  
log-wlb-sysmon(alias) is writing `log-wlb-sysmon-2021.07.10-000010`  
I also tried to change alias name nothing happened

```auto
PUT %3Clog-wlb-sysmon-%7Bnow%2Fd%7D-000008%3E 
{
"aliases": {
   "<log-wlbsysmon_{now/M}>": {
      "is_write_index": true     
   }
 }
}

```

How can i reindex my old index data and also my current alias is also writing to current index

---

<div class="post-metadata">

**Author:** ![ritchierich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ritchierich/32/4329_2.png) [@ritchierich](https://discuss.elastic.co/u/ritchierich)\
**Post date:** [July 12, 2021, 6:57am UTC](https://discuss.elastic.co/t/reindexing-old-index/278360/2 "2021-07-12T06:57:18Z")

</div>

@Aniket_Pant

Based on index names looks like your trying to reindex older data into a current index. I'd suggest just adding "-reindex" to the destination index.

```auto
POST _reindex?max_docs=	81276018&wait_for_completion=false
{
  "conflicts": "proceed"
  , "source": {
    "index": "log-wlb-sysmon-2021.06.17-000008"
    },
   "dest": {
    "index": "log-wlb-sysmon-2021.06.17-000008-reindex"
  }
}

```

Also, after you create new destination remove any alias from the destination index.

Hope this helps.

Cheers,  
Rich

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [July 18, 2021, 3:48am UTC](https://discuss.elastic.co/t/reindexing-old-index/278360/3 "2021-07-18T03:48:58Z")

</div>

`illegal_argument_exception: index [log-wlb-sysmon-2021.07.18-000019] is not the write index for alias [log-wlb-sysmon]`  
I am getting this error  
i made an index , i am using ilm so i need to create this timeseries indices  
After that

```auto
PUT %3Clog-wlb-sysmon-reindex-%7Bnow%2Fd%7D-000020%3E  
{
"aliases": {
   "log-wlb-sysmon": {
      "is_write_index": false     
   }
 }
}

```

```auto
POST _reindex?max_docs=1623237&wait_for_completion=false
{
  "conflicts": "proceed"
  , "source": {
    "index": "log-wlb-sysmon-2021.07.17-000018"
    
  }
  , "dest": {
    "index": "log-wlb-sysmon-reindex-2021.07.18-000021"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [July 18, 2021, 3:50am UTC](https://discuss.elastic.co/t/reindexing-old-index/278360/4 "2021-07-18T03:50:51Z")

</div>

basically i want live data also and past data also like today data is streaming to today index and past data is also streaming to the index we've created

---

<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:** [August 15, 2021, 3:51am UTC](https://discuss.elastic.co/t/reindexing-old-index/278360/5 "2021-08-15T03:51:11Z")

</div>

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