Home › Forums › OS X Server and Client Discussion › Questions and Answers › Backup, restore Open Directory?
- This topic has 4 replies, 5 voices, and was last updated 20 years, 6 months ago by
afp548contributor.
-
AuthorPosts
-
July 27, 2004 at 3:56 pm #358578
everichon
ParticipantHi,
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
August 3, 2004 at 9:53 pm #358668arekdreyer
MemberIt 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 stuffWorkgroup 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.LDIFBring 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.LDIFUse Workgroup Manager
Import the Users
Import the GroupsThe 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.
October 6, 2004 at 9:51 am #359431jkp
Participantarekdreyer: 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?
October 6, 2004 at 2:08 pm #359434gilm0079
ParticipantHow do we backup users WITH there passwords intact? Is the creation of an OD replica a sufficient backup method?
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed