The following describes the steps for migrating or upgrading an AppDynamics for Databases installation.

Note: Follow each step in order to complete the upgrade successfully.

  1. Backup the encrypted password file.
    Backup the file, <AppD4DB Install Dir>/apache-tomcat/.shared_secret. After installing the latest version of AppDynamics for Databases, you will have to copy over this backup file to the same location in the new installation.
  2. Record the names of the collector processes.

    For Windows only: Use the recreateAllAgents.vbs script to record the names of the collector processes so you can add the processes back after adding the license.  

    Run the recreateAllAgents.vbs script as follows:

    C:\cd <AppD4DB install directory>\agent
    C:\<AppD4DB install directory>\agent\cscript recreateAllAgents.vbs
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved
     
    createMSSQLAgentservice.bat <MSSQL Collector Name>
    createMYSQLAgentservice.bat <MySQL Collector Name>
    createDB2Agentservice.bat <DB2 Collector Name
  3. Stop the Collectors.
    You must stop all AppDynamics for Databases collectors before upgrading or migrating your server.  All collector names have the following format, DBTuna Agent -- collector_name.
    The following are valid ways of stopping the collectors: 
  4. Stop Collector Windows Services (Windows Only)

    Each collector has an associated Windows service. To stop these, use the removeAgentservice.bat script available in the root of the AppDynamics for Databases installation directory. Execute the script from the command line with a single parameter of the collector_name. This is the unique name you gave the collector during configuration.

    D:\<AppD4DB Install Dir>removeAgentservice.bat collector_name

    Optionally, you can simultaneously remove all collectors via the <AppD4DB Install Dir>\agent\removeAllAgents.vbs script. To do this, run the following command from the command line:

    cscript removeAllAgents.vbs
    

     
  5. Stop Accessing the AppDynamics for Databases GUI.
    Ensure the AppDynamic for Databases GUI is not being accessed or used by any user.
  6. Back up historical data.

    AppDynamics for Databases data resides in a MySQL database within the <AppD4DB Install Dir>\mysql directory. You can export this data using the mysqldump utility.

    Note: Ensure you have the required disk space to perform the mysqldump. The mysqldump will require approximately 1.3x the space currently consumed by the <AppD4DB install directory>\mysql\data\dbtuna directory. The mysqldump command could take some time depending on the size of the database to be exported.

    In the following mysqldump.exe syntax examples,  


    mysqldump.exe -P 8091 -u pw -ppw -c --no-create-info dbtuna activity activity_baseline aggr_stats alert_definitions alert_history dbtuna_groups fileio_stats interface_stats monitoredservers os_stats purge_config saved_dataset server_stats session_wait sql_group_desc sql_groups sql_statements sql_stats sql_wait statistics storage_stats system_stats variablechanges vfiler_stats -r <location>\dump.sql
    ./mysqldump --socket=../data/dbtuna.sock -P 8091 -u pw -ppw -c --no-create-info dbtuna activity activity_baseline aggr_stats alert_definitions alert_history dbtuna_groups fileio_stats interface_stats monitoredservers os_stats purge_config saved_dataset server_stats session_wait sql_group_desc sql_groups sql_statements sql_stats sql_wait statistics storage_stats system_stats variablechanges vfiler_stats -r <location>/dump.sql
    

    Note: If you get an error of the type: mysqldump: Couldn't find table: "table name", remove that particular table name from the mysqldump command line parameters. This error means that the table does not exist in your database; it was added in a later version of AppDynamics for Databases.

     Once you have created the dump.sql file, move it out of the <AppD4DB Install Dir>; the next step will remove the current version of the product and all files within the installation directory.

     
  7. Stop AppDynamics for Databases server.
  8. Back up the license key.

    Legacy AppDynamics for Databases license keys are in a file named dbtuna.key in the <AppD4DB install directory\agent directory. Copy this file and back it up to a directory outside of the AppDynamics for Databases installation directory.

    AppDynamics for Databases 2.9 and later version license keys are located in a license.lic file in the <AppD4DB install directory>/apache-tomcat directory. Copy this file and back it up to a directory outside of the server installation directory. 

  9. Uninstall previous version of AppDynamics for Databases.

    Now that you have backed up historical data and removed the collector services, you can remove the old version of the product.

    Uninstalling on Windows

    To uninstall a Windows installation of AppDynamics for Databases, uninstall via Control Panel -> All Control Panel Items -> Programs and Features.

    Uninstalling on Linux

    To uninstall a Linux installation of AppDynamics for Databases, uninstall via the ./stop.sh script in the <AppD4DB install directory> directory and then remove the  AppD4DB install directory.

     
  10. Install new version of AppDynamics for Databases.

    You can download the latest version of AppDynamics for Databases via download.appdynamics.com.

    The installation procedure is described in the online help available, Install AppDynamics for Databases.

  11. Import existing data and configuration.

    Once the new installation is up and running, the next steps are to import the old backed up data and configuration.

    1. Copy back the license key.

      Copy the backup copy of the legacy license dbtuna.key to <AppD4DB install directory>\agent, overwriting the file with the same name.

      Copy the backup copy of license.lic for versions of AppDynamics for Databases 2.9 and later to the <AppD4DB install directory>/apache-tomcat directory.

    2. Copy back the encrypted password file.
      Copy the backup copy of .shared_secret <AppD4DB install directory>/apache-tomcat/, overwriting the file with the same name.
    3. Import old data via dump.sql.

      Note: This step may take some time depending on the size of the exported database.

      1. Copy your dump.sql export file to the <AppD4DB install directory>\mysql\bin directory.

      2. Open a command line session on the server, cmd.exe (Windows) or ssh command line (Linux).

      3. Cd to <AppD4DB install directory>\mysql\bin.

      4. Run startClient.bat (Windows) or ./startClient.sh (Linux) to start a MySQL command line session to the MySQL repository.

      5. Run use dbtuna to switch the database focus to the App4DB database.

      6. Run source dump.sql to start importing the data.

  12. Configure agent Windows services (Windows Only).

    Copy the contents of recreateAllAgents.txt and paste it into the command line similar to the following:

    C:\cd <AppD4DB install directory>\agent\
    C:\<AppD4DB install directory>\agent\createMSSQLAgentservice.bat <MSSQL Collector Name> createMYSQLAgentservice.bat <MySQL Collector Name> createDB2Agentservice.bat <DB2 Collector Name>
  13.  Modify Log On Credentials (If using Windows Authentication for Windows server or SQL Server monitoring collector).
    If you are running AppD4DB SQL Server collector and are using Windows authentication to monitor the SQL Server instance, then you must modify the logon credentials for the newly created Windows services. To modify the logon credentials:
    1. Open Control Panel -> All Control Panel Items -> Administrative Tools -> Windows Services.
    2. Select the DBTuna Agent service.
    3. Right-click and select Properties, and then modify the logon credentials.

Your collectors are now ready to be restarted via the AppDynamics for Databases Collector Administration window! Start the collectors one at a time, and check the log files for error messages if there are any issues.