MySQL Backup (From Version 5.1)

This section provides information on the procedure required for taking backup of Session Monitor's MySQL Data. This section is applicable only for taking MySQL backup from Session Monitor with version 5.1 and restoring it on Session Monitor with version 5.1. This difference is required as here the MySQL shell utility is to be installed from MySql8.x package instead of MySQL 5.x package.

  1. Installing MySQL shell utility:
    1. Go to the folder where MySQL RPM files are present. (The MySQL 8 Commercial Package was downloaded from the Oracle software delivery during OCSM rpm installation.). cd mysql-8.X/8.X.XX/. For example: cd /root/mysql-8.0/8.0.32/.
    2. Run the following command to install the MySQL shell rpm:
      yum install mysql-shell-commercial-X.X.XX-X.X.XXX.x86_64.rpm
      For example:
      yum install mysql-shell-commercial-8.0.32-1.1.el8.x86_64.rpm

      Note:

      The mysql-shell rpm is available as a part of the MySQL package itself. So use the same.
  2. Create a temporary directory structure under /root/ or any other location on your OCSM Server where space is available.
    For example: mkdir /root/mysqlBackup/.
  3. Copy the password from /root/.my.cnf and keep it handy.

    Figure 3-2 Copy Password


    Copy Password
  4. Type mysqlsh --no-defaults command, This opens the JS prompt. Run this commands in sequence at the JS prompt:
    1. Run this command to connect to a MySQL instance:
      \connect root@localhost:3306
    2. When prompted for password. paste the password as copied from /root/.my.cnf earlier in Step 3.
    3. Run this command to begin backup:
      util.dumpSchemas(["<DATABASE>"],"<PATH_TO_MYSQL_BACKUP_DIRECTORY>/<DATABASE>.dump",{threads:88})

      For ME, use DATABASE = vsp

      For MEC, use DATABASE = pldmaster

      For FDP, use DATABASE = fdp

      For example, in ME:

      util.dumpSchemas(["vsp"],"/root/mysqlBackup/vsp.dump",{threads:88})

      Once the backup is successful, a message is displayed similar to the below sample:

      105% (9.97M rows / ~9.47M rows), 26.82K rows/s, 559.12 KB/s uncompressed, 17.04 KB/s compressed
      Dump duration: 00:00:52s
      Total duration: 00:00:54s
      Schemas dumped: 1
      Tables dumped: 63
      Uncompressed data size: 260.70 MB
      Compressed data size: 7.81 MB
      Compression ratio: 33.4
      Rows written: 9970295
      Bytes written: 7.81 MB
      Average uncompressed throughput: 4.93 MB/s
      Average compressed throughput: 147.71 KB/s
    4. To exit from mysql-shell run this command:
      \quit
  5. Verify a <DATABASE>.dump directory has been created under the directory created from Step 2. Run this command: .
    ls -lh /root/mysqlBackup/
    
    Example For ME:
    [root@localhost ~]# ls -lh /root/mysqlBackup/
    total 1.2M
    drwxr-x---. 2 root root 1.2M Aug 19 13:27 vsp.dump