Easy Backup Idea for Nextcloud running in TrueNAS Scale


Nextcloud 22.2_1.3.7 (app) Or apps in general as using collabora. So, apps in general.

Both have same pools. Simple mirror.

Let me first say, yes, a novice for both TrueNAS and Nextcloud, but 25 years in IT but from a crap Microsoft base.

What I wanted and thought would be easy, would be a master to master Nextcloud, syncing in real time, the full Nextcloud DB, & data. But as we know nothing is ever easy and straight forward.

After lots and lots of reading, this seems to be doable but kind of complex, unless you understand Klingon!

So, questions I want to ask, to see if I can get some detailed answers. Not just what you used or would use but how you did or would do it.

Options. Nextcloud

As I know I would need to also sync or copy the NC DB and not just the data. Or even the whole docker image of NC (or apps) and data?

Now keep in mind the second NC machine would not need to be live but used as a 1: Backup and 2: as a manual change over failover…

I am anal when it comes to backups and fast recovery times… All my clients have 3 backup config in place. Onsite, and two cloud. One cloud for data and my own cloud backup systems for both data and system image etc.

1: Master - Master but a solution a moron could follow. Would be the best one…

2: Master – Slave. But can the DB of the master be auto backed up in real time on the master and then updated / restored to the slave?? If the master NC went down, HW or a screw up in config etc. Until a master could be re-setup? And then reverse the process back to the new master?

3: A simple replication / resync from the master TN of the full NC to the second TN box and how would, either, be replicated / resynced back to a new master or if need be, restored to the second NC until a master could be re-setup? And then reverse the process back to the new master?

4: Backup options for the NC DB for 2 & 3.

5: Cloud backup of the NC data from the TN box as well. So, I have my 3 backup options and a fast’ish restore back up and running etc.

6: I know a TN config script would be needed to help with that little backup. (Best one would be?)

Once (if ever) I get this working on the LAN the second TN box would be at another location and would need to workout what needs to be changed to then point to it on the WAN.

It sounds you are too deep into the tech stuff. At least I didn’t got why you want to setup such live replication. For me it sounds a little bit like you mix hardware redundancy (HA, high-availability) and backup…

1. Hardware Redundancy
In general the main reason to replicate data in real time from one server to another is achieve super fast recovery from hardware outage (with different root causes, including power loss). But this doesn’t protect you against malware, user error and logical faults…
Depending on how you implement this active/active or active/passive (hot-standby) you may not even have any advantage from additional hardware.

2. Backup
If you are looking for a solution to recover your data after logical every fault like hardware issue, malware, user fault or software bug you need a backup, with lot of versions so you can restore specific point in time (when your data was healthy).

Both methods can/do exist in parallel on majority of installations - e.g. RAID is specific variant of the first method limited to storage redundancy…

In my eyes backup is the only protection everybody must have and must implement - if you have proper backup you can recover from every fault logical and physical. but depending on the problem you hit and amount of data you have to restore it takes time… for specific problems redundancy may prevent downtime or reduce the time to recover - at the cost of additional hardware, higher complexity and additional operational tasks (monitor the replication, test fail-over scenarios etc…)

From your post it looks like you use Docker - such installation is easy and fast to recover (even on private internet line it takes only minutes to download and start fresh NC container). This is why I would not recommend high-level application redundancy like hot-standby/cluster/whatever - run a simple system without huge dependencies - just keep your data safe, run frequent backups including offline and offsite backups and have a good recovery strategy (don’t forget to test recovery from time to time)…

After you setup good backup/recover strategy and still have capacity and budget you can add hardware redundancy to reduce recovery times starting with low-hanging fruits going to more complex/expensive parts…

Thanks for your reply. Much appreciated… Your logic is sound.

OK. All I want to do then to make it easier (for me:))

Just backup NC- (The DB I gather is the main thing or can I replicate the whole Docker NC app?) & Data. Using Replication to another TrueNAS machine.

What I really need is a hand with the steps needed to replicate source and restore steps.
Trust me I have read a fair bit and watched how to use replication etc. But just need to see what the heck I the steps are.

PS: I have setup 3 TrueNAS machines now so I can mess around without screwing the main setup.

maybe the easiest procedure I would imagine is to create local backup (data and DB backup/dump) and replicate you backup directory in second step. I can’t give you any advice for TrueNAS but in general there are lot of methods to replicate data between multiple system.

I would recommend you to configure the destination system to pull the data and original system has no write access on destination (to avoid malware destroys the destination as well)…