Copy the MySQL Backup Directory to the Target Machine

Check the space availability on both Source and Target Machines, and copy the MySQL Backup directory to the Target Machine (Remote Server or Shared Drive).

  1. Run this command to check the MySQL backup directory size on the current OCSM Server (Source Machine) by running the following command.
    du -sh <path to mysql backup folder>
  2. Run the following command on the backup location of the Target Machine (Remote Server or Shared Drive) to get the available space:
    df -kh --output=avail <path to copy backup>
  3. Compare the outputs of the above commands, and make sure the available space (in Step #2) is greater than the MySQL backup size directory size (in Step #1).
  4. Copy the MySQL Backup directory to the Target Machine (Remote Server or Shared Drive).
    1. For the Remote Server:
      Copy the MySQL Backup directory containing the <DATABASE>.dump directory and the blocks_replace.sql file by running the following scp command:
      scp -r <PATH_TO_MYSQL_BACKUP_DIRECTORY> <User>@<Target_Machine_IP>:<path to copy backup>
      For example:
      scp -r /root/mysqlBackup  root@1.2.3.4:/root/ocsmBackup/
      

      Here, the Remote Server is either the Remote Server selected as part of Strategy-1 OR the newly created Target machine as part of Strategy-2.

      (or)

    2. For the Shared Drive:
      Transfer the MySQL Backup directory containing <DATABASE>.dump directory and blocks_replace.sql file by running the following command:
      cp -r <PATH_TO_MYSQL_BACKUP_DIRECTORY> <path to copy backup>
      For example:
      cp -r /root/mysqlBackup  /mnt/oracle/ocsmBackup/

      Note:

      The time to copy the MySQL backup folder depends on the size of directory as well as the network bandwidth between the source and the target machine.