How To Export/Import Quota on Zimbra Mail Server

Home » Zimbra » How To Export/Import Quota on Zimbra Mail Server
Zimbra 1 Comment

Quota is one of many attribute that should be migrated while doing migrating from old to the new Zimbra. First, you should export value of quota on the old Zimbra and second, you should import the result of export to the new Zimbra. The following is what i do for export/import quota from old to the new Zimbra.

On the old Zimbra Mail Server

# Create simple script for retrieve information of quota

chmod 775 /srv/
chgrp zimbra /srv/
vi /srv/getquota.sh

Fill with the following line

#!/bin/bash
rm /srv/modify-quota.zmp
touch /srv/modify-quota.zmp

echo "Process Export Quota"
zmprov -l gaa | while read ACCOUNT
do
QUOTA_TOTAL=`zmprov ga ${ACCOUNT} | grep "zimbraMailQuota" | cut -d ":" -f2`
echo "ma ${ACCOUNT} zimbraMailQuota${QUOTA_TOTAL}"
done >> /srv/modify-quota.zmp

# Save and execute the script

chmod +x /srv/getquota.sh
su - zimbra
sh /srv/getquota.sh

The results of above script is file with name modify-quota.zmp that saved in folder /srv/. Copy the file to the new Zimbra mail server

On the new Zimbra Mail Server

Assuming the file modify-quota.zmp is placed in /srv/ folder. Run the following command as Zimbra user

su - zimbra
zmprov < /srv/modify-quota.zmp

Please check one of accounts whether value of quota has been changed or not. If you having trouble, please feel free to contact me on the comment form 😀

Good luck and hopefully useful 😀

One thought on - How To Export/Import Quota on Zimbra Mail Server

LEAVE A COMMENT