1. Home
  2. File Server Migration

File Server Migration

Recently we ran into an issue where we discovered that our file server shares were being run directly off the C: drive. This is a huge issue because as Windows hosts run out of disk space they begin to slow down drastically.

Our resolution for this issue was to add another disk to the machine and copy the shared data over to the new disk. Early on we ran into the issue where more than half of our files wouldn’t copy due to permissions issues with our robocopy command. After spending a good chink of time understanding robocopy better, this is the command that ended up solving all our issues:


robocopy "C:\SHARED" "M:\SHARED" /E /B /MIR /XO /r:2 /w:3 /copyall /log:M:\ROBOCOPY-Logs\SHARED.log /V /NP

robocopy "C:\SHARED" "M:\SHARED" /E /B /MIR /XO /r:2 /w:3 /copyall /log:M:\ROBOCOPY-Logs\Last-Copy\SHARED.log /V /NP

get-content 'M:\ROBOCOPY-Logs\SHARED.log' -Tail 0 -Wait

The first command is our first run of the command and it outputs the results of the copy on the M: drive in the shared log file. After running this command, I restarted all machines that connect to this file server as well as the file server itself to clear all locks on files.

The second command does the same thing as the first machine, however it creates a new log file that shows what was copied the second time around as well as if anything was missed.

The third command is a PowerShell command that allows you to view the log file in real time as the first two commands were running.


Explanation of the above robocopy command:

  • /E – Copy subfolders including empty subfolders
  • /B – Copy files in backup mode
  • /MIR – Mirror a directory tree
  • /XO – If destination file exists and is the same date or newer than the source, don’t overwrite
  • /r:2 – Number of retries on failed copies
  • /w:3 – Wait time between retries
  • /copyall – Copy ALL file info. This will prevent dehydrating offline files and will instead copy the file’s tag (on emc VNX/Unity systems at least). This is not officially documented! If dehydration is what you need (reason i found this issue), you can’t copy the ACLs along your files.
  • /log:M:\ROBOCOPY-Logs\SHARED.log – Output status to log file and overwrite
  • /V – Produce verbose output log, showing skipped files
  • /NP – No progress. Suppresses the display of progress information. This can be useful when output is redirected to a file.

Comments

  1. 940281 326688Take a peek at the following guidelines what follows discover ideal approach to follow such a mainly because you structure your small business this afternoon. earn cash 107152

  2. 641103 587337Thank you pertaining to giving this excellent content material on your web-site. I discovered it on google. I may possibly check back again if you publish extra aricles. 559900

  3. 611850 466288A very quite interesting article! Ill try to track that continues here! Thank you. 40762

  4. 22827 115224Does your weblog have a contact page? Im having a tough time locating it but, Id like to send you an e-mail. Ive got some suggestions for your weblog you might be interested in hearing. Either way, wonderful website and I appear forward to seeing it expand over time. 693798

  5. 927099 951706When I originally commented I clicked the -Notify me when new surveys are added- checkbox and from now on whenever a comment is added I purchase four emails sticking with exactly the same comment. Maybe there is by any indicates you could get rid of me from that service? Thanks! 94621

  6. I visit day-to-day some sites and information sites to read articles or reviews,
    except this webpage gives feature based articles.

    My web page :: E Sigara

  7. Undeniably believe that which you stated. Your favorite justification seemed to be on the
    net the easiest thing to be aware of. I say to you, I definitely get annoyed while people
    think about worries that they plainly don’t know about.

    You managed to hit the nail upon the top and defined out the whole thing without having
    side-effects , people can take a signal. Will probably be
    back to get more. Thanks

    Also visit my homepage … Elektronik Sigara