# Migrate from rollover aliases to data streams

**URL:** <https://discuss.elastic.co/t/migrate-from-rollover-aliases-to-data-streams/252161>\
**Category:** Elasticsearch\
**Created:** [October 15, 2020, 9:47am UTC](https://discuss.elastic.co/t/migrate-from-rollover-aliases-to-data-streams/252161 "2020-10-15T09:47:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julien_henry/32/77019_2.png) [@Julien\_HENRY](https://discuss.elastic.co/u/Julien_HENRY)\
**Post date:** [October 15, 2020, 9:47am UTC](https://discuss.elastic.co/t/migrate-from-rollover-aliases-to-data-streams/252161/1 "2020-10-15T09:47:11Z")

</div>

Hi,

I'm just discovering the new [data stream](https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html) concept in Elastic Cloud 7.9.2.  
We are ingesting time based documents, so this seems the perfect fit.

Previously, we were using rollover\_alias.

I have created the data stream, and I would like to do a smooth transition from the old "way".

Let say my previous configuration was:

```auto
PUT _template/old_template
{
  "index_patterns": ["my-index-*"],                 
  "settings": {
    "index.lifecycle.name": "old_policy",      
    "index.lifecycle.rollover_alias": "my-document-writer"
  },
  "aliases": {
    "search-all": {}
  }
}

PUT %3Cmy-index-%7Bnow%2Fd%7D-000001%3E
{
  "aliases": {
    "my-document-writer": {
      "is_write_index": true
    },
    "search-all"
  }
}

```

So basically all my clients are configured to POST new documents to the `my-document-writer` alias.

How can I change the destination to be the data stream without changing all my clients? My idea was to atomically change the `my-document-writer` alias to "target" the data stream, but documentation says that

> You cannot add data streams to an index alias.

Any suggestion?

---

<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 12, 2020, 9:47am UTC](https://discuss.elastic.co/t/migrate-from-rollover-aliases-to-data-streams/252161/2 "2020-11-12T09:47:11Z")

</div>

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