Windows Server 2008 R2 Thread, Data migration in Technical; Hi all,hope someone can help with this. Sure it can be done.....
I am migrating users home directory contents from ...
-
3rd August 2012, 06:04 PM #1
- Rep Power
- 6
Data migration
Hi all,hope someone can help with this. Sure it can be done.....
I am migrating users home directory contents from Z:\student data\yr11\%username% to h:\student data\yr11\%username%$\
instead of going into the origional location and copying stuff to the new root folder (2000+ folders) is there a way of doing this via a utill or script?
Basically i want all data from within the origional folder into the new withour copying the origional root folder.
hope this makes sence and im not trying to re-invent the wheel !
Many thanks in advance
-
-
IDG Tech News
-
3rd August 2012, 06:51 PM #2 It's possible I completely misunderstand what you want (and this may be exactly what you are trying NOT to do?) but Robocopy is my weapon of choice when it comes to copying or moving large amounts of data.
Put a list of usernames (1 per line) in a file called users.txt then use something like:
FOR /f %i IN (users.txt) DO robocopy "Z:\student data\yr11\%i" "h:\student data\yr11\%i" /e /copyall (/move?) (/log:c:\usercopy.txt?)
Usual disclaimers.... Do this at your own risk.... Robocopy will happily DELETE things too if you tell it to... I ALWAYS test these scripts with a few test folders first.
-
Thanks to kearton from:
richbrowncardiff (4th August 2012)
-
3rd August 2012, 07:03 PM #3 Another vote for robocopy, it is a command line app but will keep security acls on the files and is probably the fastest method avalible. I have used it many, many times for that kind of thing.
-
-
3rd August 2012, 11:13 PM #4 Another way of doing this, this is the way i do this sort of stuff
1- Create a folder, best to name it the name you want for the share.
2- Set the correct share permissions (groups recommended) and also NTFS permissions.
3- Copy all the users folders to the folder you just setup.
4- Then in Active Directory highlight all your users for this folder change and then right hand click and properties, tick the box for the home drive, choose the drive letter and then type in your share path and then %username% so yours will be \\student data\yr11\%username%\
This will change all the users folders to the correct permissions for each user.
For this to work through you need your current users folders named with their username
I have used this method a few times, works great!
Last edited by pritchardavid; 3rd August 2012 at 11:15 PM.
-
Thanks to pritchardavid from:
richbrowncardiff (4th August 2012)
-
3rd August 2012, 11:19 PM #5 
Originally Posted by
pritchardavid
Another way of doing this, this is the way i do this sort of stuff
1- Create a folder, best to name it the name you want for the share.
2- Set the correct share permissions (groups recommended) and also NTFS permissions.
3- Copy all the users folders to the folder you just setup.
4- Then in Active Directory highlight all your users for this folder change and then right hand click and properties, tick the box for the home drive, choose the drive letter and then type in your share path and then %username% so yours will be \\student data\yr11\%username%\
This will change all the users folders to the correct permissions for each user.
For this to work through you need your current users folders named with their username
I have used this method a few times, works great!
Are you sure step 4 works? With server 2008 R2 i wont work if the folder already exists.
-
-
4th August 2012, 08:21 PM #6
- Rep Power
- 6
Thanks all.
Im looking at the robocopy (gui) route which works as i need (x:\location\yr11/username) > (y:\location\yr11\username$) **contents of original username copied into username$**
I just need to get the process a little more automated due to the number of users involved.
regarding getting the usernames.txt together do you know of a way of getting this or do i need to manually create the list ?
Many thanks and sorry to sound dumb i used to do this kind of stuff all the time but spend my life in group policy and AD now!
-
-
4th August 2012, 09:51 PM #7 
Originally Posted by
richbrowncardiff
regarding getting the usernames.txt together do you know of a way of getting this or do i need to manually create the list ?
Open a Command Prompt at x:\location\yr11 and do a "DIR >c:\usernames.txt"
Then open the file in Excel as Fixed Width and strip off the first 36 characters.
Then Sort it alphabetically and clean up the handful of extra lines (bytes free, .., etc) that remain.
-
Thanks to kearton from:
richbrowncardiff (4th August 2012)
-
4th August 2012, 10:12 PM #8 
Originally Posted by
kearton
Open a Command Prompt at x:\location\yr11 and do a "DIR >c:\usernames.txt"
Then open the file in Excel as Fixed Width and strip off the first 36 characters.
Then Sort it alphabetically and clean up the handful of extra lines (bytes free, .., etc) that remain.
or dir /b
-
2 Thanks to DMcCoy:
kearton (4th August 2012), richbrowncardiff (4th August 2012)
-
4th August 2012, 10:15 PM #9 
Originally Posted by
DMcCoy
or dir /b
Yep. That's much easier
(Duh me!)
-
-
4th August 2012, 11:59 PM #10 
Originally Posted by
FN-GM
Are you sure step 4 works? With server 2008 R2 i wont work if the folder already exists.
Yes it sure does work 
It does come up with an error when you apply it but it does apply the correct permissons
-
SHARE: 
Similar Threads
-
By Will_Townsend in forum Educational IT Jobs
Replies: 5
Last Post: 21st September 2011, 12:48 PM
-
By gshaw in forum Windows
Replies: 6
Last Post: 6th December 2010, 08:41 AM
-
By duxbuz in forum How do you do....it?
Replies: 12
Last Post: 26th February 2010, 10:01 AM
-
By adamf in forum Windows Server 2000/2003
Replies: 0
Last Post: 3rd March 2009, 09:06 AM
-
By hmd01 in forum MIS Systems
Replies: 2
Last Post: 10th December 2007, 05:02 PM
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
-
Forum Rules