Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / How to Move (Migrate) Existing Windows Shares to a New File Server

December 24, 2025

How to Move (Migrate) Existing Windows Shares to a New File Server

In Windows, the list of shared network folders (and shared printers), along with their settings and share permissions, is stored under the HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares registry key. When the LanManServer service starts up, it reads this registry key and publishes all the network shares listed there. This feature can be used to migrate (move) existing shared folders from one Windows file server to another.

The following commands list the shared SMB resources on a Windows host:

net share

or

Get-SmbShare

Get-SmbShare - list shares on a Windows file server

On my computer, in addition to the default admin shares and two printers, there are three shared network folders: Docs, ISO, and Scripts.

Now open the Registry Editor and navigate to HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares .

Windows share settings in registry

All published folders’ settings and permissions are stored here. To see the configuration options for a particular share, expand the registry key with the share name:

  • CATimeout – client connection timeout on failure
  • CSCFlags – offline file caching (also known as Offline Files) option
  • MaxUses – maximum number of concurrent connections to a shared folder
  • Path – local path to the shared network folder
  • Permissions – share permissions (this is not the same as NTFS permissions).
  • ShareName – shared folder name
  • Type – share type (0 for network folders)

The HKLM\CurrentControlSet\Services\LanmanServer\Shares\Security subkey stores security settings for each network share, defining permitted operations. The SECURITY_DESCRIPTOR format is used, which includes DACL and account/group SID.

Share permissions in Shares\Security reg key

You can use PowerShell to list the assigned permissions (security descriptors) for a shared folder:

Get-SmbShareAccess docs

Get-SmbShareAccess - list share permissions with PowerShell

To migrate network shares with their settings to another Windows file server, export the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares registry key to a .REG file.

Export shared folders configuration from registry to a REG file

Then open the REG file in a text editor and delete the entries for any administrative folders, printers, or shares that you do not want to migrate. In this example, we are going to move to a new file server only the ISO and Docs shared folders.

edit REG file with shared folders list

Save the REG file and then copy it to the computer on which you want to create the shared folders.

Choose the way you’re going to transfer your files and folders from the old server to the new one:

  • When migrating a file server between virtual machines, simply reattach the virtual disk containing the files and folders to the new VM and assign it the same drive letter.
  • The built-in Robocopy.exe command can be used to copy all files and directories along with permissions between physical servers. The following command copies files and folders, along with their NTFS permissions and any enabled file and folder access audit settings: robocopy f:\docs \\new-srv2\f$\docs /MIR /COPYALL /B /E /Z /R:2 /W:5 /LOG:f:\files_copy.log
  • Configure the second file server as a replication target (copy) via DFS(a more complicated way).

To import the settings from the REG file to a target file server, simply double-click the file.

import REG file into registry

Check that the new network folders have been added to the registry on the new computer. They haven’t actually been shared yet, though. If the path to the local folder differs from the original, you can edit it at this stage.

Edit local path to shared folder on a disk on a new file server

To force the LanManServer service to reload the share list from the registry and publish imported shares, either create/delete a dummy network folder or restart the service:

Restart-Service server

restart LanManServer service

Check that the folders you transferred are visible on the new computer (if the folder paths specified in the registry do not exist on the new computer, these network folders will not be shared).

Ensure that all shared folders have been transferred to the new file server.

This technique can also be used to backup and restore network shares and their permissions on file servers.

Export the settings for the enabled shared folders to a REG file.

reg export HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares %UserProfile%\Documents\MyShares.reg

Restore a list of shared network folders from a backup.

reg import %UserProfile%\Documents\MyShares.reg

The icacls.exe command can be used to backup the NTFS object permissions on a file system. 
0 comment
0
Facebook Twitter Google + Pinterest
Windows 10Windows 11Windows Server 2022Windows Server 2025
previous post
Installing Windows without USB/DVD or Other External Drives

Related Reading

Configuring RemoteApps Hosted on Windows 10/11 (without Windows...

January 25, 2025

How to Prefer IPv4 over IPv6 in Windows...

April 15, 2025

Change BIOS from Legacy to UEFI without Reinstalling...

April 23, 2025

How to Detect Which User Installed or Removed...

June 25, 2025

Find a Process Causing High Disk Usage on...

July 16, 2025

Map a Network Drive over SSH (SSHFS) in...

May 13, 2025

Restrict the Allowed Logon Time for Local Users...

January 3, 2025

Enable Automatic System Registry Backup on Windows 10/11

January 21, 2025

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • How to Move (Migrate) Existing Windows Shares to a New File Server

    December 24, 2025
  • Using KDC (Kerberos) Proxy in AD for Remote Access

    December 23, 2025
  • Windows: Create (Install) a Service Manually

    December 16, 2025
  • Windows: Auto Switch to Strongest Wi-Fi Network

    December 10, 2025
  • How to Enable or Disable VBScript in Windows after Deprecation

    December 10, 2025
  • Start Menu Not Working (Unresponsive) on Windows Server RDS

    November 27, 2025
  • AppLocker: Configure Application Restriction Policies in Windows

    November 19, 2025
  • Enable/Disable Random Hardware (MAC) Address for Wi-Fi on Windows

    November 14, 2025
  • Automate Software and Settings Deployment with WinGet Configure (DSC)

    November 13, 2025
  • SMB over QUIC: Mount File Share over Internet without VPN on Windows Server 2025

    November 4, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Upgrading to Windows 11 on Unsupported Hardware
  • Converting Windows 10 to Enterprise LTSC Without Losing Data
  • Create a Custom Windows Image with Pre-installed Apps
  • Permanently Disable Driver Signature Enforcement on Windows 11
  • Configuring RemoteApps Hosted on Windows 10/11 (without Windows Server)
  • How to Assign (Passthrough) a Physical GPU to a Hyper-V Virtual Machine
  • Get Started with Docker on Windows (WSL2) without Docker Desktop
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top