This will be a bit of a long question/post, so I’ll do this first,
TL/DR;
I want to backup a live NS constantly throughout the day, using LVM snapshots on running system, and then rsync to a running backup NS. I will also need to do all relevant database dumps from live, and then import into backup NS.
What I am hoping to accomplish, is if my Live-NS goes down at any point during the business day, I am backup up and running on backup machine within minutes with minimal data loss. This is not my only backup protection, I run in a VM, which is backed up each evening. The backed up VM is the disaster recovery.
My System
Zentyal is running in a VM on a debian host, and is the DC for my network.
Live-NS is running in a VM, and is connected to Zentyal AD for users/groups.
I have all relevant mount points on NS as their own LVM, but the main one I think I need to backup is /var/lib, or maybe just /var/lib/nethserver.
NS is running WebTop 4 and NextCloud.
Backup-NS is running bare metal, and is also connected to Zentyal AD for users/groups.
It has the same LVM setup as the Live-NS, and is updated and installed with all the same modules and setup the same as the live machine.
I am just in development right now, and hope to go live within a couple of weeks if not sooner.
The Backup Plan
I want to have all email, files shares, nextcloud, and webtop data backed up at different intervals during the day.
For data, besides the main /var/lib LVM, I also have /var/lib/nethserver/ibay and /var/lib/nethserver/ibay/accessdb, so my file server data, and my accessdb can be snapshotted at different intervals, but at the same time as the other LVM snapshots, so say the access db can be backed up, and doesn’t have to wait for the email backup to finish and be unmounted to do so. I hope that makes sense.
Not losing any, or very little of the accessdb data, and our email, is very important to my company during the business day, so I am hoping this plan can work.
The plan was as follows;
-on startup, do an LVM snapshot of /var/lib/ and use rsync to backup all email, and nextcloud data (I may need to split these 2 and create another LVM just for the email) to the backup machine. When done, unmount the snapshot, and immediately repeat.
-at a set interval, probably every 5 minutes, do an LVM snapshot of /var/lib/nethserver/ibay/accessdb, rsync to backup, unmount, repeat in 5 minutes.
-at a set interval, probably every 15 minutes, as file share data is not as critical (so maybe 30 minutes) do an LVM snapshot of /var/lib/nethserver/ibay/, rsync to backup, unmount, repeat.
-at a set interval, probably just a couple times and day, do an LVM snapshot of /var/lib/, and backup anything else relevant, rsync to backup, unmount, repeat.
-at similar intervals as relevant data, do a database dump for the needed db’s (nethserver/webtop/nextcloud), rsync to Backup-NS, and either detect new db dump and import there, or import daily or at time of backup-NS going live.
My questions are as follows;
- Will this work in theory? Are there any potential issues?
- Is there anything else I can backup that will help the process (config files etc.), and can I safely just do the complete /var/lib
- What services need to be shutdown on the backup-NS during the rsync of any of the data
- What are the databases I need to backup for NethServer/WebTop/NextCloud, and is there a NS module that can automate this?
Sorry for the long post, and I realize I can find most of this information out by searching, but I have been digging for a couple weeks now, and am no expert in any of this. I just thought, if I could maybe explain my complete plan, and see if anyone here has done something similar, and might be able to provide some insight, or just thinks it’s interesting. The help in this community has been very, very good, and invaluable so far in me getting my system setup.