Migration of Azure Files to a different Storage Account

Summary

Azure Files can be migrated from one Storage Account to a different one using copy backup and StorageClass mapping. Follow the instructions in this article to perform Azure Files migration.

Step-by-Step

  1. Create and run a copy backup of a namespace where Azure File PVC is located.

  2. On the cluster where the Azure Files need to be available, create a StorageClass that has details of the new Storage Account. Example:

    allowVolumeExpansion: true
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: azurefile-migration
    parameters:
      skuName: Standard_LRS
      location: uksouth
      storageAccount: newstorageaccount
      resourceGroup: new-storage-account-resource-group
    provisioner: file.csi.azure.com
    reclaimPolicy: Retain
    volumeBindingMode: Immediate
    
  3. Create a new restore definition and in the “Restore transforms” section, select “Change Storage Class”, and select the newly create StorageClass for volumes that need to be migrated.

Note

If your Azure File volumes were created statically, please be aware that the restore/migrated volumes will be created dynamically by the StorageClass.