Migrating user profiles

a_simmons
Contributor II

I was wondering what methods other Casper users where using to migrate user profiles to new Macs and re imaged Macs.

11 REPLIES 11

chrispetersmark
New Contributor

When I do user migrations, I use the regular Apple Migration Assistant (with the users' old machine in target disk mode). I'll image the new Mac with Casper & set up the Administrator user, then do the transfer without network settings selected. After the transfer finishes, I do a few more steps:

-Go to /etc/ -Trash the "HostConfig" file and rename "HostConfig~orig" to "HostConfig"
-Reinstall/Reactivate Parallels (if you use it)
-Force unbind/rejoin the new machine to Active Directory (again, may be unique to my org here)

Then I just do all the regular new Mac set-up things, like adding the user to FileVault, etc. Hope this helps!

Not applicable

Migration Assistant doesn't play especially well with AD mobile accounts - so I usually just use rsync from the old Mac to the new one. Log in with the user's AD creds on the new box, then something like:

rsync -avhPrz --exclude=Trash* --exclude=Cache* --exclude=PubSub* --exclude=ipsw* /Users/username/ username@x.x.x.x:/Users/username

I usually also exclude printers just to make sure that the user ends up in the most recently installed ones. Change the username@ip to /Volumes/newmac - usually /Volumes/Macintosh HD 1 - if you're using FWTDM instead of over the network.

bentoms
Release Candidate Programs Tester

@a.simmons, we move home folders from Mac-to-Mac under the local admin account, then run the below linked script via Self Service.

http://macmule.com/2013/02/18/correct-ad-users-home-mobile-home-folder-permissions/

Then log out as local admin & login as migrated user.

a_simmons
Contributor II

Thanks for that advice. Is the problem with migration assistant only with the permissions? If I was to migrate user data and applications so apps that are not packaged get moved over using the migration assistant, leaving the networks settings and settings option unselected. Then run Ben's script to correct the mobile home user folder permissions. Would that fix the problems?

Bhughes
Contributor

Thanks @bentoms https://macmule.com/2013/02/18/correct-ad-users-home-mobile-home-folder-permissions/ worked great to fix the perms after user migration!

bentoms
Release Candidate Programs Tester

@Bhughes Awesome!

ayotec
New Contributor

HI @Bhughes

When you used the https://macmule.com/2013/02/18/correct-ad-users-home-mobile-home-folder-permissions/ worked great to fix the perms after user migration! script did you had to edit any of the values. I am not good with scripting so I can't see anywhere that needs changing. From my understanding it does a lookup so no need to change any value in the script. Please correct me if am wrong.

Thanks

Nix4Life
Valued Contributor

2nd rsync and sometimes tarball

bpavlov
Honored Contributor

For some reason, i got an email notification with @bentoms's last post in this thread instead of the post by @ayotec. Very bizarre.

sbeech
New Contributor II

Is there a optimal way to migrate users with a local profile, before JAMF enrollment; and turn these profiles into AD profiles; after binding to AD?

chris_hansen
Contributor

Might not be optimal, but I use this script.
Have them turn off synching services, be sure they know their current password.

#!/bin/sh
# Chris Hansen, Humboildt State University, 6/6/2015
# $4 variable accepts local shortname in JAMF
# $5 variable accepts domain shortname
# Bind the machine and have the user log in with domain credentials before running script to create an empty home :-(
# No user logged in while running.

# Sanity checks# Make sure we're bound to AD
check4AD=`/usr/bin/dscl localhost -list . | grep "Active Directory"`
if [ "${check4AD}" != "Active Directory" ]; then
    echo "This machine is not bound to Active Directory.
Please bind to AD first. "
    exit 1
fi
# Make sure the users are not logged in and the source and destination directory exists

#Determine current logged in user
User="$(who|awk '/console/ {print $1}')"

#Run command if user is logged in
if [ "$User" = "$4" ]; then
    echo "$4 is logged in. Stopping"
    #Insert command you wish to run here
    exit 1
else
    if [ "$User" = "$5" ]; then
    echo "$5 is logged in. Stopping."
    #Insert command you wish to run here
    exit 1
else
echo "Neither user logged in, continue."
    #exit 0
    fi
fi
if [ -d "/Users/$4" ]; then 
result="/Users/$4 exists" echo "<result>$result</result>"
else echo "<result>/Users/$4 does not exist. Stopping.</result>"
exit 1
fi
if [ -d "/Users/$5" ]; then 
result="/Users/$5 exists" echo "<result>$result</result>"
else echo "<result>/Users/$5 does not exist. Stopping.</result>"
exit 1
fi

# Rename Destination dir
mv /Users/$5 /Users/$5-old
echo "Renamed /Users/$5 to /Users/$5-old"
# Rename source
mv /Users/$4 /Users/$5
echo "Renamed /Users/$4 to /Users/$5"
# Change ownership permissions on destination
chown -R $5 /Users/$5
echo "Changed ownership of the transferred $4 files to $5"
exit 0

Have them log in and test.

After running, they will likely have a login keychain mismatch after the move, so coach through Update Keychain with current password = old local password and new password = current AD password.
(Recent documents in most apps will likely be goofy.)

Dropbox uses a hard-coded path that may be irritating.

Here's what they do to fix Dropbox.

After move, dropbox keeps looking for files in old location, then closes, no chance to recreate.

Followed these steps, which I got from dropbox forums:

Download the newest version:

www.dropbox.com/install

Stop or Quit Dropbox (If needed, in our case, dropbox failed to launch)

  • Click the Dropbox icon in the menu bar at the top of your screen
  • Click on the gear icon in the Notifications panel and select 'Quit Dropbox'

Delete Dropbox meta-data folder:

  • To delete this folder open a Terminal (Located at /Applications/Utilities/Terminal for Mac OS)
  • Copy and paste the following lines into the Terminal and press RETURN:

mv ~/.dropbox ~/.Trash/dropbox.old mv ~/.dropbox-master ~/.Trash/dropbox-master.old

  • This will move the folder to the Trash and make it visible. Please note that you could see an error message regarding the existence of the folder ".dropbox-master" when you run the last of the lines above. This is completely normal and you can go on with the next step.

Delete the Dropbox Contextual Menu Item Plugin

  • Open the Finder and select Go to folder... from the Go menu (or press Shift-Command-G)
  • A dialog box should appear. Now copy and paste the following line into the box and press the return key:

/Library/

  • Finally drag the DropboxHelperTools folder to the Trash and enter your Administrator password if prompted to complete this action.

Reinstall the Dropbox desktop application

  • Open the Dropbox .dmg file and double click the Dropbox icon.
  • Dropbox should appear in your menu bar.
  • Relink your account.