# Why does es upgrade index data synchronously？

**URL:** <https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226>\
**Category:** Elasticsearch\
**Created:** [September 3, 2021, 1:07am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226 "2021-09-03T01:07:46Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiankunking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jiankunking/32/39320_2.png) [@jiankunking](https://discuss.elastic.co/u/jiankunking)\
**Post date:** [September 3, 2021, 1:07am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/1 "2021-09-03T01:07:46Z")

</div>

When I upgrade from 5.x to 7.x, I find that I cannot upgrade directly and need to reindex all index data. Why not update the index data automatically during the upgrade?

---

<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:** [September 3, 2021, 1:11am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/2 "2021-09-03T01:11:37Z")

</div>

There's been quite a lot of changes between those versions. Different field types, data structures and more. So it's not "simple" to just do it automatically and expect everything to work.

---

<div class="post-metadata">

**Author:** ![jiankunking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jiankunking/32/39320_2.png) [@jiankunking](https://discuss.elastic.co/u/jiankunking)\
**Post date:** [September 3, 2021, 1:14am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/3 "2021-09-03T01:14:14Z")

</div>

But if these things are not resolved, the best solution for a cluster upgrade is:

1. Create a new cluster

2. Enable dual-write and manual historical data synchronization

This is not user friendly

---

<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:** [September 3, 2021, 1:30am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/4 "2021-09-03T01:30:26Z")

</div>

As opposed to what?  
if there was an automatic upgrade system, what should happen to data that cannot be reindexed due to changes? Or data that errors out? How do we handle conflicts and changes?

Take a look at [Upgrade Assistant | Kibana Guide [7.14] | Elastic](https://www.elastic.co/guide/en/kibana/current/upgrade-assistant.html) instead.

---

<div class="post-metadata">

**Author:** ![jiankunking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jiankunking/32/39320_2.png) [@jiankunking](https://discuss.elastic.co/u/jiankunking)\
**Post date:** [September 3, 2021, 2:40am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/5 "2021-09-03T02:40:20Z")

</div>

Index data will not be updated. What contents will be updated when es major version is upgraded?

---

<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:** [September 3, 2021, 2:41am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/6 "2021-09-03T02:41:17Z")

</div>

You mean what indexed data? Only segments that undergo merges after the upgrade, as they will take the new Lucene version.

There's probably also some system indices that will have auto upgrades applied too.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 3, 2021, 5:39am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/7 "2021-09-03T05:39:48Z")

</div>

Elasticsearch uses Lucene and each major version generally corresponds to a new major version of Lucene. One limitation of Lucene with respect yo backwards compatibility is that only the previous major version can be read. Elasticsearch 7.x can therefore not read indices created in Elasticsearch 5.x which makes it impossible to upgrade directly. On top of this you have other breaking changes for each major Elasticsearch release that need to be handled or migrated and adds complexity.

---

<div class="post-metadata">

**Author:** ![jiankunking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jiankunking/32/39320_2.png) [@jiankunking](https://discuss.elastic.co/u/jiankunking)\
**Post date:** [September 3, 2021, 8:00am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/8 "2021-09-03T08:00:11Z")

</div>

If the index template is not compatible with the new version,the template content will be cleared?

---

<div class="post-metadata">

**Author:** ![jiankunking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jiankunking/32/39320_2.png) [@jiankunking](https://discuss.elastic.co/u/jiankunking)\
**Post date:** [September 3, 2021, 8:14am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/9 "2021-09-03T08:14:59Z")

</div>

Now that I think about the ES cluster upgrade, I can see why everyone has to manually import data into the new cluster when upgrading to a larger version.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 3, 2021, 9:01am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/10 "2021-09-03T09:01:23Z")

</div>

If you follow along and upgrade to each new major version and do not need to make large version jumps it is less of a problem and quite well supported.

---

<div class="post-metadata">

**Author:** ![jiankunking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jiankunking/32/39320_2.png) [@jiankunking](https://discuss.elastic.co/u/jiankunking)\
**Post date:** [September 6, 2021, 5:26am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/11 "2021-09-06T05:26:05Z")

</div>

This is difficult, because the production environment will not be updated with the release of ES.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 6, 2021, 5:46am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/12 "2021-09-06T05:46:09Z")

</div>

It is very rare for clusters to upgrade with every release, but it generally makes sense to follow along periodically so that you stay at most one major release behind. Elasticsearch 6.0 was released in November 2017 which is quite a long time ago. Elasticsearch 7.0 has been available for over 2 years as it was released in April 2019.

---

<div class="post-metadata">

**Author:** ![jiankunking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jiankunking/32/39320_2.png) [@jiankunking](https://discuss.elastic.co/u/jiankunking)\
**Post date:** [September 6, 2021, 5:50am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/13 "2021-09-06T05:50:32Z")

</div>

You mean with the ES upgrade, our application adjusts its service code with whom es upgrade?

---

<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:** [October 4, 2021, 5:51am UTC](https://discuss.elastic.co/t/why-does-es-upgrade-index-data-synchronously/283226/14 "2021-10-04T05:51:25Z")

</div>

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