Database Management

Automate DPA installation

You can automate a DPA installation, upgrade, or uninstallation on Windows or Linux. Use this topic to perform a "silent installation."

First published date

3/15/2022 7:32 PM

Last published date

5/9/2022 8:09 PM

Overview

You can use scripts and commands to automate installing, upgrading, or uninstalling DPA. If you want to perform a "silent installation", use this topic to install DPA, and then see Automate repository creation for information about using scripts and API calls to create the DPA repository. 

 

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

Product section

Database Performance Analyzer

Resolution

Automate DPA installation on Windows

New installation

To perform a new installation, run the following command (replace XXX.Y.ZZZZ with the appropriate numbers):

> SolarWinds-DPA-XXXX.Y.ZZZZ-x64.exe /qn INSTALLDIR="C:\DPA_INSTALLATION_FOLDER"

Upgrade

To upgrade DPA, run the following command (replace XXX.Y.ZZZZ with the appropriate numbers):

> SolarWinds-DPA-XXXX.Y.ZZZZ-x64.exe /qn INSTALLDIR="C:\DPA_INSTALLATION_FOLDER"

Uninstallation

To uninstall DPA, run the following command:

msiexec /x "c:\ProgramData\SolarWinds\Installers\SolarWindsDPASetup-x64.msi" /qn

Automate DPA installation on Linux

Prerequisites

  • The Expect utility must be installed on the Linux computer.
  • The DPA_INSTALLER.tar.gz must be available locally (for example, place all scripts in the /home/dpa/automation folder, and place all tar.gz installer files in the /home/dpa folder).

Create the required scripts

  1. Create the install.exp script in the /home/dpa/automation folder. Include the following content:

    #!/usr/bin/expect -f
    set releaseNumber [lindex $argv 0]
    set timeout -1
    set send_slow {1 .1}
    pwd
    cd ./dpa_${releaseNumber}_x64_installer
    spawn ./dpa_${releaseNumber}_x64_installer.sh
    match_max 100000
    
    expect -exact ""
    sleep .1
    send -s -- "\r"
    
    expect "*--More--*"
    sleep .1
    send -s -- "q"
    
    expect -exact "Do you agree with the license? \[y/n\]: "
    sleep .1
    send -s -- "y\r"
    
    expect -exact "Press \[enter\] to continue..."
    sleep .1
    send -s -- "\r"
    
    expect -exact "Proceed with installation? \[Y/n\]: "
    sleep .1
    send -s -- "y\r"
    
    expect -exact "Enter destination directory for DPA"
    sleep .1
    send -s -- "\r"
    expect eof
    
    cd ..
  2. Create the install.sh script in the /home/dpa/automation folder. Include the following content:

    #!/bin/bash
    DPADir="/home/dpa"
    ScriptDir="/home/dpa/automation"
    
    action=$1
    ReleaseVersionCurrent=$2
    ReleaseVersionUpgrade=$3
    
    ReleaseVersionCurrentUnderscored=$2
    ReleaseVersionCurrentUnderscored=${ReleaseVersionCurrentUnderscored//./_}
    
    ReleaseVersionUpgradeUnderscored=$3
    ReleaseVersionUpgradeUnderscored=${ReleaseVersionUpgradeUnderscored//./_}
    
    if [ "${action}" = "i" ]; then
            ReleaseVersionUpgrade=${ReleaseVersionCurrent}
            ReleaseVersionUpgradeUnderscored=${ReleaseVersionCurrentUnderscored}
    fi
    
    if [ "${action}" = "x" ]; then
        cd ${DPADir}
        cd dpa_${ReleaseVersionCurrentUnderscored}
            ./shutdown.sh
            sleep 30
            cd ..
            rm -rf dpa_${ReleaseVersionCurrentUnderscored}
    
            echo "!!! Uninstalled including config files !!!"
    
            exit 0
    fi
    
    cd ${DPADir}
    tar -xvf SolarWinds-DPA-${ReleaseVersionUpgrade}-64bit.tar.gz
    expect ${ScriptDir}/install.exp $ReleaseVersionUpgradeUnderscored
    
    if [ "${action}" = "u" ]; then
            echo "Stopping DPA..."
            cd dpa_${ReleaseVersionCurrentUnderscored}
            ./shutdown.sh
            sleep 30
            cd ..
    
            echo Copying ignite_config folder from "${ReleaseVersionCurrentUnderscored}" to "${ReleaseVersionUpgradeUnderscored}"
            cp -fr dpa_${ReleaseVersionCurrentUnderscored}/iwc/tomcat/ignite_config/*  dpa_${ReleaseVersionUpgradeUnderscored}/iwc/tomcat/ignite_config/
    
            echo Copying conf folder from "${ReleaseVersionCurrentUnderscored}" to "${ReleaseVersionUpgradeUnderscored}"
            cp -fr dpa_${ReleaseVersionCurrentUnderscored}/iwc/tomcat/conf/*  dpa_${ReleaseVersionUpgradeUnderscored}/iwc/tomcat/conf/
    
            echo Moving licensing folder from "${ReleaseVersionCurrentUnderscored}" to "${ReleaseVersionUpgradeUnderscored}"
            mv dpa_${ReleaseVersionCurrentUnderscored}/iwc/tomcat/licensing dpa_${ReleaseVersionUpgradeUnderscored}/iwc/tomcat
    fi
    
    echo "Starting DPA..."
    cd dpa_${ReleaseVersionUpgradeUnderscored}
    sh startup.sh
    
    echo
    echo "Removing installer..."
    cd ${DPADir}
    rm -rf dpa_${ReleaseVersionUpgradeUnderscored}_x64_installer

New installation

To perform a new installation, run the following command:

> ./install.sh i nnnn.n.nnnn

Where nnnn.n.nnnn is the version of DPA being installed.

For example:

> ./install.sh i 2022.1.7777

Upgrade

To upgrade DPA, run the following command:

> ./install.sh u aaaa.a.aaaa nnnn.n.nnnn

Where aaaa.a.aaaa is the currently installed version and nnnn.n.nnnn is the version of DPA that you are upgrading to.

For example:

> ./install.sh u 2022.1.7777 2022.2.8901

Uninstallation

To uninstall DPA, run the following command:

> ./install.sh x nnnn.n.nnnn

Where nnnn.n.nnnn is the version of DPA being uninstalled.

For example:

> ./install.sh x 2022.2.8901