How to transfer ABA analysis server data to a later APM release.

Document ID : KB000058142
Last Modified Date : 20/08/2018
Show Technical Document Details
Introduction:

This covers the steps needed to copy ABA analysis server data to a later APM release.

 

Instructions:

Use the following steps to copy the ABA analysis server data:

Note: Windows requires using the CMD shell

Database Export:

  1. Log into the analysis server using software such as SSH or RDP with the user used to run the analysis server.

    (If you logged in as root on a Linux system, switch to the user used to run prelert (su - analysisuser)
     
  2. Change the current directory to the installation directory of the analysis server software.

    cd /opt/ca/apm_analysis_server (Substitute the appropriate install directory for /opt/ca/apm_analysis_server.)
     
  3. Source in the required environment.

    . profile #linux (Do NOT . ./.profile as you would do in a Unix home directory!)
    env.bat #windows
     
  4. Shutdown the analysis server.

    prelert_shutdown.sh #linux
    prelert_shutdown.bat #windows
     
  5. Start up the Postgres database.

    pg_ctl start -w
     
  6. Export the data using the pg_dump command.

    pg_dump --data-only --file=db_dump.sql
     
  7. Save the resulting db_dump.sql file somewhere besides the analysis server install directory. (As the analysis server install directory may be deleted when upgrading.)
     
  8. Shut down the Postgres database.

    pg_ctl stop
     
  9. Restart the analysis server.

    prelert_startup.sh #linux
    prelert_startup.bat #windows
     

Database Import (after re-installing):

  1. Log into the analysis server using software such as SSH or RDP with the user used to run the analysis server.

    (If you logged in as root, switch to the user that is used to run prelert (su -analysisuser)
     
  2. Change the current directory to the installation directory of the analysis server software.

    cd /opt/ca/apm_analysis_server (substitute the appropriate install directory for /opt/ca/apm_analysis_server)
     
  3. Source in the required environment.

    . profile #linux (Do NOT . ./.profile as you would do in a Unix home directory!)
    env.bat #windows
     
  4. Shutdown the analysis server.

    prelert_shutdown.sh #linux
    prelert_shutdown.bat #windows
     
  5. Start up the Postrgres database.

    pg_ctl start -w
     
  6. Re-initialize the Postgres database if you're APM server has been sending metrics since you have re-installed the analysis server:

    psql postgres -c "drop database prelert;"
    psql postgres -c "create database prelert;"
    config/sql/dbinstall.sh prelert #linux
    config/sql/dbinstall.bat prelert #windows

    When prompted with the following message:
    "Do you really want to overwrite the current schema and data for database prelert? (any character - y/CTRL-C - n)", answer y

    Note: After the "config/sql/dbinstall.sh" command, you may get some errors like:
    psql:tables.sql:<line #>: ERROR: schema "prelert" does not exist
    where <line #> is an incrementing value. These can be safely ignored.
     
  7. Copy the db_dump.sql to the analysis server installation directory from where it was saved previously.
     
  8. Import the data.

    psql prelert < db_dump.sql

    Note: After the "psql prelert < db_dump.sql" command, you may get errors like:
    ERROR: duplicate key value violates unique constraint "<some string>"
    where <some string> is various database keys. These can be safely ignored.
     
  9. Shut down the Postgres database.

    pg_ctl stop
     
  10. Restart the analysis server.

    prelert_startup.sh #linux
    prelert_startup.bat #windows