Elasticsearch Upgarde from 7.17.x to 9.x (Ubuntu)
This article describes the procedure to upgrade Elasticsearch from version 7.17.x to 9.3.1 on an Ubuntu environment. The guide includes prerequisite validation, backup procedures, upgrade steps, and post-upgrade verification activities. The procedure helps maintain metadata availability and reduces service interruption during the upgrade process. Follow each step in sequence to ensure a successful Elasticsearch upgrade for the OvalEdge platform.
Prerequisites
Ensure the following prerequisites are completed before starting the upgrade:
Verify sudo or root access on the Ubuntu server.
Verify internet connectivity to download required packages.
Verify sufficient disk space for the existing and upgraded Elasticsearch versions.
Back up the following Elasticsearch directories:
/etc/elasticsearch
/var/lib/elasticsearch
/var/log/elasticsearch
Verify Apache Tomcat services are active before shutdown.
Verify the current Elasticsearch version.
Steps Involved
Backup Existing Elasticsearch Directories
Run the following commands to back up the existing Elasticsearch configuration, data, and log directories:
sudo cp -r /etc/elasticsearch /etc/elasticsearch_backup sudo cp -r /var/lib/elasticsearch /var/lib/elasticsearch_backup sudo cp -r /var/log/elasticsearch /var/log/elasticsearch_backup
Stop Apache Tomcat Services
Stop all Apache Tomcat services to prevent application interruption during the upgrade.
sudo systemctl stop tomcat.service sudo systemctl stop tomcat-ui sudo systemctl stop tomcat-jobVerify the Tomcat service status.
sudo systemctl status tomcat
Verify the Current Elasticsearch Version
Run the following command to verify the currently installed Elasticsearch version:
curl -u elastic:<password> http://localhost:9200Expected response:
{ "version": { "number": "7.17.x" } }
Stop the Elasticsearch Service
Stop the Elasticsearch service before installing the upgraded version.
sudo systemctl stop elasticsearchVerify the Elasticsearch service status:
sudo systemctl status elasticsearch
Download Elasticsearch 9.3.1
Download the Elasticsearch Debian package.
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-9.3.1-amd64.deb
Install Elasticsearch 9.3.1
Install the downloaded Elasticsearch package.
sudo dpkg -i elasticsearch-9.3.1-amd64.debIf dependency issues occur, run the following command:
sudo apt-get install -f -y
Verify the Elasticsearch Data Directory
Verify the Elasticsearch data directory configuration.
sudo grep -i "^path.data" /etc/elasticsearch/elasticsearch.ymlExpected configuration:
path.data: /var/lib/elasticsearchSet the required permissions on the data directory.
sudo chown -R elasticsearch:elasticsearch /var/lib/elasticsearch sudo chmod -R 750 /var/lib/elasticsearch
Reload Systemd Configuration
Reload the systemd configuration and enable the Elasticsearch service.
sudo systemctl daemon-reexec sudo systemctl daemon-reload sudo systemctl enable elasticsearch
Start the Elasticsearch Service
Start the Elasticsearch service.
sudo systemctl start elasticsearch
Verify the Elasticsearch Upgrade
Verify the Elasticsearch service status.
sudo systemctl status elasticsearchVerify the upgraded Elasticsearch version.
curl -u elastic:<password> http://localhost:9200Expected response:
{ "name": "Your_Node_Name", "cluster_name": "elasticsearch", "cluster_uuid": "xxxxxxxxxxxx", "version": { "number": "9.3.1" }, "tagline": "You Know, for Search" }
Update the oasis.properties File (If Password Changes) If the Elasticsearch password changes after the upgrade, update the Elasticsearch credentials in the oasis.properties file.
Navigate to the OvalEdge external properties directory:
cd <OVALEDGE_INSTALLATION_PATH>/extpropOpen the oasis.properties configuration file:
vi oasis.propertiesUpdate the Elasticsearch configuration values:
elasticsearch.username=elastic elasticsearch.password=<new_password> elasticsearch.url=http://localhost:9200Save the changes and exit the editor.
Restart Apache Tomcat Services
Restart all Apache Tomcat services after updating the Elasticsearch configuration.
sudo systemctl start tomcat.service sudo systemctl start tomcat-ui sudo systemctl start tomcat-jobVerify the Tomcat service status:
sudo systemctl status tomcat
Copyright © 2026, OvalEdge LLC, Peachtree Corners, GA, USA.
Last updated
Was this helpful?

