Wednesday, June 1, 2011

Migrating users to new Xserve

School is now over and student laptops are re-imaged. Now just have to migrate teacher and staff accounts over a new server. Here is a bit of background info: We have Mac Xserves and Clients. All students grades 7-12 have laptops, white MacBooks, that they can take home and use during the school year. Teachers also have white MacBooks that they keep year round. All students and staff have mobile accounts on their laptops that sync to our servers when they are here at the school. Now I am to the point where I am migrating all Teachers and staff over to new server. Here is how I have done this so I do not have to move any files from one server to another. Then have to go around to all the laptops and delete old accounts and hope that when the login to their new account all their stuff is there and nothing is missing. Most everything is done in terminal. I am switching from a server named bengal over to server named malayan. I will use these name in my example you will want to replace these name with name schema within your network

These commands need to be ran as root.  Enable root using Directory Utility.  Then either log in as root or an administrator.  If logged in as an administrator type su in the terminal to switch to root access. My old short user name was 00rogeja and my new short user name is 00jasonrogers

Note: replace what is in quotes with your own information and do not use the quotation marks. The scripts will not work if they are used. Also after each line of commands press the return button before going on the the next line.

##################################################

# Copy the user's current home directory and rename it to the shortname of their new home directory on your new server.

Commands:

cd /Users

ditto -V "00rogeja" "00jasonrogers"

##################################################

# Remove the user's plist file from /var/db/dslocal/nodes/Default/users/

cd /var/db/dslocal/nodes/Default/users

rm "00rogeja.plist"

##################################################

#Bind computer to new server

In 10.6 go to  > System Preferences > Accounts > Login Options > Join

In 10.5 go to Applications > Utilities > Directory Utility

##################################################

# Change permissions for newly created home directory.

cd /Users

chown -R "00jasonrogers" "00jasonrogers"

##################################################

# Restart Computer

shutdown -r now


It been awhile but I am back

Well it has been a long while since I have done anything with this so I thought I would resurrect my old blog and hopefully in is helpful and educational. Knowledge/Information is a gift to be give to others. Having knowledge and choosing not to share it is like having a surplus of food but not sharing it with those around you who are starving.