# Resetting versions

**URL:** <https://discuss.elastic.co/t/resetting-versions/324994>\
**Category:** Elasticsearch\
**Created:** [February 8, 2023, 10:13am UTC](https://discuss.elastic.co/t/resetting-versions/324994 "2023-02-08T10:13:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Limess](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limess/32/116936_2.png) [@Limess](https://discuss.elastic.co/u/Limess)\
**Post date:** [February 8, 2023, 10:13am UTC](https://discuss.elastic.co/t/resetting-versions/324994/1 "2023-02-08T10:13:29Z")

</div>

Hello,

I've seen a few posts on this in the past but was wondering if there's any newer solution:

We have had issues in production where we indexed documents with an external, then had to restore older versions of the document from backups to our external stores. We've since re-indexed updates to these documents content in Elasticsearch but the old external version remains.

e.g. as a primitive example

Datastore version 1000  
ES \_version 10000

with the same document content.

Is there any way, aside from:

1. Delete document by ID from ES
2. Wait index.gc\_deletes
3. Index into ES with same document

to reset these version numbers?

For example, if we still have the intended version in the \_source.version field, can we replace the \_version field with \_source.version in a reindex API call and have elasticsearch respect that?

We have a large elasticsearch cluster (\>1.5 billion documents of very high complexity). As such, we have no strong desire to re-index the whole cluster to reset these versioning issues which affect ~2 million documents.

Additionally, we have issues where processes have been known write to ES with versioning not set to external. This is causing us later pain with versioning, as we have to design our entire external versioning schema to take into account that ES increments versions by 1 in these cases. Is there any way to change this behaviour so as to not increment the version?

Thanks for any help on this topic.

---

<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:** [February 14, 2023, 5:25am UTC](https://discuss.elastic.co/t/resetting-versions/324994/2 "2023-02-14T05:25:34Z")

</div>

Welcome to our community! 😃

What version of Elasticsearch are you on?

> [@Limess](#):
>
> We've since re-indexed updates to these documents content in Elasticsearch but the old external version remains.

Are you using the same `_id` and putting it into the same index?

---

<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 14, 2023, 5:26am UTC](https://discuss.elastic.co/t/resetting-versions/324994/3 "2023-03-14T05:26:03Z")

</div>

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