HOT Backup and HOT Restore

Revision as of 20:29, 15 December 2009 by Rubão (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

zmbkpose

by Rubens Alonso Filho <rubens@4linux.com.br>

The zmbkpose tool is a shell script that does hot backup and hot restore of ZCS Opensource accounts

This tool DOES NOT DO disaster recovery.

It can run from any host in the net, which means that it can be set on a backup server already existent.

It was concepted after Zimbra released ZCS 5.0.12, where a new import/export feature was exposed to user can be able to do his archiving.

From that point it was clear for me that I just need to write a code to automatically get all user data from server, remotely via HTTP SOAP. Plus LDAP data.

So, it is possible to run full backups and restore even deleted accounts.

In the version 1.0.0 of zmbkpose, the tool provides:

  • Full backup of all accounts.
  • Full backup of any account.
  • Incremental backup of all accounts.
  • Incremental backup of any account.
  • Lists all backup sessions done.
  • Restore all contents (mail, contacts, appointments...) to any account.
  • Restore deleted accounts back to directory and all of its contents.
  • Restore only account attributes, like password, class of service, etc

To run zmbkpose it is necessary

  1. Install ldap-utils e curl utils
  2. Create /etc/zmbkpose
  3. Config /etc/zmbkpose/zmbkpose.conf file (bellow)
  4. Create the script from code bellow, giving execute permissions
  5. To see zmbkpose syntax, type just zmbkpose

You can find more informations and instructions (in portuguese) at http://www.kyapanel.com/wiki/doku.php?id=zimbra:zmbkpose

Config and Scripts files from zmbkpose

/etc/zmbkpose/zmbkpose.conf

# This file is part of zmbkpose.

#    zmbkopse is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.

  1. zmbkopse is distributed in the hope that it will be useful,
  2. but WITHOUT ANY WARRANTY; without even the implied warranty of
  3. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  4. GNU General Public License for more details.
  1. You should have received a copy of the GNU General Public License
  2. along with Foobar. If not, see <http://www.gnu.org/licenses/>
  1. Configuration file for ZCS Opensource Edition Backup Tool
  2. Lines begining with "#" will not be used
  3. Values must have to be filled without spaces, quotes, or any kind of special characters
  1. Privileged user that will run zmbkpose and write in the work directory

BACKUPUSER=

  1. Work directory where will be the backup sessions (all user data)
  2. # Keep the directory access strict to the backup user as long as it contains all user data.

WORKDIR=

  1. Must have be filled with an administrator account
  2. Hint: If you have deleted admin, or missed its password, you can create a new admin directly from command line:
  3. # zmprov ca newadmin@exemplo.com password
  4. # zmprov ma newadmin@exemplo.com zimbraIsAdminAccount TRUE

ADMINUSER=

  1. Must be filled with ADMINUSER password

ADMINPASS=

  1. Must be filled with ldap url from Zimbra-LDAP master host
  2. Example: ldap://hostname:389

LDAPMASTERSERVER=

  1. Must be filled with zimbra_ldap_userdn key's value
  2. Hint: To get this value, at Zimbra's server, run:
  3. # zmlocalconfig zimbra_ldap_userdn

LDAPZIMBRADN=

  1. Must be filled with zimbra_ldap_password key's value
  2. Hint: To get this value, at Zimbra's server, run:
  3. # zmlocalconfig -s zimbra_ldap_password

LDAPZIMBRAPASS=

  1. Log file location. It must to have write permission to BACKUPUSER

LOGFILE=

Jump to: navigation, search