LDAP data import export: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
{{ZC}}{{Article Infobox|{{admin}}|{{ZCS 6.0}}||}}=Zimbra OpenLDAP Server= | {{ZC}}{{Article Infobox|{{admin}}|{{ZCS 7.0}}|{{ZCS 6.0}}||}}=Zimbra OpenLDAP Server= | ||
== Data export == | == Data export == | ||
Line 10: | Line 10: | ||
Example of configuration database export: | Example of configuration database export: | ||
/opt/zimbra/libexec/zmslapcat -c /tmp | /opt/zimbra/libexec/zmslapcat -c /tmp | ||
== Data import == | == Data import == | ||
Line 29: | Line 28: | ||
cd hdb/db | cd hdb/db | ||
cp ../../hdb.old/db/DB_CONFIG . | cp ../../hdb.old/db/DB_CONFIG . | ||
=== Importing the LDAP data === | === Importing the LDAP data === | ||
Line 38: | Line 36: | ||
It may be helpful to review [http://wiki.zimbra.com/wiki/OpenLDAP_Performance_Tuning_6.0 OpenLDAP Performance Tuning Wiki] first to see if there are adjustments to the DB_CONFIG file that are desired prior to import. | It may be helpful to review [http://wiki.zimbra.com/wiki/OpenLDAP_Performance_Tuning_6.0 OpenLDAP Performance Tuning Wiki] first to see if there are adjustments to the DB_CONFIG file that are desired prior to import. | ||
{{Article_Footer|ZCS 7.0, ZCS 6.0|10/15/2010}} | |||
[[Category:LDAP]] | [[Category:LDAP]] | ||
[[Category:Performance and Tuning]] | [[Category:Performance and Tuning]] | ||
[[Category:ZCS 7.0]] | |||
[[Category:ZCS 6.0]] | [[Category:ZCS 6.0]] |
Revision as of 19:31, 4 April 2011
Article Information |
---|
This article applies to the following ZCS versions. |
Zimbra OpenLDAP Server
Data export
Zimbra ships with a utility to export the configuration and main databases as /opt/zimbra/libexec/zmslapcat. It takes a destination directory as an argument for where to store the exported data. A timestamped export of the database will be created. It is safe to run zmslapcat while the LDAP server is running.
Example of main database export:
/opt/zimbra/libexec/zmslapcat /tmp
Example of configuration database export:
/opt/zimbra/libexec/zmslapcat -c /tmp
Data import
To import data, the existing database will need to be deleted. You must have a valid LDIF data export to use for import. If you delete the current database off of the disk, there will be no way to recover it from that system.
Preparing for data import
As the Zimbra user:
- Stop slapd: ldap stop
- Clean up the old database and move it to a new location
cd /opt/zimbra/data/ldap/hdb/db /opt/zimbra/bdb/bin/db_recover cd ../.. mv hdb hdb.old
- Create the new directory structure and restore database tuning
mkdir -p hdb/db mkdir -p hdb/logs cd hdb/db cp ../../hdb.old/db/DB_CONFIG .
Importing the LDAP data
As the Zimbra user:
- Import the data via the slapadd command. The last argument is the full path to the data export file:
/opt/zimbra/openldap/sbin/slapadd -q -b "" -F /opt/zimbra/data/ldap/config -l /tmp/ldap.bak
It may be helpful to review OpenLDAP Performance Tuning Wiki first to see if there are adjustments to the DB_CONFIG file that are desired prior to import.