# Restore historical into data stream

**URL:** <https://discuss.elastic.co/t/restore-historical-into-data-stream/304523>\
**Category:** Elasticsearch\
**Tags:** datastreams, snapshot-and-restore\
**Created:** [May 12, 2022, 6:15am UTC](https://discuss.elastic.co/t/restore-historical-into-data-stream/304523 "2022-05-12T06:15:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jasper\_Nygaard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasper_nygaard/32/4238_2.png) [@Jasper\_Nygaard](https://discuss.elastic.co/u/Jasper_Nygaard)\
**Post date:** [May 12, 2022, 6:15am UTC](https://discuss.elastic.co/t/restore-historical-into-data-stream/304523/1 "2022-05-12T06:15:25Z")

</div>

Just moved to Elastic Cloud from on-onprem for our logging, setting up data streams instead of using date based indices. I now need to restore our historical data from snapshots - anyway to restore these into the data stream format?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 12, 2022, 6:27am UTC](https://discuss.elastic.co/t/restore-historical-into-data-stream/304523/2 "2022-05-12T06:27:36Z")

</div>

You can't directly do that, as datastreams expect the data to be indexed in.

[Set up a data stream | Elasticsearch Guide [8.2] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.2/set-up-a-data-stream.html#convert-index-alias-to-data-stream) might work if you were using aliases previously.

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [May 12, 2022, 7:29am UTC](https://discuss.elastic.co/t/restore-historical-into-data-stream/304523/3 "2022-05-12T07:29:01Z")

</div>

Maybe [the modify data stream api](https://www.elastic.co/guide/en/elasticsearch/reference/8.2/modify-data-streams-api.html) may also help here. If you already have a data stream and you just like to add some restored indices to it then this should work. These indices will need to have a `@timestamp` field, otherwise it will not be possible to add these indices to a data stream.

---

<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:** [June 9, 2022, 7:29am UTC](https://discuss.elastic.co/t/restore-historical-into-data-stream/304523/4 "2022-06-09T07:29:46Z")

</div>

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