Transfer the STA Database to Another Server

You may want to transfer the STA database to another server to test a new feature or replace the existing server with a new one.

To transfer the STA database, perform the tasks in the order listed. These tasks assume the new (target) server will use the same version of STA as the current server. To upgrade the database to a new version of STA, see the upgrade instructions in the STA Installation and Configuration Guide.

  1. Prepare the Target Server

  2. Dump the STA Database

  3. Transfer the Dump File to the Target Server

  4. Process and Load the STA Database on the Target Server

  5. Post-transfer Configuration

Prepare the Target Server

Prepare the target server before importing the STA database. The target server must run the same version of Linux and STA as the current server.

Refer to the STA Installation and Configuration Guide to perform the following:

  1. Install Linux on the target server.

  2. Install STA on the target server.

  3. On all libraries monitored by STA:

    1. Add the target server as an SNMP trap recipient; this will cause the libraries to send SNMP data to the target server.

    2. If the target server is replacing the current STA server, remove the current STA server as an SNMP trap recipient; this will cause the libraries to stop sending SNMP data to the current server.

Dump the STA Database

Perform a full dump of the STA database on the current STA server.

  1. Display the size of your current STA database.

    1. Open a browser window and log in to STA.

    2. Click About in the Status Bar.

    3. In the About dialog box, scroll down to where the Database Current Size is displayed, and record the value.

  2. Verify that the location where you want to dump the database has sufficient space.

    1. Open a terminal session on the STA server, and log in as the Oracle user.

    2. Display the space available in the database dump destination, and verify it is sufficient for the dump file. The following example checks the space in /tmp.

      $ df -h /tmp
      Filesystem                        Size  Used Avail Use% Mounted on
      /dev/mapper/sta_server-STA_DbVol  200G   53G  243G  27% /
      
  3. Stop all STA processes:

    $ STA stop all
    
  4. Restart the MySQL server:

    $ STA start mysql
    
  5. Dump the STA database into a single file. Enter the database root user password when prompted. For example:

    $ mysqldump -u root -p --opt --add-drop-database --comments --complete-insert --dump-date --events --flush-logs --routines --single-transaction --triggers --databases stadb > /tmp/160115_SavedSTADatabase.sql
    Enter password: 
    $
    

    where:

    • -u root specifies the STA database root username.

    • -p indicates to prompt for the user password.

    • --flush-logs indicates to flush the MySQL server log files before starting the dump.

    • --databases stadb specifies the name of the database to dump.

    • /tmp/160115_SavedSTADatabase.sql specifies the name of the dump file to create. The name must end with .sql.

    • For descriptions of the other options, see the MySQL Reference Manual.

    Note:

    Do not use the --verbose command option, as it displays many messages in the terminal window and can significantly slow down the command process for large databases.
  6. Verify the dump file has been created, and note the size. You will use the size information in the next procedure. For example:

    $ cd /tmp
    $ ls -l 160115*sql
    -rw-r--r-- 1 oracle oinstall 3875509 Jan 15 14:05 160115_SavedSTADatabase.sql
    
  7. To reduce the dump file size by approximately 50 percent, compress the file. For example:

    $ zip 160115_SavedSTADatabase.sql
    $ ls -l 160115*gz
    -rw-r--r--   1 oracle oinstall 365282 Jan 15 14:34 160115_SavedSTADatabase.sql.gz
    

Transfer the Dump File to the Target Server

Transfer and decompress the STA database dump file on the target server.

  1. On the target server, verify there is sufficient space for the decompressed database dump file (which may be 10 to 15 times the size as the compressed database).

    1. Open a terminal session on the target server and log in as the Oracle user.

    2. Display the space available in the destination directory, and verify it is sufficient for the size of the decompressed dump file, which you displayed while dumping the database.

      The following example displays the space in /tmp.

      $ df -h /tmp
      Filesystem                        Size  Used Avail Use% Mounted on
      /dev/mapper/newstaserver-lv_root  150G   32G  118G  21% /
      
  2. On the STA server, transfer the compressed dump file to the target server.

    1. Open a terminal session on the STA server, and log in as the Oracle user.

    2. Transfer the file to the target server using a transfer utility such as SCP. For example:

      $ cd /tmp
      $ scp -p 160115_SavedSTADatabase.sql.gz newstaserver:/tmp
      

      where:

      • -p indicates to preserve timestamp values from the original files.

      • 160115_SavedSTADatabase.sql.gz is the name of the compressed database dump file.

      • newstaserver is the name of the target server.

      • /tmp is the target directory on the server.

  3. On the target server, decompress the database dump file.

    1. Open a terminal session on the target server and log in as the Oracle user.

    2. Decompress the dump file. For example:

      $ cd /tmp
      $ unzip 160115_SavedSTADatabase.sql.gz
      $ ls -l 160115*sql
      -rw-r--r-- 1 oracle   oinstall     3875509 Jan 15 15:05 160115_SavedSTADatabase.sql
      

Process and Load the STA Database on the Target Server

Load the decompressed dump file into the database on the target server.

  1. On the target server, open a terminal session. Log in as the Oracle user.

  2. Stop all STA processes:

    $ STA stop all
    
  3. Restart the MySQL server:

    $ STA start mysql
    
  4. Load the dump file into the STA database. Enter the database root user password when prompted. For example:

    $ mysql -u root -p -e "SET SESSION SQL_LOG_BIN=0; SOURCE /tmp/160115_SavedSTADatabase.sql;"
    Password:
    $
    

    where:

    • -u root specifies the database root username.

    • -p indicates to prompt for the user password.

    • -e indicates to execute the following MySQL statements and then quit the mysql command. The statements must be enclosed in quotes.

      • SET SESSION SQL_LOG_BIN=0;—Temporarily disables binary logging during the load, speeding up the process.

      • SOURCE /tmp/160115_SavedSTADatabase.sql—Loads the dump file into the database.

    There is no command output as the process runs. If the command is successful, you are returned to the command prompt once the process completes.

    Note:

    The --verbose command option is not recommended, as it displays many messages in the terminal window and can significantly slow down the command process for large databases.

Post-transfer Configuration

After transferring the database, you must configure STA on the target server.

  1. Add the target STA server as a trap recipient on the libraries you want STA to monitor. See the library configuration tasks in the STA Installation and Configuration Guide for instructions.

  2. Use the following tasks to configure library connections to each library. See the SNMP connection management tasks in the STA Installation and Configuration Guide for complete instructions. These tasks are all performed on the target server.

    1. Enter the configuration settings for the STA SNMP client.

    2. Reconfigure the SNMP connection to each library you want STA to monitor.

    3. Establish SNMP communication between STA and the libraries by testing the connection to each library.

    4. Get the latest SNMP library configuration data from each library.

  3. Configure STA users and application data, as applicable. These tasks are all performed on the target server. Refer to the STA User's Guide for instructions.

    1. Create STA usernames and passwords.

    2. If the STA email server requires authentication, you must enter the email account username and password.

    3. Assign ownership to custom templates, as applicable.

    4. Assign ownership to private Executive Report policies, as applicable.

    5. Assign ownership to logical groups by recreating the groups, as applicable.

  4. Configure the Backup Service on the target server.

    See Configure the Backup Service Using staservadm.

  5. Configure the Resource Monitor on the target server.

    See Configure the Resource Monitor Using staresmonadm.