Importing LDAP data from provider to replica: Difference between revisions
(Created page with "{{Article Infobox|{{admin}}|{{ZCS 8.0}}||}} = Copying a Provider database to the Replica = If an ldap replica is not in sync with the provider, it is possible to manually loa...") |
No edit summary |
||
Line 4: | Line 4: | ||
If an ldap replica is not in sync with the provider, it is possible to manually load all of the data from the provider into the replica. There are two methods of doing this. Either using slapcat/slapadd, or using mdb_copy. | If an ldap replica is not in sync with the provider, it is possible to manually load all of the data from the provider into the replica. There are two methods of doing this. Either using slapcat/slapadd, or using mdb_copy. | ||
== Using slapcat/slapadd to reload the replica == | == Using mdb_copy to reset the replica db== | ||
===On the ZCS | == Using slapcat/slapadd to reload the replica db== | ||
===On the ZCS LDAP Master=== | |||
Export an ldif of the master ldap database. | Export an ldif of the master ldap database. | ||
# su - zimbra | # su - zimbra | ||
$ ~/libexec/zmslapcat /tmp | $ ~/libexec/zmslapcat /tmp | ||
===On the ZCS | ===On the ZCS LDAP replica=== | ||
Copy the file ldap.bak from the master to the replica (this example assumes that the hostname of the master is ''master.domain.com''). | Copy the file ldap.bak from the master to the replica (this example assumes that the hostname of the master is ''master.domain.com''). | ||
# su - zimbra | # su - zimbra | ||
Line 18: | Line 19: | ||
$ ldap stop | $ ldap stop | ||
As | As zimbra, move aside the existing ldap data (for this example, the data directory is renamed with the current date (2007-12-07) and state (out-of-sync) of the data), and create a new empty data directory. | ||
$ | $ cd /opt/zimbra/data/ldap | ||
$ mv mdb mdb.2007-12-07-out-of-sync | |||
$ mkdir -p /opt/zimbra/data/ldap/mdb/db | |||
$ cd | |||
$ ./libexec/zmslapadd /tmp/ldap-master.ldif | |||
Then start the ldap service and run a test query. | Then start the ldap service and run a test query. |
Revision as of 19:12, 7 March 2013
Article Information |
---|
This article applies to the following ZCS versions. |
Copying a Provider database to the Replica
If an ldap replica is not in sync with the provider, it is possible to manually load all of the data from the provider into the replica. There are two methods of doing this. Either using slapcat/slapadd, or using mdb_copy.
Using mdb_copy to reset the replica db
Using slapcat/slapadd to reload the replica db
On the ZCS LDAP Master
Export an ldif of the master ldap database.
# su - zimbra $ ~/libexec/zmslapcat /tmp
On the ZCS LDAP replica
Copy the file ldap.bak from the master to the replica (this example assumes that the hostname of the master is master.domain.com).
# su - zimbra $ scp zimbra@master.domain.com:/tmp/ldap.bak /tmp/ldap-master.ldif
Stop the ldap service.
$ ldap stop
As zimbra, move aside the existing ldap data (for this example, the data directory is renamed with the current date (2007-12-07) and state (out-of-sync) of the data), and create a new empty data directory.
$ cd /opt/zimbra/data/ldap $ mv mdb mdb.2007-12-07-out-of-sync $ mkdir -p /opt/zimbra/data/ldap/mdb/db $ cd $ ./libexec/zmslapadd /tmp/ldap-master.ldif
Then start the ldap service and run a test query.
$ ldap start $ zmprov -l getAllServers
Related Articles
- slapcat manual page at openldap.org
- slapadd manual page at openldap.org