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.
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 |
<AppD4DB_install_dir>/agent/
and then enter run stopDBTYPEAgent.sh, where DBTYPE is the collector type, as displayed on the Collector Administration window.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 |
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,
-P
parameter in the mysqldump.exe command is the port number you specified when installing AppDynamics for Databases.-ppw
parameter is the password for the AppDynamics for Databases MySQL database. 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.
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.
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.
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.
Once the new installation is up and running, the next steps are to import the old backed up data and configuration.
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.
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.
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> |
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.