Zimbra Next Generation Modules/DR/Disaster Recovery - MariaDB data loss or corruption

Revision as of 15:00, 30 August 2017 by Cine (talk | contribs) (Step 1 completed)

WORK IN PROGRESS

Introduction

This step-by-step guide contains all the information needed to restore lost or corrupted MariaDB data. It applies to both single-server and multi-server infrastructures with only a single MariaDB server.

Step 1: Database re-initialisation

The first step in order to restore the database to a consistent state is to re-initialise the database itself to its initial state.

To do this:

  • Stop all services by running zmcontrol stop as the zimbra user.
  • Rename *or* empty the current Database folder - default /opt/zimbra/db/data/
    • Rename: mv /opt/zimbra/db/data/ /opt/zimbra/db/data_old/
    • Empty: rm -rf /opt/zimbra/db/data/*
  • After cleaning up the database, re-initialise it by running /opt/zimbra/libexec/zmmyinit as the zimbra user:
* Creating required directories
* Generating mysql config /opt/zimbra/conf/my.cnf
* Creating database in /opt/zimbra/db/data
* Starting mysql server
* Loading schema /opt/zimbra/db/db.sql
* Loading version from /opt/zimbra/db/versions-init.sql
* Loading version from /opt/zimbra/db/backup-version-init.sql
* Setting random passwd for mysql root user in zimbra localconfig
* Setting random passwd for mysql zimbra user in zimbra localconfig
* Changing mysql root user password
* Changing mysql zimbra user password
* Changed zimbra mysql user password

Database passwords as well as mailbox IDs will not be changed.

  • After re-initialising the database, start all services by running zmcontrol start as the zimbra user

If everything succeeded, after all services are initialised you should see that mailboxgroups have been created anew:

ls -la /opt/zimbra/db/data/
total 1099868
drwxr-x--- 16 zimbra zimbra      4096 Aug 28 12:09 .
drwxrwxr-x  3 zimbra zimbra      4096 Aug 25 18:03 ..
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 chat
-rw-rw----  1 zimbra zimbra 524288000 Aug 28 12:11 ib_logfile0
-rw-rw----  1 zimbra zimbra 524288000 Aug 28 12:03 ib_logfile1
-rw-rw----  1 zimbra zimbra  77594624 Aug 28 12:11 ibdata1
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 mboxgroup1
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 mboxgroup2
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 mboxgroup3
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 mboxgroup4
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 mboxgroup5
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 mboxgroup6
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 mboxgroup7
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 mboxgroup8
drwx------  2 zimbra zimbra      4096 Aug 28 12:09 mboxgroup9
-rw-rw----  1 zimbra zimbra         0 Aug 28 12:03 multi-master.info
drwx------  2 zimbra zimbra      4096 Aug 28 12:03 mysql
drwx------  2 zimbra zimbra      4096 Aug 28 12:03 performance_schema
-rw-rw----  1 zimbra zimbra     24576 Aug 28 12:03 tc.log
drwx------  2 zimbra zimbra      4096 Aug 28 12:03 test
drwx------  2 zimbra zimbra      4096 Aug 28 12:03 zimbra

Step 2: Data Restore

Step 3: Volume Deduplication

Jump to: navigation, search