Class UpgradeManager


  • public class UpgradeManager
    extends java.lang.Object

    The UpgradeManager is the class responsible to perform an upgrade. It manages a list of UpgradeModule instances. Each module has a name and a description that can be used for informative purpose. Most of them, can be programatically disabled before running the upgrade. Users can check which modules can be disabled by checking the module's canChangeEnabled() method.

    To run an upgrade, first create and populate an UpgradeInfo instance. On the UpgradeInfo specify the base folder (that is, the location of the out-of-the-box Microstrategy Web version being upgraded), the customization folder (that is, the location of the customized version of Microstrategy Web being upgraded), the target folder (that is, the location of the new Microstrategy Web version), and the name of the plugin where the changes will be saved. This UpgradeInfo is then passed to the run(com.microstrategy.web.app.utils.upgrade.UpgradeInfo) method, which will loop through each one of its modules and execute those that are enabled.

    The following is an example of how an upgrade can be performed:

    public void upgrade() throws Exception { UpgradeManager um = new UpgradeManager(); UpgradeInfo info = new UpgradeInfo( "c:\\Program Files\\Microstrategy Web 8.0.2\\", "c:\\Program Files\\Custom Microstrategy Web\\", "c:\\Program Files\\Microstrategy Web\\", "Upgrade"); try { um.run(info); } catch (UpgradeException e) { System.out.println(e.getMessage()); } Once the upgrade is complete and successfull (i.e. no UpgradeException is thrown, this class provides a method to list the all the messages that were logged as part of the upgrade process (getMessages()); it also provides helper method to list only errors, (getErrors(), warnings (getWarnings(), or information messages (getInfo().
    Since:
    MicroStrategy Web 9.0.0
    • Constructor Detail

      • UpgradeManager

        public UpgradeManager​(java.lang.String customFolder)
        Default no-arg constructor.
        Since:
        MicroStrategy Web 9.0.1
    • Method Detail

      • getUpgradeModules

        public UpgradeModule[] getUpgradeModules()
        Returns the list of available modules.
      • run

        public void run​(UpgradeInfo info)
                 throws UpgradeException
        Performs the upgrade. Basically, it loops through each one of its modules and execute those modules that are enabled
        Parameters:
        info - UpgradeInfo class with information about the folders to upgrade.
        Throws:
        UpgradeException - if any unexpected error occurs during the upgrade.
      • getLogger

        public static Logger getLogger()
        Returns the Logger class used by this package. Users can then attach handlers and filters to this Logger programatically to keep track of messages being logged during the upgrade.
      • getMessages

        public LogRecord[] getMessages()
        Returns the list of all messages logged during the upgrade.
      • getErrors

        public LogRecord[] getErrors()
        Returns the list of all error messages logged during the upgrade.
      • getWarnings

        public LogRecord[] getWarnings()
        Returns the list of all warning messages logged during the upgrade.
      • getInfo

        public LogRecord[] getInfo()
        Returns the list of all info messages logged during the upgrade.