Datacenter: Recover Owncloud and WordPress from a Cold Backup

By | December 1, 2016

Sometimes you test your best practice procedures the hard way. A failure that messed up with my grub (yes you can manage to break grub even in a RAID1 setup) followed by a failed Fedora update forced me to do a clean Fedora 25 installation.

STEP 1: Cold Backup of all partitions of interest
Because I have a lot of stuff installed on this main server everything which is not on the main data storage (RAID10 10TB) mounted under /media/storage must be saved.

The easy way to do it is to start from a Fedora rescue system (I always have one on a MicroSD on the server) and use gnome-disks to make a raw image of every partition of interest.
I made a raw image of:
– boot partition
– root partition
– home partition
directly on /media/storage/temp/ a directory on the main storage raid that is not touched by the fresh installation.

STEP 2: Install a fresh Fedora 25

The Fedora 25 installer is nice enough to detect my RAID1 boot partition and my LVs over RAID1 root and home partitions. To make it a clean install I formated boot and root.

STEP 3: MySql recovery

My MYSQL data directory is already on the main storage under /media/storage/www/mysql. I just have to create a symbolic link to it under /var/lib/mysql.
A simple restart of mariadb service is enough to migrate all the databases. MySql is really easy to use with cold backups.

Check the logs to see that all is good.

Note: Upgrade if is the case. In my situation on the old failed system (FC23 originaly) MySql version was 10.0. The version from FC 25 is 10.1 so an upgrade is needed.

STEP 4: PHP Dependencie
There are several PHP modules required by Owncloud and WordPress

First list existing php modules:

Install missing php modules

STEP 5: Disable selinux

I really hate how you get random strange errors due to this selinux. I always disable it in /etc/selinux/config by setting selinux=disabled.
Before I turned it off httpd was compaining that my certificates from the cert files are not good or missing ?!?

STEP 6: HTTPD recovery
Copy /etc/httpd.conf files from the old root image to /etc/httpd.conf in the new installation.
Make sure all the permisions are right and all the other dependencies from .conf files are also copied. In my case I had to copy also the https certificates from the old image.

Restart the httpd service:

STEP 6: Check that WordPress and Owncloud are available
Just simply try to access the resources from a web browser.