Restoring MySQL

This section guides you with the procedure required for restoring the backup of Session Monitor's MySQL Data.

  1. Copy the MySQL Backup directory containing <DATABASE>.dump directory and blocks_replace.sql file from Remote Server or Shared Drive on to your new Session Monitor Server. This downloads all the MySQL Backup files from Remote Server or Shared Drive on to your new Session Monitor Server.
    For the Remote Server, run the following scp command in the newly installed Session Monitor Server:
    scp -r <User>@<Remote_Server_IP>:<path_to_MySQL_backup_directory>  <path_to_copy_backup>
    For example:
    scp -r root@10.184.19.114:/root/ocsmBackup/mysqlBackup/ /root/
    For Shared Drive, run the following cp command in the newly installed Session Monitor Server:
    cp -r <path_to_MySQL_backup_directory> <path_to_copy_backup>
    For example:
    cp -r /mnt/oracle/ocsmBackup/mysqlBackup/  /root/
    
  2. This step is required only if the node type is Mediation Engine .
    1. Take a mysql dump of blocks table of newly installed Session Monitor Server by running the following command.
      mysqldump vsp blocks > blocks_dumps.sql
    2. Copy this blocks_dumps.sql file to the MySQL backup directory transferred in Step 1.
    3. Go to the MySQL Backup directory (for example, /root/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 in the image Figure 4-1;
    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 here in the image:
      cat vsp.dump/vsp@kpi_template_type.sql

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


    vsp.dump/vsp@kpi_template_type.sql

  3. 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 installation of Session Monitor.

      Note:

      The (MySQL 8.4.4 shell utility rpm is packed as 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

      Note:

      For example:
      yum install mysql-shell-commercial-8.4.4-1.1.el8.x86_64.rpm

      Tip:

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

    Figure 4-2 Copy Password


    Copy Password