Categories
Uncategorized

Moving Users between computers on OSX

So we needed to move a bunch of users from an OSX Leopard Server to a normal OSX machine (as a backup / test bed)

using the normal ‘migration assistant’ didn’t work, so we had to do it manually. Possibly due to moving from a Intel based OSX-Server machine to a PPC based non-Server?

All user details are kept in

/private/var/db/dslocal/nodes/Default/users

in .plist files (XML, human readable).

and all passwords are kept in hash files in

/private/var/db/shadow/hash

The hash files are named after the “generateduid” found inside the users .plist file.

If you’re using home directories on the computer, you’d need to move them across too.

Ditto for user groups.  User groups are kept in

/private/var/db/dslocal/nodes/Default/groups

Move the files across to the new machine, and it all just works.

if you use “cp -n” on the command line, it won’t write over the top of files already there, so shouldn’t muck anything up (hopefully!)

NOTE:  One weird thing was that a bunch of the users didn’t appear in the Accounts Preference Panel.  This seems to be linked whether or not the account .plist file has a default shell set up:

    <key>shell</key>
    <array>
        <string>/bin/bash</string>
    </array>

it goes after the “realname” key/array pair.