In this post we’ll try to give you some tips when you need to do share migration with files and folders, or migrate user profiles. Usually, the requirements are that the end user should not know that anyone migrated his/her files. Permissions must be kept as well because what’s the point of migrating files when you lose the permissions.
File server and shares hosted on Microsoft Windows servers have shares permissions and NTFS permissions. Migrating both, and including the file’s properties and ownership is a key to succeed, and that’s why many IT technicians struggles.
There isn’t a single environment or single tool which I’d recommend, but I rather point you to three different ways the file migrations can be done.
Microsoft phases out their products on regular basis. This was the case for Windows Server 2008 and R2 or even the earlier Server 2003 or R2 releases which are out of support for a long time. One would not imagine how many files and folders still residing on those servers are usually at risk. Microsoft stopped maintaining those versions and phased them out so it’s time for migration.
How about Linux? Yes, we can, says Microsoft. In fact, Windows Storage Migration tool which can be installed inside of Windows Admin Center (WAC) tool can also migrate files from Linux machines running Samba. Storage Migration Service can migrate:
- Servers running Windows Server 2003 or later
- Failover clusters running Windows Server 2012 or later
- Linux servers using Samba (if the orchestrator is running an updated version of Windows Server)
We can migrate to:
Servers running Windows Server 2012 R2 or later. And as most of the servers we’re deploying right now are usually newer than that, the tool might just be perfect for the job.
Fist option – Microsoft Windows Server 2019 Storage Migration
This is the Microsoft’s way that things should be done. It is an Add-on tool which installs inside Windows Admin Center (WAC).
In case you don’t know how, here is a short write up. First, you’ll need to install Windows WAC and add Storage Migration Service component.
Add Storage Migration Service to Windows WAC first
Simply do a search on Storage migration in the search box and WAC will provide you link to download the component which installs automatically.
Then the WAC console with Storage Migration Service looks like this. Below is the latest release from Microsoft. The design slightly changed and now all the menus and icons on the left do have colors.
Storage Migration Service via Microsoft Edge
From there you can start your migration project. Basically, you can set a job which you can schedule to run after office hours or straight away.
What’s not supported?
You might need to know what’s not supported by Microsoft.
- Domain migrations or cutover of domain controllers
- Transferring files or folders that could interfere with the operating system
- Consolidating multiple servers into one server
- Migrating locally installed apps (though we can migrate local users and groups)
We won’t go into details but the process is quite simple as all you need to set the authentication (logins/passwords) and the destination machine. You can re-run the job at the end to migrate the delta changes before cutting off the old machines.
For the cut over from the source servers to the destination servers you’ll be moving the IP addresses and computer names to the destination servers. After this step is finished, apps and users access the new servers via the names and addresses of the servers you migrated from.
The advantage of using this utility is that you can inventory multiple source servers with their data and rapidly transfer file, file shared and security configuration from the source servers to the destination servers.
Second Option – Using Xcopy
When you have only few users to migrate and copy the user’s files, you can use client’s backup software. The problem is with shares and shares permissions which you have to manually re-enter after copying.
If you want to learn more switches, simply type this:
1 |
xcopy /? |
You’ll get a full list of switches
Xcopy is a utility which can preserve NTFS and share permissions. It’s a robust tool which needs command line options. We’ll give you a one-liner which does the job.
First, when you planning the copy, just make sure that you create drive letter on the destination server with the same letter as there is at the source. (example: source server has E:\ so you should cereate an E:\ in the new server too). This is just to make things easier for the setup we have.
On the new server, map a drive letter the the shared drive on the old server. You can do that with a “net use” command. (ex. “net use x: \\10.10.10.5\e$” )
Then copy the content from the old drive to the new drive via this command:
1 |
xcopy x:*.* e:*.* /D /E /C /F /H /K /O /Y |
The copy will take some time especially if the old machine has a very old Network interface card (NIC) or the network switch has a bad performance.
Once done, we’ll need to export share permissions from the old server and import it to the new server. We can do it via regedit.
Start > Run > Regedit > Navigate to KEY_LOCAL_MACHINE >SYSTEM > CurrentControlSet > Services > Lanmanserver > Shares > Right click the entire “Shares” Key and export it to a file.
Some sites reported that the import of the reg key can break things on the new machine. I have not experienced it.
Note: You can still make backup by exporting the exact reg key before importing the one from the old server.
Save Reg Key with your shares and then import it on the new machine
On the new machine, simply put the reg file on the desktop, double click it, and accept.
Accept the merge
You’ll get a message saying that the keys and values contained in the reg file have been successfully added to the registry.
We’re done. We now have two machines with identical files and folders. Also, we do have share permissions and NTFS permissions identical on both machines. Reboot the new server to validate the changes. You can decommission the old server and verify that the users can access files without issues.
Third option – Third party tools
There are many third-party tools which can do the job. While Xcopy and Storage Migration Service are tools from Microsoft, many third-party tools might be just enough.
I can mention Cjwdev’s NTFS Permissions Reporter which is a good tool that helps you export file and folder permissions. It will display group members right in the report. You can pick a report format and choose between a tree or table. You’ll see different colors for different permissions on the source and destination. The tool is highly customizable and easy to use.
Cjwdev NTFS Permissions Reporter
Then, another very similar tool called Permissions Reporter is also a very good Windows NTFS permissions reporting tool. It has the same functionality as Cjwdev’s NTFS Permissions Reporter tool, but has a user interface which is more organized.
Permission Reporter Utility
Then another tool called TreeSize which is paid tool, can also analyse file owners and permissions, NTFS compression rate, and much more. It can also process NTFS Alternate Data Streams and NTFS Hardlinks, will export scan results to various file formats, and provides command-line automation options.
Final Words
Shares migration with File and folder migration with complex permissions are usually only possible with good tools. In this post we have touched some of them. My preference goes to Microsoft but there might be other third-party tools which do better job.