Elasticsearch/Opensearch query

Hello, I would like to know if there’s a way to migrate from Elasticsearch to OpenSearch but keep using the same data directory. Is there a way to stop either the Elasticsearch daemon or OpenSearch daemon and the one that stays up using the data directory so I can switch between the two whenever I want? Is there a way I can use it with Kibana as well? I really appreciate any help you can provide.

It depends on which version of Elasticsearch you are currently running.
if it’s up until 7.13 (I think), should be as easy as installing Opensearch unless you use X-Pack, in which case you need to downgrade first I believe.
If it’s above 7.13, your luck may vary. Elastic Co. has taken many anti competitive steps to make leaving as painful as possible, so it really really depends on your specific case.

Thanks, @hagayg for your response. I’ll be more clear with what is it that I want to achieve. Let’s say for example that I’ve Elasticsearch 7.10.2 installed and want to install OpenSearch as well on the same box. Can they coexist together? I would say yes since OpenSearch is based on Elasticsearch 7.10.2. But my use case is that I want to have both installed and sharing the same data directory so that when one goes down the other still responds and provides the indices, is that clear? Like if I stop ES daemon OS takes over and vice versa. Thanks in advance.

I won’t do that even with two Elasticsearch clients. Write locks and such would make it configuration hell if it’ll even work and make for an abysmal experience. Not to mention the primary resource hog is the OS file system cache, which… Will be the same, so you’re basically using the same thing twice with no upside.

Both Elasticsearch and Opensearch ARE meant to work as a sharded cluster though in order to provide High Availability, so why aren’t you using them as such?

@hagayg thanks so much you’ve been of great help here. The last question, can I also use the same data with al its graphs from kibana in opendashboard?.

Elasticsearch 7.10.2 should be fine for both if I recall correctly. Much later versions, once again and for the same reasons, probably not.