ZCS88-zxbackup-Disaster-Recovery: Difference between revisions

No edit summary
Line 230: Line 230:
<code><pre>
<code><pre>
/opt/zimbra/libexec/zmsetup.pl
/opt/zimbra/libexec/zmsetup.pl
</pre></code>
===Import the data from /opt/zimbraSAVE/backup/===
<code><pre>
zxsuite backup doExternalRestore /opt/zimbraSAVE/backup/
</pre></code>
</pre></code>

Revision as of 20:29, 24 August 2017

ZCS 8.8 Article ZCS 8.8


Scenario I - Single Server

You have been running ZCS-88 using the Next Generation Suite, and you have a dedicated disk for /opt/zimbra/, something like...

/dev/mapper/vg_zcs-lv_root
xxG  xxxG   xxG  xx% /
tmpfs                /dev/shm
/dev/sda1            /boot
/dev/sda2            /opt/zimbra/

But something has happened to the server node, effecting the operating system, which will require a reinstall of the operating system, and ZCS-88.

Reinstall the Operating System

When you reinstall the operating system, make sure the disk containing /opt/zimbra/ is not mounted yet.

Reinstall ZCS-88 with Next Generation Modules

When you are ready to reinstall ZCS-88, make sure the /opt/zimbra/ is now mounted.

If it's possible, rename your production /opt/zimbra/ directory.

mv /opt/zimbra/    mv /opt/zimbraSAVE/


Now, run the installer as the root user using the software option.

./install.sh -s

*OR*

./install.sh --software

During the ZCS-88 Software Reinstall

Observe at the end of the software install, you will see the following

Running Post Installation Configuration:

Software Installation complete!

Operations logged to /tmp/install.log.SviTipi8

Now observe, you have two zimbra directories

drwxr-xr-x  30 root root 4096 Aug 24 14:29 zimbra
drwxr-xr-x  30 root root 4096 Aug 17 13:20 zimbraSAVE

Since the software install had created the /opt/zimbra/ directory, lets move it out of the way

mv /opt/zimbra/   /opt/zimbraSOFTWARE_INSTALL/

Now, lets put our production directory back into place

mv /opt/zimbraSAVE/   /opt/zimbra/

After putting your production /opt/zimbra/ directory back into place, switch to the zimbra account, and start Zimbra

su - zimbra
zmcontrol start
Host test3.zextras.local
	Starting ldap...Done.
	Starting zmconfigd...Done.
	Starting logger...Done.
	Starting convertd...Done.
	Starting mailbox...Done.
	Starting memcached...Done.
	Starting proxy...Done.
	Starting amavis...Done.
	Starting antispam...Done.
	Starting antivirus...Done.
	Starting opendkim...Done.
	Starting snmp...Done.
	Starting spell...Done.
	Starting mta...Done.
	Starting stats...Done.
	Starting service webapp...Done.
	Starting zimbra webapp...Done.
	Starting zimbraAdmin webapp...Done.
	Starting zimlet webapp...Done.
	Starting imapd...Done.

Check the status

zmcontrol status
Host test3.zextras.local
	amavis                  Running
	antispam                Running
	antivirus               Running
	convertd                Running
	imapd                   Running
	ldap                    Running
	logger                  Running
	mailbox                 Running
	memcached               Running
	mta                     Running
	opendkim                Running
	proxy                   Running
	service webapp          Running
	snmp                    Running
	spell                   Running
	stats                   Running
	zimbra webapp           Running
	zimbraAdmin webapp      Running
	zimlet webapp           Running
	zmconfigd               Running

At this point, you should be up and running; however, as an option, you may want to check the user BLOBs, you can refer to this guide.

Scenario II - Single Server with corrupted mysql beyond repair

You have been running ZCS-88 using the Next Generation Suite, and you have just discovered a lot of errors in the /opt/zimbra/mysql_error.log file

You even tried to export and reimport the mysql data to no avail.

You can do the following...

Shutdown Zimbra

zmcontrol stop>

Move aside the production /opt/zimbra/ directory

mv /opt/zimbra/   /opt/zimbraSAVE/

Now, run the installer using the software only option

./install.sh -s

**OR**

./install.sh --software

Now go into the /opt/zimbraSAVE/back/ldap/ directory, and extract the ldap*.tar.gz file

gunzip ldap_23_08_17#04_01_00.tar.gz
tar -xvf ldap_23_08_17#04_01_00.tar

Restore the ldap config and user data

/opt/zimbra/libexec/slapadd -c /opt/zimbraSAVE/backup/ldap/ldap-config.ldif

/opt/zimbra/libexec/slapadd  /opt/zimbraSAVE/backup/ldap/ldap.ldif

Extract localconfig.xml file from NG backups, and place into /opt/zimbra/conf/

cd /opt/zimbraSAVE/backup/server/

tar -zxvf customizations_23_08_17#04_01_00.tar.gz localconfig.xml

mv /opt/zimbra/conf/localconfig.xml /opt/zimbra/conf/VANILLIA_localconfig.xml

mv /opt/zimbraSAVE/backup/server/localconfig.xml   /opt/zimbra/conf/localconfig.xml

Copy /opt/zimbraSAVE/conf/ca/ & /opt/zimbraSAVE/ssl/ to /opt/zimbra/

cd /opt/zimbra/
rsync -av /opt/zimbraSAVE/ssl .

cd /opt/zimbra/conf/

Copy all the *.crt & *.key files from /opt/zimbraSAVE/ to /opt/zimbra/ as well

cd /opt/zimbra/conf/

cp /opt/zimbraSAVE/conf/*.crt .
cp /opt/zimbraSAVE/conf/*.key .

Quick ldap test

Should be able to start ldap, and run a couple of zmprov -l commands without error

ldap start

zmprov -l gas

zmprov -l gad

If needed...
zmlocalconfig -e ssl_allow_untrusted_certs=true

Copy the keystore file from /opt/zimbraSAVE/

cd /opt/zimbraSAVE/jetty-distribution-9.3.5.v20151012/etc

cp keystore /opt/zimbra/mailboxd/etc/

Initialize the mysql service

This will bring up the mysql service in a clean state, but no data yet

/opt/zimbra/libexec/zmmyinit 
* 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

As root copy the install history from /opt/zimbraSAVE/.install_history

rm -rf /opt/zimbra/.install_history

cp /opt/zimbraSAVE/.install_history   /opt/zimbra/.install_history

Now run zmsetup.pl as root

/opt/zimbra/libexec/zmsetup.pl

Import the data from /opt/zimbraSAVE/backup/

zxsuite backup doExternalRestore /opt/zimbraSAVE/backup/
Jump to: navigation, search