Move data from old Windows server to the new one with saving all users access permissions

Shut down all VMs and PCs that might use the shared data.

On the old server:
Get and save information about all local accounts:
wmic useraccount get name,sid > D:\old-SIDs.txt
Get and save all permissions in selected folder:
icacls "D:\Data" /save D:\Data-icacls.txt /T

On the new server:
Configure new accounts
Get and save information about all local accounts:
wmic useraccount get name,sid > D:\new-SIDs.txt

On your PC:
Replace old SIDs with the new SIDs in ICACLS dump files (copy original dump files first)

On the new server:
Attach disk D: from an old server to the new one
Configure System to own D:
Allow admin to access D: (“This folder only” type)
Restore permissions from icacls dump:
icacls R:\ /restore D:\Data-icacls.txt