Share Folders Backup and Restore to Another Server

Backup and Restore network Shared Folder Permissions:

While migrating storage servers you might have come across such questions in your mind, “How to backup and restore network share folders without lossing NTFS permissions”?

Here we will discuss all possible resolution for such questions.

To backup & restore NTFS permission you will find many utilities like NTBACKUP,  iCacls, Robocopy and FSMT.

Backup and Restore network Shared Folder Permissions:

Generally, shared folder permissions are stored in registry at the following location.

HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares, you need to backup and restore this key values using export and import options.

Step 1: Open the registry ( Run | Regedit.exe )

Step 2: Navigate to the following location:


Step 3: Right Click on Shares Registry key in the Left pane, from context menu selectExport.

Step4: Give the filename as BackupSharedPerm.reg

In order to restore, copy BackupSharedPerm.reg file and paste this file to another server where you want to restore and then double click on that file to import.

Using Command line utility.

reg export HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares c:\BackupSharedPerm.reg

If you need to restore, copy and paste the file to C: location, just run:

reg import c:\BackupSharedPerm.reg

Note: After restore you need to restart theServerservice.

net stop lanmanserver

net start lanmanserver

Backup and Restore of NTFS Permissions

If your are using NTBackup to restore the data, you should select the checkbox to restore permissions as well.

Using icacls command to backup NTFS permissions:

icacls d:\sharedata /save ntfsperms.txt /t /c

The /T switch allows it to get subfolder permissions too. The /C switch allows it to continue even if errors are encountered (although errors will still be displayed).

Use this command to restore them:

icacls d:\ /restore ntfsperms.txt