# Gettting error migrating data stream

**URL:** <https://discuss.elastic.co/t/gettting-error-migrating-data-stream/352947>\
**Category:** Elasticsearch\
**Tags:** migration, datastreams\
**Created:** [February 9, 2024, 2:31pm UTC](https://discuss.elastic.co/t/gettting-error-migrating-data-stream/352947 "2024-02-09T14:31:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![James83](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@James83](https://discuss.elastic.co/u/James83)\
**Post date:** [February 9, 2024, 2:31pm UTC](https://discuss.elastic.co/t/gettting-error-migrating-data-stream/352947/1 "2024-02-09T14:31:43Z")

</div>

Hello,  
I'm in the process of migrating ELK (both servers on same version 7.17). I'm trying to restore an index wich has the ilm-history datastream. The index is restored but I'm getting this error in log :  
java.lang.IllegalArgumentException: setting [index.lifecycle.rollover\_alias] for index [.ds-ilm-history-5-2024.01.23-000040] is empty or not defined

I'm guessing because it is not associated to the ilm-history datastream. So I'm trying to reindex to the data stream using :

```auto
`POST /_reindex
{  
  "source": { "index": ".ds-ilm-history-5-2024.01.30-000040" }, 
  "dest": { "index": "ilm-history-5" }  
}

```

But I get the following error : "only write ops with an op\_type of create are allowed in data streams"  
It seemed to me that this request worked on a previous migration.  
So I have tried to reindex to an existing datastream in the new server but it says that I have to target corresponding data stream instead :  
"reason" : "index request with op\_type=index and no if\_primary\_term and if\_seq\_no set targeting backing indices is disallowed, target corresponding data stream [ilm-history-5] instead"

I am all confused now, any help would be greatly appreciated.

---

<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:** [March 8, 2024, 2:31pm UTC](https://discuss.elastic.co/t/gettting-error-migrating-data-stream/352947/2 "2024-03-08T14:31:54Z")

</div>

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