If you have not reindexed your indices to version 7 (and your index was not from version 5 and below) then you can downgrade to version 6, most probably without data loss. Elasticsearch does not support downgrading as a feature. So in order to “downgrade” from version 7 to version 6 you will need to uninstall version 7 and reinstall version 6. On Ubuntu this can look like the following:
sudo service elasticsearch stop sudo apt-get remove elasticsearch wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - sudo apt-get install apt-transport-https echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list sudo apt-get update && sudo apt-get install elasticsearch
If you are running Elasticsearch on AWS then you will need to:
- Create a manual snapshot of your version 7
- Restore the snapshot to version 6
I have not tried the above on AWS but for more information please check the links below:
Elasticsearch 7 can only read indices created from version 6 onwards, so your indices from 5 and below will not work anymore. There are restrictions add to the index names as well for example column symbol i.e : is not allowed in the index name anymore. The list of breaking changes are significant and you should make it a must to read the whole list before upgrading: https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html
The key lesson to take here is that major versions contain breaking changes and might not be backward compatible. And that you should first upgrade to a staging server and make sure that all your tests pass before upgrading to production.