How to backup and restore zimbra's users
The Zimbra mail server user backup and restore procedure in this article works with both the open source edition and network edition, but cannot be used for version upgrades.
Zimbra uses LDAP to store user information as well as global configuration, Server, Domain, and Class of Service information.
Backing up data
[zimbra@mail ~]$ su - zimbra
[zimbra@mail ~]$ openldap/sbin/slapcat -f /opt/zimbra/conf/slapd.conf -l /tmp/ldap.ldif
Restoring data Stop ldap first by running the command. Then back up the old data by renaming the directories, following these steps:
[zimbra@mail ~]$ cd /opt/zimbra/data/ldap/hdb/db
[zimbra@mail ~]$ /opt/zimbra/bdb/bin/db_recover
[zimbra@mail ~]$ cd /opt/zimbra/data/ldap/
[zimbra@mail ~]$ mv mdb mdb.backup
[zimbra@mail ~]$ mkdir -p mdb/db
[zimbra@mail ~]$ cp mdb.backup/db/DB_CONFIG mdb/db
Run the command below to import the data:
[zimbra@mail ~]$ slapadd -f /opt/zimbra/conf/slapd.conf -l /backup/ldap.bak
Verification Verify the result by running:
[zimbra@mail ~]$ openldap/slapcat -f /opt/zimbra/conf/slapd.conf