ZeXtras/Zimbra: Recovery of accounts/archives by migration.

Leave a comment

July 4, 2017 by aubreykloppers

When you use ZeXtras Backup to do a restore on a blank system, migrating from an old to a new server, you will run into Licensing problems in Zimbra.  Let me explain:

In Zimbra I have 150 user license with about 142 user accounts and about 180 archive accounts.  The reason for this is that as users leave my company, I need to keep a record of mails for a time without running out of licenses.  To do this, I delete the actual account, but leave the archive in place.

Using ZeXtra’s Incremental Backup/Restore solution to migrate from one server to another, I ran into problems on a blank system, due to the way ZeXtra recover archive accounts making Zimbra think they are normal accounts.  The result is, your restore aborts as you run out of licenses.

To fix this, you have a couple of options, but the one I like best is to, prior to restoring any data, create all the user accounts from the backup using:

zxsuite backup doExternalRestore /path/for/the/data/ provisioning_only TRUE

This will create all your accounts, with the archive account details embedded into every account.  All you then need to do is get the archive details for every account and then create the archive accounts from the details.

The following script will do everything for you (Run as Zimbra User):

accounts=`zmprov -l gaa domain.com`
echo $accounts
for ac in $accounts; do

zmprov ga $ac | grep ArchiveAccount: | awk ‘{print “zmarchiveconfig enable ” “‘$ac'” ” archive-address ” $2}’ | bash;
done

Make sure you get the:
DOUBLE QUOTE/SINGLE QUOTE $ac SINGLE QUOTE/DOUBLE QUOTE
right.

If you get things wrong:
To add archiving use:

zmarchiveconfig enable user@domain.com archive-address user-nnn@domain.com.archive

To delete archiving use:

zmprov ma user@domain.com -zimbraArchiveAccount <user-nnn@domain.com.archive

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: