Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Command line equivalent of Work Group Manager's export feature

Hello everyone,


I am have a hard time upgrading from Lion Server to Mountain Lion Server, especially with Open Directory. What I wish to do, is to import the existing users and groups of an existing server running Lion Server into a new (fresh) Open Directory master created on another server that is running Mountain Lion Server.


I have tried several options. Those that did *not* work for me include:

  • Trying to make create a replica of the Lion Open Directory on the Mountain Lion Server
  • Trying to backup the OD of the Lion Server using slapconfig


What seems to work (for the moment), is to use the export feature of Work Group manager on Lion and to import the users/groups using the import feature of Mountain Lion Server app.


My question is: is there a command line way to do the export ? Since Work Group manager seems to be kind of deprecated in ML, I assume there must be some other way (i.e., from the command line) to do the user/group import and export.


Thanks for your help !

OS X Server, Mountain Lion Server

Posted on Sep 5, 2012 5:01 AM

Reply
7 replies

Nov 9, 2012 2:32 PM in response to elgringito

There is an opendirectorybackup script at:


/Applications/Server.app/Contents/ServerRoot/usr/libexec/server_backup/opendirec torybackup.


It will save an OD archive using slapconfig in /var/backups. I am not sure if this is supposed to run automatically with Time Machine, but if you manually load this launchd job, it will run daily:


/Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.ap ple.opendirectorybackup.plist.


The OD archive in /var/backups is only accessible by root, but it will not require a password.

Nov 9, 2012 2:37 PM in response to elgringito


Notice that the old Archive and Restore options are gone. To run a backup, run the slapconfig command along with the -backupdb option followed by a path to a folder to back the data up to:


sudo slapconfig -backupdb /odbackups


To restore a database (such as from a previous version of the operating system where such an important option was actually present) use the following command (which just swaps backupdb with -restoredb)


sudo slapconfig -restoredb /odbackups

/usr/sbin/ServerBackup -cmd backup -source /

Command line equivalent of Work Group Manager's export feature

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.