Migrating Mobile Accounts between Open Directories


Hello, We are about to begin taking down an OD server at one of our School Clients and replacing it with a freshly built OD with the same DNS name. We created new bindings and are now running into issues with computer that had previous mobile accounts created by the original OD. We need to be able to retain the data in those accounts, while still allowing students with the same short name to create a mobile account at their next login. We were able to manually resolve the problem by following these steps -

  1. Remove the old user, preserving their home folder (either in Terminal or System Preferences). a. If removing user via dscl command in Terminal, rename home folder to anything but its current name.
  2. Log in to user's account via Open Directory username / password.
  3. Log out of newly created user.
  4. Remove newly created user's home folder.
  5. Rename old home folder back to the username.
  6. Change ownership of the home folder to match the user ID of the newly created user.

The only problem now is this is a large environment across multiple locations, so we would ideally need to script this process. Has anyone been in this situation in the past?


Honored Contributor II
Honored Contributor II

I've done similar things in the past. If you've preserved the same user accounts in OD (with the same UIDs and UUIDs) you shouldn't need to change anything on the clients.

If there is something off with the cached accounts on the clients I would run a script that loops through the folders in /Users with:

  • delete existing account with dscl
  • Reset ownership on home folder to new OD account