Home Forums OS X Server and Client Discussion Questions and Answers Backup, restore Open Directory?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #358578
    everichon
    Participant

    Hi,

    Our LDAP service is being buggy, and I want to reset it. If I want to backup the user and groups databases, set the server to ‘standalone’ to blank it, and then revive it as an LDAP server (restoring the backed-up DBs), how do I go about doing this?

    Thanks,

    Tom

    #358668
    arekdreyer
    Member

    It sounds like you may have other issues, but this is what I’ve used to backup LDAP stuff:

    1: Use Workgroup Manager to export and import users and groups
    2: Use scripts to back up some stuff

    Workgroup Manager:
    Select all your users (except your admin user), and export these.
    Note that no passwords will be preserved.

    Select all your groups, and export.

    Use this script for the other stuff stored in LDAP:
    LDAP-backup
    #!/bin/sh
    /usr/bin/ldapsearch -LLL -x -h your.server.name.here -b “dc=your,dc=search,dc=base” “(objectClass=apple-computer-list)” > computer-list.LDIF
    /usr/bin/ldapsearch -LLL -x -h your.server.name.here -b “dc=your,dc=search,dc=base””(objectClass=apple-computer)” > computer.LDIF
    /usr/bin/ldapsearch -LLL -x -h your.server.name.here -b “dc=your,dc=search,dc=base” “(objectClass=mount)” > mount.LDIF

    Bring the server to standalone, then make it OD Master again.

    Run the script
    LDAP-restore
    #!/bin/sh
    /usr/bin/ldapadd -D “uid=root,cn=users,dc=your,dc=search,dc=base” -W -f computer.LDIF
    /usr/bin/ldapadd -D “uid=root,cn=users,dc=your,dc=search,dc=base” -W -fcomputer-list.LDIF
    /usr/bin/ldapadd -D “uid=root,cn=users,dc=your,dc=search,dc=base” -W -f mount.LDIF

    Use Workgroup Manager
    Import the Users
    Import the Groups

    The users will NOT be Open Directory password server users until you change them.

    I’ve run into problems selecting more than 150 or so users and changing them all at once, but you may not.

    Select 100 Users at a time, click the Advanced tab, and select “Open Directory” for User Password Type. You will be prompted to give them a password. You can force them to change their password on their next authentication, whether this is at the login screen or just connecting via AFP.

    #359431
    jkp
    Participant

    arekdreyer: I’m interested to know why you offered this solution rather than just creating a script to automate the process outlined in the Open Directory admin guide from Apple?

    #359434
    gilm0079
    Participant

    How do we backup users WITH there passwords intact? Is the creation of an OD replica a sufficient backup method?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Comments are closed