The joys of migrating files
by, 12th June 2010 at 03:04 PM (3162 Views)
It's funny, I don't usual blog and tend to pop on Edugeek with problems but it's a great resource and one I'm very pleased to have found (otherwise I think by now I'd have given up all hope, especially after the last couple of weeks).
But the latest problem, how to migrate a load of files, preserve permissions and do it dead easily.
I've used Robocopy with the GUI in the past to move files and it worked a dream, however for whatever reason (probably me being dumb) I couldn't get it to do what I wanted, migrate all the files and preserve all ownership, time stamps, acl's ect. It is possible and now I've done it using the command line I really don't know why I couldn't do it. But I thought I'd post it up here in case anyone else wants it or I need to do it again and have exactly the same problem.
First off because I couldn't do it, I started with XCOPY which was brilliant, fairly quick and did everything I needed except copy the timestamps of folders. That was done using:
xcopy z:\ "F:\staff shared\" /E /K /O
Wonderfull, but as mentioned because I'm pernickity I'd like to keep all the folder timestamps. (This will be my eventual tool for beating people round the head saying do you really need this folder from 2005/04/02 ect).
And so it was back to robocopy. The eventual command line I used was:
robocopy Z:\ "F:\staff shared" /COPYALL /E /R:0 /DCOPY:T
And off it trundelled and is doing exactly what it said on the tin and doing it brilliantly. The one little switch I couldn't work out for the GUI? /DCOPY:T which copies the directory timestamp.
The only other little gotcha that caught me out, was that the destination directory, doesn't like to have a \ on the end, especially if there's a space in it. Otherwise you just get loads of access denied errors and the impossibility of working out why (especially when your logged on as Administrator).
Wonderful, and now I can go back to beating staff round the head. Ideally you'd do this before you copied all of their stuff across, but time is short and I need to rebuild the server before the other one dies alas.
Oh the joys of working in IT!
Total Trackbacks 0