Skip to main content
SnapCenter Software 6.0

Clone a MySQL backup

Contributors netapp-nsriram netapp-soumikd

You can use SnapCenter to clone a backup. You can clone from primary or secondary backup.

Before you begin
  • You should have backed up the resources or resource group.

  • You should ensure that the aggregates hosting the volumes should be in the assigned aggregates list of the storage virtual machine (SVM).

  • For pre clone or post clone commands, you should check if the commands exist in the command list available on the plug-in host from the following paths:

    • Default location on the Windows host: C:\Program Files\NetApp\SnapCenter\Snapcenter Plug-in Creator\etc\allowed_commands.config

    • Default location on the Linux host: /opt/NetApp/snapcenter/scc/etc/allowed_commands.config

Note If the commands do not exist in the command list, then the operation will fail. * For MySQL 5.7 version, you should set IGNORE_MYSQLX_PORT = true (by default false) in the MySQL. properties file.
About this task
  • You cannot protect the cloned MySQL instances.

  • For information about clone split operation limitations, see ONTAP 9 Logical Storage Management Guide.

  • For ONTAP 9.12.1 and earlier version, the clones created from the SnapLock Vault Snapshots as part of restore will inherit the SnapLock Vault expiry time. Storage admin should manually cleanup the clones post the SnapLock expiry time.

SnapCenter UI
Steps
  1. In the left navigation pane, click Resources, and then select the appropriate plug-in from the list.

  2. In the Resources page, filter resources from the View drop-down list based on resource type.

    The resources are displayed along with information such as type, host, associated resource groups and policies, and status.

  3. Select the resource or resource group.

    You must select a resource if you select a resource group.

    The resource or resource group topology page is displayed.

  4. From the Manage Copies view, select Backups either from the primary or secondary (mirrored or vaulted) storage systems.

  5. Select the data backup from the table, and then click clone icon.

  6. In the Location page, perform the following actions:

    For this field…​ Do this…​

    Clone server

    Choose a host on which the clone should be created.

    Port

    Provide the port on which the cloned MySQL instance to be started on.

    NFS Export IP Address

    Enter IP addresses or the host names on which the cloned volumes will be exported.

  7. In the Scripts page, perform the following steps:

    Note The scripts are run on the plug-in host.
    1. Enter the commands for pre clone or post clone that should be run before or after the clone operation, respectively.

      • Pre clone command: delete existing databases with the same name

      • Post clone command: verify a database or start a database.

    2. Enter the mount command to mount a file system to a host.

      Mount command for a volume or qtree on a Linux machine:

      Example for NFS: mount VSERVER_DATA_IP:%VOLUME_NAME_Clone /mnt

  8. In the Notification page, from the Email preference drop-down list, select the scenarios in which you want to send the emails.

    You must also specify the sender and receiver email addresses, and the subject of the email.

  9. Review the summary, and then click Finish.

  10. Monitor the operation progress by clicking Monitor > Jobs.

PowerShell cmdlets
Steps
  1. Initiate a connection session with the SnapCenter Server for a specified user by using the Open-SmConnection cmdlet.

    PS C:\> Open-SmConnection  -SMSbaseurl  https:\\snapctr.demo.netapp.com:8146/
  2. Retrieve the backups to perform the clone operation by using the Get-SmBackup cmdlet.

    This example shows that two backups are available for cloning:

     C:\PS> Get-SmBackup
    
            BackupId                      BackupName                    BackupTime                    BackupType
            --------                      ----------                    ----------                    ----------
             1                     Payroll Dataset_vise-f6_08... 8/4/2015 11:02:32 AM          Full Backup
             2                     Payroll Dataset_vise-f6_08... 8/4/2015 11:23:17 AM
  3. Initiate a clone operation from an existing backup and specify the NFS export IP addresses on which the cloned volumes are exported.

    This example shows that the backup to be cloned has an NFSExportIPs address of 10.32.212.14:

    PS C:\> New-SmClone -AppPluginCode MySQL -BackupName "scs000211748_gdl_englab_netapp_com_MySQL_mysqld_3306_scs000211748_06-26-2024_06.08.35.4307" -Resources @{"Host"="scs000211748.gdl.englab.netapp.com";"Uid"="mysqld_3306"} -Port 3320 -CloneToHost shivarhel30.rtp.openenglab.netapp.com
    Note If NFSExportIPs is not specified, the default is exported to the clone target host.
  4. Verify that the backups were cloned successfully by using the Get-SmCloneReport cmdlet to view the clone job details.

    You can view details such as clone ID, start date and time, end date and time.

    PS C:\> Get-SmCloneReport -JobId 186
    
        SmCloneId           : 1
        SmJobId             : 186
        StartDateTime       : 8/3/2015 2:43:02 PM
        EndDateTime         : 8/3/2015 2:44:08 PM
        Duration            : 00:01:06.6760000
        Status              : Completed
        ProtectionGroupName : Draper
        SmProtectionGroupId : 4
        PolicyName          : OnDemand_Clone
        SmPolicyId          : 4
        BackupPolicyName    : OnDemand_Full_Log
        SmBackupPolicyId    : 1
        CloneHostName       : SCSPR0054212005.mycompany.com
        CloneHostId         : 4
        CloneName           : Draper__clone__08-03-2015_14.43.53
        SourceResources     : {Don, Betty, Bobby, Sally}
        ClonedResources     : {Don_DRAPER, Betty_DRAPER, Bobby_DRAPER, Sally_DRAPER}
        SmJobError          :