How To Export/Import Quota on Zimbra Mail Server

Posted by

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
[code lang=’bash’]
chmod 775 /srv/
chgrp zimbra /srv/
vi /srv/getquota.sh
[/code]
Fill with the following line
[code lang=’bash’]
#!/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
[/code]
# Save and execute the script
[code lang=’bash’]
chmod +x /srv/getquota.sh
su – zimbra
sh /srv/getquota.sh
[/code]
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
[code lang=’bash’]
su – zimbra
zmprov < /srv/modify-quota.zmp [/code] 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 :D Good luck and hopefully useful :D

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.