stepbytech

Step by Step Directions for Techs

Migrating file server shares with permissions intact

When you are copying files from one server to another or one volume to another and need to retain the file permissions, robocopy is your guy.  In order to speed things up, I will frequently start multiple windows.  To do this, I will put together multiple lines into a single powershell script that opens multiple windows for me.  Call me lazy, but it works.

cmd.exe /c start cmd /k “ROBOCOPY \\ohsfsdc1\g$\Share1 D:\Share1 /MIR /SEC”
cmd.exe /c start cmd /k “ROBOCOPY \\ohsfsdc1\g$\Share2 D:\Share2 /MIR /SEC”
… and so on

Couple things about this:

  • I usually run it from the destination server (where I am copying things to).
  • You can use this to stage the files, and then rerun it later to grab the stragglers.
  • I don’t believe that it deletes files from the destination that were deleted at the source.
  • This only copies the folder level permissions.  If they have file level permissions (which they shouldn’t because they are evil), there is another robocopy command that you can run that will copy those individual permissions after the main copy has finished.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: