Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copying network files and keeping shares

Status
Not open for further replies.

dtk3

MIS
Feb 24, 2004
44
CA
Hello. I am going to be transferring a large amount of user files to a new server and don't want to have to reconfigure all the network shares and permissions for these files. Is there a program or a way of copying these files from the old server to the new server and keeping the folder share/permission settings intact?

Thanks!

Cheers
DTK3
 
Locate RMTSHARE from the Windows NT resource kit and use that to enumerate all the shares and permissions. Do a bit of fancy editing to create a batch file to recreate the shares on the other server.

Now, use ROBOCOPY to copy the files/directories over to the new server.

Now run the batch file you created.

Test the permissions. If it all goes well then you can do it for real.
 
Thanks. I've actually been looking into using XCOPY. My tests worked for copying files within the folders but not the folders themselves. Am I missing a parameter?

Cheers
DTK3
 
Hello. My servers are Win2k.

Cheers
DTK3
 
XCopy won't copy permissions so it's a non-starter for moving shares and user folders. If you don't have shares and aren't worried about permissions then you can use xcopy. To ensure all the folders go across use the /S parameter.
 
Hello! From what I've been reading on the net I thought XCOPY was the replacement for NT's SCOPY?

I'm just running a test of the ROBOCOPY and it does seem to be copying over my folders (yay!) but I still need to make sure that it will copy permissions as well.

Thanks!

Cheers
DTK3
 
Hello again. I've been looking at robocopy and my tests seemed okay but I'm not sure how to get the permissions over.

Castor66 you mentioned creating a batch file to get the permissions transferred and I'm not familiar as to what the 'fancy' editing is. I can use RMTSHARE to view the shared files that exist on the old server but I'm not sure what to do next. Does anyone have any ideas?

Thanks!

Cheers
DTK3
 
xcopy on 2K does carry over permissions (otherwise you need scopy on NT).

xcopy /e /h /i /c /o

/e copies subdirectories including empty ones
/h copies hidden files
/i creates new directories automatically
/c continue on errors
/o copy ownership and ACL information

The only problem is you need to have read access on all the files you are trying to access.

Don't create any directories on the new server - xcopy must create the root folders automatically otherwise if you create the directories on the new folder you must specific permissions before doing your xcopy.

so, if one of you shares is apps on the d: drive of oldserver and you are moving to apps on the d: drive of newserver you would use

xcopy /e /h /i /c /o \\oldserver\d$\apps\*.* \\newserver\d$\apps

(you can copy during the day and then when you are ready to migrate servers add the /d command and it will only copy files that have changed or are new since the previous xcopy)

so if you have 100's of gigs, you can let it run without downing the servers, then run the command again

xcopy /e /h /i /c /d /o ..... and add the /d to get all the files that are new or have been modified. It's how I like to do my changeovers to reduce server downtime since I maintain full control on all directories as a domain admin.

You would need to manually create the share though. If you have hundreds of shares then I guess that is an issue but there are other mentions of utilities to create those shares automatically though.

Typically I assign permissions at only the NTFS level and not at the share level though so if I had a hundred shares I would just script it using net share (net share to get the info from the previous server, maybe import it into excel, and then reformat the command on the the new server to create the shares automatically and default to everyone full permissions).

Harry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top