+ Post New Thread
Results 1 to 8 of 8
How do you do....it? Thread, Move or copy a large directory tree in Technical; I am currently sorting out the directory and file structure on the new W2008 64bit domain server. I want to ...
  1. #1
    leco's Avatar
    Join Date
    Nov 2006
    Location
    West Yorkshire
    Posts
    2,026
    Thank Post
    595
    Thanked 125 Times in 119 Posts
    Rep Power
    41

    Move or copy a large directory tree

    I am currently sorting out the directory and file structure on the new W2008 64bit domain server. I want to move a rather large (and deep) directory up a level. What are the recommended ways of doing this?

    I have heard of Robocopy, but have not used it before and not sure if it works for 2008. Would I be able to copy the whole tree from one place to another on the same server? Does it retain things like time stamps and access and security information? I have read the Robocopy syntax but as I said being a newby on this I'd like some guidance please.

  2. #2
    mb2k01's Avatar
    Join Date
    Jan 2007
    Posts
    1,138
    Thank Post
    189
    Thanked 230 Times in 195 Posts
    Rep Power
    92
    How large are you talking about?
    Are there likely to be locked files in the tree or is it largely data that no one will be accessing?

    If you're only talking about a few GB of data, and it was still Easter there (with no one else accessing files etc), then I would be inclined to just copy via explorer.

    If it's a bit messy and you would like an alternative app, I haven't used Robocopy (although i've seen it mentioned before with good feedback) but have used Beyond Compare.

    Permissions / security will depend on whether permissions are inheritted from the folder above and if you're moving it to the same volume etc.

  3. Thanks to mb2k01 from:

    leco (13th April 2009)

  4. #3

    AngryTechnician's Avatar
    Join Date
    Oct 2008
    Posts
    3,730
    Thank Post
    698
    Thanked 1,212 Times in 761 Posts
    Rep Power
    394
    Robocopy is built in to Server 2008 and is in fact recommended over the now-legacy xcopy command. It would do exactly what you need, but it might not be necessary since it sounds like you are moving the folder to another location on the same drive (which is actually just a rename; no new copy of the data is needed), in which case you may be able to use the much simpler move command.

    As mb2k01 suggests, you will need full permissions for your account on all the the files, and for none of them to be locked in use, for that to work. If these conditions are not all true, then robocopy is definitely your friend. This is the syntax I would suggest:

    robocopy "source" "destination" /e /copyall /b /move

  5. Thanks to AngryTechnician from:

    leco (13th April 2009)

  6. #4
    leco's Avatar
    Join Date
    Nov 2006
    Location
    West Yorkshire
    Posts
    2,026
    Thank Post
    595
    Thanked 125 Times in 119 Posts
    Rep Power
    41
    The tree is in the tens of gb region rather than hundreds, not sure if there are any locks - there shouldn't be but there again this is a central store. It's a place where users (staff only) put resources so that others can access them, which is I guess why it has grown so large.

    It would be going to the same volume and would need the same share permissions it has now. And yes they are inherited from the current share. I was holding off from a straight copy as I want to be able to do other things on the server (it being the hols) and I think it would take quite a long time.

    Beyond Compare? Will look that one up, thanks.

  7. #5
    leco's Avatar
    Join Date
    Nov 2006
    Location
    West Yorkshire
    Posts
    2,026
    Thank Post
    595
    Thanked 125 Times in 119 Posts
    Rep Power
    41
    Quote Originally Posted by AngryTechnician View Post
    Robocopy is built in to Server 2008 and is in fact recommended over the now-legacy xcopy command. It would do exactly what you need, but it might not be necessary since it sounds like you are moving the folder to another location on the same drive (which is actually just a rename; no new copy of the data is needed), in which case you may be able to use the much simpler move command.

    As mb2k01 suggests, you will need full permissions for your account on all the the files, and for none of them to be locked in use, for that to work. If these conditions are not all true, then robocopy is definitely your friend. This is the syntax I would suggest:

    robocopy "source" "destination" /e /copyall /b /move
    As I don't think anyone will be there today, this is I think what I need, thanks. Is there a way of checking that everything has moved, apart from the obvious that any file/directory would still be visible in the old location? Do I need another switch to be able to monitor what's going on?

  8. #6
    steve's Avatar
    Join Date
    Oct 2005
    Location
    West Yorkshire
    Posts
    1,043
    Thank Post
    22
    Thanked 177 Times in 123 Posts
    Rep Power
    52
    Robocopy has a huge number of switches you can use. I tend to use:

    Code:
    robocopy.exe "source" "destination" /E /COPY:DAT /R:5 /W:5 /NDL /NP >"logfile.txt"
    Then delete manually after when I've checked the logfile.

    If you want something more graphical there's Robocopy GUI however that needs to be installed.

  9. Thanks to steve from:

    leco (13th April 2009)

  10. #7
    mb2k01's Avatar
    Join Date
    Jan 2007
    Posts
    1,138
    Thank Post
    189
    Thanked 230 Times in 195 Posts
    Rep Power
    92
    Quote Originally Posted by leco View Post
    The tree is in the tens of gb region rather than hundreds....

    ...I was holding off from a straight copy as I want to be able to do other things on the server (it being the hols) and I think it would take quite a long time
    If it's only xxGB and moving to somewhere else on the same physical disk, then it shouldn't take that long at all. As a rough guess i'd say about 5mins per 10GB?

    Sadly I'm still a server 2003 man, but if 2008 has robocopy built in and has the potential to provide a safer move anyway i'd plump for that. You could always test it out on a test directory first to make sure it does what you want (maybe test permissions that way too?)

    If it's a shared area maybe spend a bit of time checking out what the permissions are before you move (just in case!)

  11. #8
    leco's Avatar
    Join Date
    Nov 2006
    Location
    West Yorkshire
    Posts
    2,026
    Thank Post
    595
    Thanked 125 Times in 119 Posts
    Rep Power
    41

    Thumbs up

    Thanks to everyone - move now completed, with a few scary moments in there
    I had to create the Directory first - didn't know that
    On the first run it skipped and failed on a couple of directories. One was a directory that I had forgotten about (special permissions) managed that one on the second pass.

    However, nearly gave myself a heart attack after the second copy as there only seemed to be those two new directories in the destination I thought it had deleted the others with the new move. But of course it hadn't, just me being thick. I still have permissions to sort on the new share, but I think I can manage to do that.

    I need caffeine after all that. Thanks guys, couldn't have done it without you.
    Last edited by leco; 13th April 2009 at 02:02 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. [Video] How not to take a tree down
    By phreak in forum Jokes/Interweb Things
    Replies: 7
    Last Post: 17th March 2008, 11:59 AM
  2. Replies: 1
    Last Post: 1st February 2008, 11:32 AM
  3. large sims directory
    By Uraken in forum MIS Systems
    Replies: 3
    Last Post: 30th October 2007, 02:28 PM
  4. Replies: 19
    Last Post: 20th June 2006, 03:53 PM
  5. Replies: 15
    Last Post: 15th February 2006, 09:22 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •