Error: ElasticSearch won't start when downgraded from 8.9.2 to 8.4.1

I see this error when I try to downgrade. The version of elasticsearch is 8.4.1, but the service won't start.
[2023-09-12T09:52:39,253][ERROR][o.e.b.Elasticsearch ] fatal exception while booting Elasticsearch
java.lang.IllegalArgumentException: Could not load codec 'Lucene95'. Did you forget to add lucene-backward-codecs.jar?
at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:515) ~[lucene-core-9.3.0.jar:?]

Elasticsearch does not support downgrades. If you want to downgrade you will need to restore your data from a snapshot into an empty cluster.

Why are you looking to downgrade?

I want to be able to downgrade in case I run into an issue upgrading version in Production.
So I am trying to get the downgrade to work in lower environment.
I can't even start elasticsearch, I am not worried about data.
I want to be able to start Elasticsearch and if you can tell me how to fix the lucene95 codec, I would appreciate it.
I can run pipelines and get my indices populated.

You need to install a clean cluster of the old version and restore data from a snapshot.

What do you mean by install a clean cluster?
Like I said, I don’t worry about data, we run pipelines nightly, and don’t worry about historical data.

You need to clear the data path and start up completely empty.

Do you mean I have to delete all the data in the indices?

But the error I see in the logs is about Lucene95 not being there.
How does this error get resolved, if I delete the data?

The error is because some of your data needs a codec called Lucene95 to read it. If you delete the data, there's nothing that requires that codec any more.

It's not really a "downgrade" that you're doing tho, it's just a reinstall.

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