Solved

robocopy not transferring Security to new destination

Posted on 2010-11-22
26
908 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:Miffanwee
  • 15
  • 10
26 Comments
 
LVL 1

Author Comment

by:Miffanwee
ID: 34189979
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
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 34190526
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.
0
 
LVL 2

Expert Comment

by:MtnNtwks
ID: 34193524
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
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34194871
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
0
 
LVL 2

Expert Comment

by:MtnNtwks
ID: 34195301
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.
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34195323
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
0
 
LVL 2

Expert Comment

by:MtnNtwks
ID: 34195338
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 :)
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34195346
omg....I will try it immediately.
:o)
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34195399
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

0
 
LVL 2

Expert Comment

by:MtnNtwks
ID: 34195474
I hope you didn't copy/paste that line exactly.  my folder names were merely examples.
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34195480
no I didnt I have been transposing the correct text dont worry
:o)
0
 
LVL 2

Expert Comment

by:MtnNtwks
ID: 34195498
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
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34195548
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.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:Miffanwee
ID: 34195786
/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
0
 
LVL 2

Expert Comment

by:MtnNtwks
ID: 34198244
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.


0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34204928
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
0
 
LVL 2

Expert Comment

by:MtnNtwks
ID: 34208125
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.  
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34211705
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)
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34211758
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

0
 
LVL 2

Accepted Solution

by:
MtnNtwks earned 500 total points
ID: 34211991
After all this, I'm all out of ideas.  I don't understand why the permissions aren't copying.  That's what /COPYALL does.  Maybe try not using robocopy.  Download RichCopy with is supposed to be Microsoft's sequel to robocopy.

This site gives a full description of all the switches for robocopy:
http://www.mydigitallife.info/2007/05/07/robocopy-syntax-command-line-switches-and-examples/

I've never had a problem copying permissions.  You did mention your trying to do this from a windows 7 laptop.  Try doing it directly from a console  at the source's server.

Sorry after all this, I didn't have the magic solution for you.
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34212000
No problem, you have been amazingly helpfull, not to mention patient!

I am happy to try something else.
Miff
0
 
LVL 2

Expert Comment

by:MtnNtwks
ID: 34212160
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
0
 
LVL 1

Assisted Solution

by:Miffanwee
Miffanwee earned 0 total points
ID: 34213315
Regret to say that it didnt work....however....NIL DESPERANDUM!

XCOPY "\\server01\users\user g\"  "\\server02\d$\users\user g" /o/x/e/h/k

Has completely solved my issues....it has copied the files / folders AND kept the security settings.

ROBOCOPY can stay in the box.....never to be reference again by Miff!

Sorry to waste your time, its been emotional
:o)
Many thanks for you help, you may now sleep easy!
Kind regards
Miff
0
 
LVL 2

Expert Comment

by:MtnNtwks
ID: 34213739
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 :)
0
 
LVL 1

Author Comment

by:Miffanwee
ID: 34213841
Oh gosh yes! Happy thanksgiving I forgot! Have a toast in celebration...end of thread rofl
Miff
0
 
LVL 1

Author Closing Comment

by:Miffanwee
ID: 34237209
So greatfull for your patience.
I hope I haven't driven you mad.
Kind regards
Miff
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now