Restoring MySQL

This section provides instructions on the procedure required for restoring the backup of Session Monitor's MySQL Data.

MySQL backup will be present in your new Session Monitor server in the Backup Path provided in the MySQL Backup procedure.
  1. This step is required only if the node type is Mediation Engine
    1. Run this command to take a MySQL dump of the blocks table of the newly installed Session Monitor Server:
      mysqldump vsp blocks > blocks_dumps.sql
    2. Copy this blocks_dumps.sql file to your existing MySQL backup directory.
    3. Go to the MySQL Backup directory. For example, cd /root/ocsmBackup/mysqlBackup, where the vsp.dump folder is present, and execute the following command:
      sed -i 's/PRIMARY KEY (`id`,`template_name`)/PRIMARY KEY (`id`,`template_name`),\n UNIQUE KEY (`id`)/' vsp.dump/vsp@kpi_template_type.sql

      OR

      Manually edit the vsp.dump/vsp@kpi_template_type.sql file:
      1. Add a comma at the end of the text "PRIMARY KEY (`id`,`template_name`)"
      2. Add "UNIQUE KEY (`id`)" text in the next line as shown here in the image;
    4. From the MySQL backup directory, run the following command and make sure that the "UNIQUE KEY (`id`)" is present in the vsp.dump/vsp@kpi_template_type.sql file after the "PRIMARY KEY (`id`,`template_name`)" text, as shown in the image Figure 4-3:
      cat vsp.dump/vsp@kpi_template_type.sql

      Figure 4-3 vsp.dump/vsp@kpi_template_type.sql


      vsp.dump/vsp@kpi_template_type.sql

  2. Install the mysql-shell utility on the newly installed Session Monitor Server.
    1. Go to the folder where you extracted the OCSM Zip bundle (ocsm-6.0.0.0.0-GA.zip) during the Session Monitor installation
      The MySQL 8.4.4 shell utility rpm is packed as a part of the OCSM Zip bundle under other_files/mysql-shell-commercial-8.4.4-1.1.el8.x86_64.rpm.
    2. Move to the other_files directory:
      cd other_files/
    3. Install the mysql shell rpm by running the following command:
      yum install mysql-shell-commercial-X.X.XX-X.X.XXX.x86_64.rpm For example:
      yum install mysql-shell-commercial-8.4.4-1.1.el8.x86_64.rpm

      Note:

      The mysql-shell rpm used here is based on the MySQL 8.4.4 used in the Session Monitor Release 6.0.
  3. Copy the password from/root/.my.cnf and keep it handy.

    Figure 4-4 Copy Password


    Copy Password