java.lang.Object
com.inductiveautomation.ignition.common.upgrader.Upgrader

public final class Upgrader extends Object
  • Field Details

    • JAVA_SET_UPGRADE_PATTERN

      public static final Pattern JAVA_SET_UPGRADE_PATTERN
    • JAVA_SET_CORRECT_PATTERN

      public static final Pattern JAVA_SET_CORRECT_PATTERN
  • Method Details

    • main

      public static void main(String[] args)
      The main method is designed to be called from the installer executables. Usage is as follows:

      args[0]= the path to the base install folder. The installer executable knows what this path is.

      args[1]= the path to the data folder. The installer executable also knows what this path is.

      args[2]= the path to the logs folder. The installer executable also knows what this path is.

      args[3]= the file to process. Passing "file=ignition.conf" will cause the upgrader to add items to ignition.conf until it has all items required at the CURRENT_VERSION variable. Change this to whitelabel.conf as needed for white label builds. Passing "file=config.xml" should only be used when upgrading a pre-7.3 installation to 7.3 or later. It will cause the upgrader to retrieve information from config.xml, such as the http port and ssl port that are used by the current installation. These values are then added to gateway.xml.

    • updateGatewayXmlParams

      public static void updateGatewayXmlParams(String path) throws Exception
      Update gateway.xml entries with keys that contain "catapult" to "gateway" for 8.0 compatibility.
      Throws:
      Exception
    • removeConfigXML

      public static void removeConfigXML(String basePath, String dataDirPath) throws Exception
      This method should only be used when upgrading before 7.3 to 7.3 and later. It will take values from config.xml and place them in gateway.xml.
      Parameters:
      basePath - The path to the installation folder.
      dataDirPath - The path to the data folder.
      Throws:
      Exception
    • upgradeGatewayXML

      public static void upgradeGatewayXML(File gatewayXML, String portXML, String sslPortXML) throws Exception
      Updates gateway.xml from a pre-7.3 version either during an upgrade or during a backup restoration from before 7.3
      Parameters:
      gatewayXML - The File object that represents gateway.xml on the local machine
      portXML - The XML line that contains the "catapult.port" entry. Example: <entry key="catapult.port">8088</entry>
      sslPortXML - The XML line that contains the "catapult.sslport" entry. Example: <entry key="catapult.sslport">8043</entry>
      Throws:
      Exception
    • upgradeWebXml

      public static void upgradeWebXml(String installDirPath) throws Exception
      Modifies webserver\webapps\main\WEB-INF\web.xml such that items like SRFilter is updated to GatewayFilter
      Throws:
      Exception
    • upgradeLogbackXml

      public static void upgradeLogbackXml(Path logbackXmlPath) throws IOException
      Performs corrections to existing logback.xml configuration
      Parameters:
      logbackXmlPath - The path to the logback.xml file
      Throws:
      IOException
    • upgradeLaunchFile

      public static void upgradeLaunchFile(String installDirPath, String dataDirPath, String logsDir, String fileToUpgrade) throws Exception
      Adds lines to or removes lines from ignition.conf to bring it up to date with the latest Ignition version. RestorePanel.java also calls this method during a restoration in case ignition.conf is from an older backup.
      Parameters:
      installDirPath - The path to the main installation dir
      dataDirPath - The path to the data dir. It is expected that when upgrading to 7.3 or later, the ignition.conf would have been moved from /contexts/main to the data dir before calling this method.
      logsDir - The path to the logs dir
      fileToUpgrade - Normally will be ignition.conf, but for a white label build, this file name will vary
      Throws:
      Exception