LDAP data import export
|This article applies to the following ZCS versions.|
Zimbra OpenLDAP Server
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:
Example of configuration database export:
/opt/zimbra/libexec/zmslapcat -c /tmp
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/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_CONFIG .