When setting up a brand-new file server, it’s crucial to ensure that all share permissions, CNAME registrations, dynamic DNS settings, and security permissions are copied before removing and moving an RDM (Raw Device Mapping) LUN. This guide details the steps using virt-file-01 (Windows Server 2016 with RDM) as the source and virt-file-02 (Windows Server 2019) as the destination.
Step 1: Export Share Permissions from virt-file-01
Method 1: Using PowerShell
$SourceShare = "YourShareName" # Replace with actual share name
$ShareInfo = Get-SmbShare -Name $SourceShare | Select-Object -Property Name, Path, Description
$SharePermissions = Get-SmbShareAccess -Name $SourceShare
$ShareInfo | Export-Clixml "C:\Temp\ShareInfo.xml"
$SharePermissions | Export-Clixml "C:\Temp\SharePermissions.xml"
Method 2: Using Registry Export
- Open Regedit and navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares
- Right-click the Shares key and select Export.
- Save the file as
C:\Temp\Shares.reg
.
Step 2: Backup NTFS Permissions
icacls D:\ /save C:\Temp\NTFSPermissions.txt /t /c
Step 3: Export DNS and CNAME Settings
Using Command Line
nslookup virt-file-01
To list and document CNAME records:
dnscmd /enumrecords domain.com fileserver
Backup dynamic DNS settings:
dnscmd /zoneexport domain.com C:\Temp\dnsbackup.txt
Using GUI
- Open DNS Manager (
dnsmgmt.msc
). - Navigate to Forward Lookup Zones > YourDomain.com.
- Locate and document A/CNAME records for
virt-file-01
. - Right-click on the zone, choose Export List, and save it.
Step 4: Remove the RDM LUN from virt-file-01
- Ensure all sessions are disconnected.
- Offline the disk in Disk Management.
- Remove the RDM mapping from the VM configuration.
Step 5: Attach the RDM LUN to virt-file-02
- Attach the LUN to the new VM as an RDM.
- Bring the disk online and ensure the same drive letter is assigned.
- Verify data integrity.
Step 6: Import Share Permissions to virt-file-02
Method 1: Using PowerShell
$NewShare = "YourShareName" # Replace with actual share name
$ShareInfo = Import-Clixml "C:\Temp\ShareInfo.xml"
$SharePermissions = Import-Clixml "C:\Temp\SharePermissions.xml"
New-SmbShare -Name $NewShare -Path $ShareInfo.Path -FullAccess Everyone # Modify permissions as needed
foreach ($perm in $SharePermissions) {
Grant-SmbShareAccess -Name $NewShare -AccountName $perm.AccountName -AccessRight $perm.AccessRight -Force
}
Method 2: Using Registry Import
- Copy
C:\Temp\Shares.reg
to virt-file-02. - Double-click the file to import it into the registry.
- Restart the Server service:
net stop lanmanserver && net start lanmanserver
Step 7: Restore NTFS Permissions
icacls D:\ /restore C:\Temp\NTFSPermissions.txt
Step 8: Reconfigure DNS and CNAME on virt-file-02
Using Command Line
dnscmd /recordadd domain.com virt-file-02 A <New-IP>
dnscmd /recordadd domain.com fileserver CNAME virt-file-02.domain.com
Force dynamic DNS update:
ipconfig /registerdns
Using GUI
- Open DNS Manager (
dnsmgmt.msc
). - Navigate to Forward Lookup Zones > YourDomain.com.
- Right-click and choose New Host (A or AAAA) to update the IP address.
- Create a new CNAME record pointing to
virt-file-02.domain.com
.
Final Verification
- Test file access from a client machine.
- Verify permissions and accessibility.
- Ensure DNS and CNAME records resolve correctly.
- Confirm all shares function as expected on virt-file-02.
- Check Event Viewer logs for any permission-related issues.
By following this process, all share settings, security permissions, and DNS configurations are migrated smoothly, allowing a seamless transition to the new server.
Need more advanced storage or VMware-related tips? Check out vmanalyst.com for in-depth guides!