You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/backup/restore-afs-powershell.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
title: Restore Azure Files with PowerShell
3
3
description: In this article, learn how to restore Azure Files using the Azure Backup service and PowerShell.
4
4
ms.topic: how-to
5
-
ms.date: 07/30/2024
5
+
ms.date: 03/05/2025
6
6
ms.custom: devx-track-azurepowershell
7
7
author: jyothisuri
8
8
ms.author: jsuri
9
9
---
10
10
11
11
# Restore Azure Files with PowerShell
12
12
13
-
This article explains how to restore an entire file share, or specific files, from a restore point created by the [Azure Backup](backup-overview.md) service using Azure PowerShell.
13
+
This article explains how to restore an entire File Share, or specific files, from a restore point created by the [Azure Backup](backup-overview.md) service using Azure PowerShell.
14
14
15
-
You can restore an entire file share or specific files on the share. You can restore to the original location, or to an alternate location.
15
+
You can restore an entire File Share or specific files on the share. You can restore to the original location, or to an alternate location.
16
16
17
17
> [!WARNING]
18
18
> Make sure the PowerShell version is upgraded to the minimum version for 'Az.RecoveryServices 2.6.0' for AFS backups. For more information, see [the section](backup-azure-afs-automation.md#important-notice-backup-item-identification) outlining the requirement for this change.
@@ -57,15 +57,15 @@ ContainerType : AzureStorage
57
57
BackupManagementType : AzureStorage
58
58
```
59
59
60
-
After the relevant recovery point is selected, you restore the file share or file to the original location, or to an alternate location.
60
+
After the relevant recovery point is selected, you restore the File Share or file to the original location, or to an alternate location.
61
61
62
-
## Restore an Azure file share to an alternate location
62
+
## Restore a File Share to an alternate location
63
63
64
64
Use the [Restore-AzRecoveryServicesBackupItem](/powershell/module/az.recoveryservices/restore-azrecoveryservicesbackupitem) to restore to the selected recovery point. Specify these parameters to identify the alternate location:
65
65
66
66
***TargetStorageAccountName**: The storage account to which the backed-up content is restored. The target storage account must be in the same location as the vault.
67
-
***TargetFileShareName**: The file shares within the target storage account to which the backed-up content is restored.
68
-
***TargetFolder**: The folder under the file share to which data is restored. If the backed-up content is to be restored to a root folder, give the target folder values as an empty string.
67
+
***TargetFileShareName**: The File Shares within the target storage account to which the backed-up content is restored.
68
+
***TargetFolder**: The folder under the File Share to which data is restored. If the backed-up content is to be restored to a root folder, give the target folder values as an empty string.
69
69
***ResolveConflict**: Instruction if there's a conflict with the restored data. Accepts **Overwrite** or **Skip**.
70
70
71
71
Run the cmdlet with the parameters as follows:
@@ -82,14 +82,14 @@ WorkloadName Operation Status StartTime
82
82
testAzureFS Restore InProgress 12/10/2018 9:56:38 AM 9fd34525-6c46-496e-980a-3740ccb2ad75
83
83
```
84
84
85
-
## Restore an Azure file to an alternate location
85
+
## Restore Azure Files to an alternate location
86
86
87
87
Use the [Restore-AzRecoveryServicesBackupItem](/powershell/module/az.recoveryservices/restore-azrecoveryservicesbackupitem) to restore to the selected recovery point. Specify these parameters to identify the alternate location, and to uniquely identify the file you want to restore.
88
88
89
89
***TargetStorageAccountName**: The storage account to which the backed-up content is restored. The target storage account must be in the same location as the vault.
90
-
***TargetFileShareName**: The file shares within the target storage account to which the backed-up content is restored.
91
-
***TargetFolder**: The folder under the file share to which data is restored. If the backed-up content is to be restored to a root folder, give the target folder values as an empty string.
92
-
***SourceFilePath**: The absolute path of the file, to be restored within the file share, as a string. This path is the same path used in the **Get-AzStorageFile** PowerShell cmdlet.
90
+
***TargetFileShareName**: The File Shares within the target storage account to which the backed-up content is restored.
91
+
***TargetFolder**: The folder under the File Share to which data is restored. If the backed-up content is to be restored to a root folder, give the target folder values as an empty string.
92
+
***SourceFilePath**: The absolute path of the file, to be restored within the File Share, as a string. This path is the same path used in the **Get-AzStorageFile** PowerShell cmdlet.
93
93
***SourceFileType**: Whether a directory or a file is selected. Accepts **Directory** or **File**.
94
94
***ResolveConflict**: Instruction if there's a conflict with the restored data. Accepts **Overwrite** or **Skip**.
This command returns a job with an ID to be tracked, as shown in the previous section.
103
103
104
-
## Restore Azure file shares and files to the original location
104
+
## Restore Azure Files and files to the original location
105
105
106
106
When you restore to an original location, you don't need to specify destination- and target-related parameters. Only **ResolveConflict** must be provided.
@@ -165,7 +165,7 @@ WorkloadName Operation Status StartTime
165
165
azurefiles Restore InProgress 4/5/2020 8:01:24 AM cd36abc3-0242-44b1-9964-0a9102b74d57
166
166
```
167
167
168
-
If you want to restore multiple files or folders to alternate location, use the scripts above by specifying the target location-related parameter values, as explained above in [Restore an Azure file to an alternate location](#restore-an-azure-file-to-an-alternate-location).
168
+
If you want to restore multiple files or folders to alternate location, use the scripts above by specifying the target location-related parameter values, as explained above in [Restore Azure Files to an alternate location](#restore-azure-files-to-an-alternate-location).
0 commit comments