I have Magento CE 2.4.6 running on a Ubuntu server with Elasticsearch 8.11.4. For a mandatory module I absolutely need, I need to downgrade to ES 7.9.3.
I read everywhere it was not possible to downgrade ES. Is there a way to uninstall ES 8.4.11 and install ES 7.9.3 without damaging the system? If yes, how?
(I don’t want to make any mistakes)
2
Answers
The upgrade from 7.x to 8.x creates changes in indices and configurations that are not easy revesible.
Suggestion: build a test 7.x cluster and add the snapshot repositroy from 8.x as READ-ONLY. Import your indices one by one and test to see if you can still use them or what changes are necessary so you can revert them to 7.x . Once you tested all of them and you know it is doable, make a prod cluster and migrate all closed indices . Then test your integrations and plan a rupture day. You can migrate services one by one to minimize data loss or make a planed downtime .
You also need to read all the breaking changes inbetween your versions
As what @TudorIftimie have said, it is indeed impossible for you to downgrade. Consider using the snapshot backup and restore. Here’s an example of what you might come up with,
and the output is:
Due to that constraint, I suggest you use the Elasticdump. This provides you convenience to migrate or dump your indices from a higher version to a lower version. To do that, just use the following approach:
Specific only to Ubuntu which I tested this
In my cluster which has 8.1.3, I have the following indices called
the_mini_force
. Now, I wanted to dump this to 7.17.6 version, I imply run:Migrate the data mapping
Migrate the actual data
To explain further, my test shows you a cluster with a SSL certificate. Since I have just only a self-signed cert, you need to add
NODE_TLS_REJECT_UNAUTHORIZED=0
if that is your case. Otherwise, you can just ignore that. Also you can see I supplied the cert location for both different version clusters. Which basically192.168.40.141:9200
run on 8.1.3, and192.168.40.146:9200
runs on 7.17.6.This allows me to migrate data efficiently from higher version going to lower version. In fact, you can also do this vice-versa if you want to migrate from lower version to higher version as well and it works.
I suggest you try and test this. On my end, I use ClusterControl to allow me to test efficiently on Elasticsearch 8.1.3 version and Elasticsearch 7.17.6 version if that helps you test with speed. Good luck!