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

  1. 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
  2. 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-job
    • Verify the Tomcat service status.

      sudo systemctl status tomcat
  3. Verify the Current Elasticsearch Version

    • Run the following command to verify the currently installed Elasticsearch version:

      curl -u elastic:<password> http://localhost:9200
    • Expected response:

      {
        "version": {
          "number": "7.17.x"
        }
      }
  4. Stop the Elasticsearch Service

    • Stop the Elasticsearch service before installing the upgraded version.

      sudo systemctl stop elasticsearch
    • Verify the Elasticsearch service status:

      sudo systemctl status elasticsearch
  5. Download Elasticsearch 9.3.1

    • Download the Elasticsearch Debian package.

      wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-9.3.1-amd64.deb
      
  6. Install Elasticsearch 9.3.1

    • Install the downloaded Elasticsearch package.

      sudo dpkg -i elasticsearch-9.3.1-amd64.deb
    • If dependency issues occur, run the following command:

      sudo apt-get install -f -y
  7. Verify the Elasticsearch Data Directory

    • Verify the Elasticsearch data directory configuration.

      sudo grep -i "^path.data" /etc/elasticsearch/elasticsearch.yml
    • Expected configuration:

      path.data: /var/lib/elasticsearch
    • Set the required permissions on the data directory.

      sudo chown -R elasticsearch:elasticsearch /var/lib/elasticsearch
      sudo chmod -R 750 /var/lib/elasticsearch
  8. Reload Systemd Configuration

    • Reload the systemd configuration and enable the Elasticsearch service.

      sudo systemctl daemon-reexec
      sudo systemctl daemon-reload
      sudo systemctl enable elasticsearch
  9. Start the Elasticsearch Service

    • Start the Elasticsearch service.

      sudo systemctl start elasticsearch
  10. Verify the Elasticsearch Upgrade

    • Verify the Elasticsearch service status.

      sudo systemctl status elasticsearch
    • Verify the upgraded Elasticsearch version.

      curl -u elastic:<password> http://localhost:9200
    • Expected response:

      {
        "name": "Your_Node_Name",
        "cluster_name": "elasticsearch",
        "cluster_uuid": "xxxxxxxxxxxx",
        "version": {
          "number": "9.3.1"
        },
        "tagline": "You Know, for Search"
      }
  11. 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>/extprop
    • Open the oasis.properties configuration file:

      vi oasis.properties
    • Update the Elasticsearch configuration values:

      elasticsearch.username=elastic
      elasticsearch.password=<new_password>
      elasticsearch.url=http://localhost:9200
    • Save the changes and exit the editor.

  12. 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-job
    • Verify the Tomcat service status:

      sudo systemctl status tomcat

Copyright © 2026, OvalEdge LLC, Peachtree Corners, GA, USA.

Last updated

Was this helpful?