Link to home
Start Free TrialLog in
Avatar of Miffanwee
Miffanwee

asked on

robocopy not transferring Security to new destination

robocopy "\\SERVER01\d$\users\user g" "\\SERVER02\d$\users\user g" /COPYALL

Is what I am using and the folder "user g" gets created on the SERVER2 but with none of the original security settings.

Please help I am tired and lost.

correct syntax needed for my tired brain.

I need this to move 100gb of data from old server to new keeping ALL security settings, that allow only certain users to access certain files / folders.
If you have the correct syntax for that I would be very greatful.
Regards
Miff
Avatar of Miffanwee
Miffanwee

ASKER

P.S. I am sorry to raise this thread as I have read the others on this site, but I simply cannot get this to work even with /IS /COPY:SOU
etc...etc...

Miff
Avatar of Joseph Daly
Normally when i run a robocopy command i will use the following switches.

/mir /sec /copyall /zb

Be careful with MIR as it will delete files if they dont exist in your source directory.
Here's what I use:

robocopy /COPYALL /E /R:0 /W:0 <source> "<destination>

So for a live example, I cd to the directory I want to copy, and we'll say I want to copy to a folder on Drive which I've mapped as "G"

C:\samplesource\> robocopy /COPYALL /E /R:0 /W:0 . "G:\sampledest

Since I'm in the source directory, I specify a "dot" as the source.

For my destination, I just use an open quote...the close quote is added automatically, and if you try and close the quote yourself, you'll get an error.

The two things I see when looking at your command string is that you are using closing quotes, and you are specifying the options after the paths.  The options go in front.

Try it like this:
robocopy /COPYALL /E /R:0 /W:0 "\\SERVER01\d$\users\user g "\\SERVER02\d$\users\user g
Perhaps I should add a bit more info....

Sparked by MtnNtwks comment about navigating to location....

I am calling ROBOCOPY from my Windows 7 Laptop and instructing a file copy from One location to another.

Is it standard practice to navigate to location and Map drives etc?

Surely it must be possible to do what I am trying?

So what would be the syntax in my scenario I have just explained?

Thanks for your help
Miff
I don't know that it's standard practice, but I'm lazy :)  I've also got "command prompt here" installed so that when I right click on a folder, it brings up a command prompt in that folder.

In the end, it really doesn't matter as long as you get the desired result.  So if you bring up your standard command prompt at C:\> and you want to execute your command located someplace else, use the following as an example.

C:\>robocopy /COPYALL /E /R:0 /W:0 "G:\someplace\with a folder that has spaces "D:\anotherplace\you want your data to live\

I haven't tried UNCs, \\someplace\out\there, but I would guess they'll work.

Instantiate your instance of robocopy by calling it by name, followed by the options, then the source, then the destination.
Apparently UNC's are causing "an" issue....hence the Speech marks.

I will try your latest suggestion.
Are you on UK time I dont want to keep you awake!
Appreciate your help
Miff
LOL....I'm in the west coast of the US.  It's 2am.  And there's no better cure for insomnia than reading technical threads on a bulletin board :)
omg....I will try it immediately.
:o)
Would a Hidden $ share be causing issues too?

This is not working

I have tried ....

C:\>robocopy /COPYALL /E /R:0 /W:0 "\\server01\someplace\with a folder that has spaces "\\server02\d$\\anotherplace\you want your data to live\

Miff

I hope you didn't copy/paste that line exactly.  my folder names were merely examples.
no I didnt I have been transposing the correct text dont worry
:o)
In any case, I see an extra \

