OS X Server Restore Open Directory from Time Machine

 

  1. On the server, go to the Time Machine menu item and select enter Time Machine. This will mount your Time Machine disk image automatically.
  2. On another machine open up an ssh session as an administrator (or you can mount the Time Machine backup image manually and do this locally)
  3. sudo bash to get a root shell (the Open Directory files are not accessible to a regular admin account)
  4. Stop the Open Directory Service with “serveradmin stop dirserv”
  5. cd to /Volumes/Time Machine Backups/Backups.backupdb/servername
  6. Here you will find a list of directories with the Time Machine backup sessions. Find one that is just before OD started going south and cd into it and descend to : /Volumes/Time Machine Backups/Backups.backupdb/servername/date/servername/private/var/db
  7. Then sync the data from the backup onto the source disk with : rsync -av openldap/ /private/var/db/openldap/
  8. Start the Open Directory Service with “serveradmin start dirserv”