Posted on 05-20-2011 10:01 AM
Hi guys,
When migrating user profiles from mac to mac or off a mac, what's your workflow?
I do not have 2nd partitions, & as Migration Assistant doesn't seem to see AD Mobile accounts... I do the following;
It works, but wondered if you guys did anything differently? If not I'm looking at possible creating a AppleScript app for the above.
Regards,
Ben.
Posted on 05-20-2011 12:06 AM
This should help. It's what we used for our refresh. You'll need to adjust the group name to match your environment.
I used tar because I knew it could be trusted to replicate things exactly. I had tried cp, and found that some data wasn't quite right (I forget what it missed, but I suspect it was metadata). This was before I knew about ditto, pax, or cpio.
#!/bin/sh
src=${1}
dst=${2}
if [ -z "${src}" -o -z "${dst}" ]
then
echo "Usage: sudo ${0} SOURCE DEST"
exit 2
fi
s_base=$(basename "${src}")
d_base=$(basename "${dst}")
s_dir=$(dirname "${src}")
d_dir=$(dirname "${dst}")
if [ "$(whoami)" != "root" ]
then
echo "Error: You must be root. Try using sudo."
exit 1
fi
if [ ! -d "${dst}" ]
then
echo "Error: ${d_base} must log in at least once first."
exit 3
fi
/bin/mv -i "${dst}" "${dst}.old"
/bin/mkdir "${dst}"
/usr/bin/tar -C "${s_dir}" -c "${s_base}" |
/usr/bin/tar -C "${dst}" -xpv --strip-components 1
echo "Fixing permissions"
/usr/sbin/chown -R "${d_base}" "${dst}"
/usr/bin/chgrp -R "Domain Users" "${dst}"
Posted on 05-20-2011 12:27 AM
If you look in the Deploy Studio script kit, there are plenty of user data migration scripts. They could easily be migrated to Casper.
Posted on 05-20-2011 12:35 AM
Thanks.
So my methodology wasn't wrong.
I might still try & GUI it with the option to "login" as the user from within the all the select source & dest. Should be pretty easy.
The only problem I've had is reading what users & groups have what permissions. Man page anyone?
Regards,
Ben.
Posted on 05-20-2011 12:54 AM
If the Mac you're running on is bound to AD, chown will be able to set the ownership correctly. I could probably put more logic in to autodetect the right group, but I have insufficient motivation to do so, for now.
I do want to mention that you should never use non-HFS+ filesystems to store any significant Mac data, without archiving it first. Loss of metadata can be extremely frustrating, and can bite you even years later, when the original data is long gone.