Background: There is a problem with the storage of the company's shared folder, and a new storage needs to be attached to it, and it cannot affect the user's use for too long. The server is only for file sharing, so our plan is: create a new server, and then copy the files. , Permission to copy past
Note:
①NTFS permissions
②Sharing permissions
③Server quota
These 3 points are the most common for windows shared file servers
1. Start permission migration, first migrate NTFS permissions
NTFS permissions can use robocopy command, so that files and permissions can be copied at the same time, the command is as follows
robocopy.exe \\192.168.1.1\share I:\share /e /copyall /Z /R:0 /W:0 /XA:H /v
Note here that \\192.168.1.1\share is the source shared folder address, and I:\share is the destination address
But our company has NBU, which is more convenient. I directly use NBU to back up and restore the past.
2. Copy the shared permissions, the shared permissions are in the windows registry, directly import them, and then export them with a script
The export script is as follows:
@echo off
set rf=.\shareConfig.reg
reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\Shares %rf%
pause
The import script is as follows: remember to export a reg file to be placed in the same level directory, I always put it on the desktop
@echo off
set rf=.\shareConfig.reg
reg import %rf%
net stop server
net start server
net share
pause
3. Disk quota, this is easy to be overlooked. Some companies may not use it. Disk quota can be exported:
Click quota configuration, click quota item
Export here, then go to the new disk to set the quota, import it, and it will refresh your original usage.