source is \\server01\blah\blah\blah and destination (even if it's hidden) is \\server02\d$\blah\blah
sorry that was a typo.

If I use the following text...
C:\>robocopy /COPYALL /E /R:0 /W:0 “\\server01\users\user g “\\server02\d$\users\

(note the space between "user" and "g" is intentional)

I get the following output....

  Started : Tue Nov 23 10:40:24 2010

   Source - C:\Users\userg\"\server01\users\user\
     Dest - C:\Users\userg\g\
    Files :
  Options : /S /E /COPYALL /R:0 /W:0
-----------------------------------------------------
ERROR : Invalid Parameter #7 : ""\\server02\d$\users\"

Which is  wrong on all counts.... even the source address is incorrect.
/COPYALL /E /R:0 /W:0 "\\server01\users\user g " \\server02\d$\users\

This copied all the files over BUT without the original Security settings.

Miff
strange.../COPYALL is supposed to include all the security settings.  Were you copying to an empty folder, or was there data already there?  If it was an empty folder, delete everything in it and try again putting the option switches at the end.

Originally I said, "The options go in front." But I may have to do a "take back" on that one.  It may be working, but with the default switches.  So try


ROBOCOPY "\\server01\users\user g " \\server02\d$\users\ /COPYALL /E /R:0 /W:0

other switches to try:
/SEC :: copy files with SECurity (equivalent to /COPY:DATS).
/SECFIX :: FIX file SECurity on all files, even skipped files.

I'm all out of ideas if that doesn't work.


Now I am really annoyed.

I have to mess with the syntax to get it to read from the correct path and then write to the correct path, and now I am in trouble because somehow ROBOCOY has created a folder called....

User G "

Now I cannot delete this folder, probably becasue of the speech mark it has created.
I have restarted the server and still no joy.
I cannot believe I have struggled to copy files AND security for nearly 2 days on and off!
Angry is not the word.
I appreciate your help though.
Any ideas on gettting rid of the error folder?
Miff
Well ok...don't get Miffed :P

If the folder won't delete, it's probably because there's some subfolder or file you don't have access to.  So try this.  Right click on user g and choose security.  make sure that you give administrators full control over the folder.  Then click on "advanced" and click the second checkbox which says "replace permission entries on all child objects...."

When that's done, you should be able to just delete the folder.

BTW, the reason it created user g is because you didn't put a closing slash on the source.  you said \user g instead of \user g\  This means it copied the folder, and all it's contents, instead of just the contents of user g.

Here is the corrected version:
ROBOCOPY "\\server01\users\user g\ " \\server02\d$\users\ /COPYALL /E /R:0 /W:0

I'm going to throw out a disclaimer.  It's hard to work and troubleshoot issues thousands of miles across the globe, without being there to actually see what's going on.  We have to rely on each other's ability to communicate.  So I don't want to get blamed if you copy everything from "user g" to "users" on the new server, and because of that, something else gets munched on the new server in the process.  If I were to look at this folder structure without having any background, I would assume the source server has a user named "user g", not a folder with all the users in it.

I'll probably be up late tonight if you want to try working with an IM client.  
Hi MtnNtwks,

Many thanks for help, no need for the disclaimer, all is well.
This is a new drive in preparation for LIVE.
As it happens the RAID had been misconfigured so I had to rebuild the drive which got rid of the rogue folder anyways....however prior to reconfiguring the RAID I did have a look at the permissions and I should have been able to delete it but couldn't......but nevermind now.

Back to the ROBOCOPY command.
I now have a new drive and I will try your last comment.
Miff....(not miffed) ;o)
Ok....Back on track now.

It started a copy however it is NOT copying the security settings still.

For clarification I would like the same folder structure copied over as well which means the "User g" needs to be created on the destination drive, and rather than get the text wrong again and create a folder I cannot delete, what would be the correct syntax?

my suggestion is...
ROBOCOPY "\\server01\users\user g\ " "\\server02\d$\users\user g" /COPYALL /E /R:0 /W:0

Cheers
Miff

ASKER CERTIFIED SOLUTION
Avatar of MtnNtwks
MtnNtwks
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No problem, you have been amazingly helpfull, not to mention patient!

I am happy to try something else.
Miff
Remember not to close the quotes.  IMO this is stupid, but if you close quotes, it will throw an error and won't copy anything.

Like this:
ROBOCOPY "\\server01\users\user g\  "\\server02\d$\users\user g\ /COPYALL /E /R:0 /W:0
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hahaha.... When I woke up this morning, I was actually going to suggest that.

xcopy *.* /s/h/c/y/e/d/x/k

Just something to know for the future, however....  if the path your are copying has more than 256 characters from drive letter to closing slash, it will bomb out on you saying "insufficient memory."  And you'll wonder saying "huh?...I've got 16gb of ram?"

Mostly you find that issue in "documents and settings\internet explorer\temporary internet files\content.IE\someridiculouslylongstringynameddirectorywhichmakesnosensetonamethisway\"

Happy US Thanksgiving :)
Oh gosh yes! Happy thanksgiving I forgot! Have a toast in celebration...end of thread rofl
Miff
So greatfull for your patience.
I hope I haven't driven you mad.
Kind regards
Miff