File and Directory Migration
Everything covered to this point has been done in preparation for the migration of file and directory
data. For many people preparation is potentially boring and the real excitement only begins when file
data can be used. The next steps demonstrate the techniques that can be used to transfer (migrate)
data files using the
net
command.
Transfer of files from one server to another has always been a challenge for MS Windows
administrators because Windows NT and 200X servers do not always include the tools needed. The
xcopy
from Windows NT is not capable of preserving file and directory ACLs,
it does so only with Windows 200x. Microsoft does provide a
utility that can copy ACLs (security settings) called
scopy
, but it is provided only
as part of the Windows NT or 200X Server Resource Kit.
There are several tools, both commercial and freeware, that can be used from a Windows server to copy files
and directories with full preservation of security settings. One of the best known of the free tools is
called
robocopy
.
The
net
utility can be used to copy files and directories with full preservation of
ACLs as well as DOS file attributes. Note that including ACLs makes sense only where the destination
system will operate within the same security context as the source system. This applies both to a
DMS and to domain controllers that result from a vampired domain.
Before file and directory migration, all shares must already exist.
The syntax for the migration commands is shown here:
net rpc share MIGRATE FILES <share-name> -S <source>
[--destination=localhost] [--exclude=share1,share2]
[--acls] [--attrs] [--timestamps] [-v]
If the <share-name> parameter is omitted, all shares will be migrated. The potentially large
list of shares on the source system can be restricted using the
--exclude
command
switch.
Where it is necessary to preserve all file ACLs, the
--acls
switch should be added
to the above command line. Original file timestamps can be preserved by specifying the
--timestamps
switch, and the DOS file attributes (i.e., hidden, archive, etc.) can
be preserved by specifying the
--attrs
switch.