Topics Map > Storage > uFiles
uFiles: Bulk Copying Files for Administrators
How to copy lots of files, including file permissions, from an existing Windows file share to uFiles
The process detailed below is meant to be performed by the administrator of an existing file share, and not by end users.
If you are running these commands from your existing server, the person running this needs to be an administrator that can view all files. (Might have to, under Windows 2008, right-click and “Run As Administrator” command prompt.)
If copying files from an NTFS file system
ROBOCOPY [DIRECTORY-NAME] \\UFILES\UWM\DESTINATION\ * /E /COPY:DATSO /R:1 /W:5
(Copying Auditing information does not work at present, but we're looking into it.)
If copying files from pantherFILE, UNIX, Linux, or MAC OSX
Permissions and file ownership do not copy over. Create directories with the permissions structure that you want before copying files, and then copy files into these directories. The files will inherit the correct permissions from the new directory structure. It is probably best if you create a batch file that copies over/mirrors data for each sub-group or major folder within your area. (Basically, copy everything at once that has the same permissions.)
The uFiles-Administrator Group for your area must have access to ALL files
The Administrator group for each uFiles share is also used by the backup system to back up files. If the Administrator group for an area cannot see a file it cannot be backed up.
It is best if existing files are granted this access before files are copied over.
To edit an existing ACL to grant your Adminstrator group access to files:
Launch a CMD prompt with an account that has administrative rights to the file. Change directory to the highest level of the directories that will be migrated:
ICACLS [DIRECTORY-NAME] /GRANT AD\XYZ-uFiles-Administrators:F /T /Q
Be sure to replace “XYZ” above with the correct three or four letter abbreviation for your unit, as listed in Active Directory. Please contact the IS Team if you are unsure what group is the correct one.
ROBOCOPY [DIRECTORY-NAME] /e /copy:DATSO /dcopy:T
Sometimes the /zb option is needed if permission failed. It should be noted that using the /Z switch results in marked slowdown of copy operations, however it is more reliable over an unreliable network connection.
To re-synchronize uFiles with your original source directory, use the option ”/copy:DATO /dcopy:T /mir” for update passes.
If you don't care about file ownership then I drop the “O” option from the /copy. Dropping the “S” option from the /copy can be useful when you've already set up your permissions structure on the target. New files will inherit the permissions of their parent folders. This is particularly useful if you are using this migration as an excuse to simplify directory permissions.
BEWARE: the /mir option copies in “mirror” mode, which will DELETE from the target any files that do not exist in the source. It's designed to quickly make the two directories identical.
You can save a log of what is being done:
robocopy [source dir] [target dir] *.* /mir /dcopy:T /copy:DATSO /r:3 /np /fp /ts /log:e:\logs\placeshift.%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%.%Time:~3,2%%Time:~6,2%.log
For more information on Robocopy see: http://technet.microsoft.com/en-us/library/cc733145.aspx