King Notes Drop Single Mboxgroup and reimport

   KB 2975        Last updated on 2015-07-12  

(0 votes)

There are times when there is a single mboxgroup DB that is corrupted, and you don't need to dump the DB's for every mboxgroup.

Here's an example of dumping mboxgroup9.

First, you may need to find out which accounts are on mboxgroup9.

mysql -e "select comment, group_id from zimbra.mailbox where group_id='9'"

1) zmcontrol stop

2) Edit the file /opt/zimbra/conf/my.cnf and add a line innodb_force_recovery = 1 under the [mysqld] section
(Note that it may be necessary to increase the recovery level depending on the extent of the database corruption, as shown at the end of the database dump step)

3) mysql.server start

4) source ~/bin/zmshutil

5) zmsetvars

6) mkdir /tmp/mysql.sql

7) ~/mysql/bin/mysqldump mboxgroup9 -S $mysql_socket -u root --password=$mysql_root_password >> /tmp/mysql.sql/mboxgroup9.sql

8) mysql -u root --password=$mysql_root_password -e "drop database mboxgroup9"

9) mysql -e "create database mboxgroup9 character set utf8"

10) mysql.server stop

11) Comment line in my.cnf ( innodb_force_recovery = 1)

12) mysql.server start

13) mysql mboxgroup9 < /tmp/mysql.sql/mboxgroup9.sql

14) mysql.server stop

15) zmcontrol start

See the following article to do a complete mysql export and import for the whole server:

Verified Against: Zimbra Collaboration 7.0, 6.0 Date Created: 04/16/2014
Article ID: Date Modified: 2015-07-12

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search