Mirroring files within Nextcloud

I’m wondering about mirroring files within Nextcloud on various machines. Example: Box A is local hosted only and Box B is publicly addressable. All of the Files (shared over Federation from Box B) are also mirrored so if anything happens to the federated share the files will still be available locally on Box A.

True story: I found that, after losing access to the federated share Box B, I was no longer able to access any of those files from the locally hosted Box A. Whoops.

Or, another scenario.
Two instances of Nextcloud that mirror all files. Any changes made on one are mirrored to the other instance.

What you’re looking at doing is making the services that Nextcloud relies upon highly available, and not Nextcloud itself. That would mean replicating the database and data directory across multiple hosts, some of which wouldn’t be able to have Nextcloud running on them (you couldn’t use master/slave replication on 2 hosts and have Nextcloud pointing to the local instance in both cases). Creating a single, redundant instance of Nextcloud is probably your best bet.

https://docs.nextcloud.com/server/12/admin_manual/installation/deployment_recommendations.html#mid-sized-enterprises

Thanks for your input Terry! Yeah, this sounds like a good option. Could
it split the load across multiple services in order to increase speed and
overall throughput in the singular Nextcloud instance?

I was hoping I could mirror data between multiple hosted instances of
Nextcloud where I have limited user rights.

Pipe drem follows…

I also wish it was possible to combine multiple nextcloud instances to be
treated as though they were all local. It would be awesome to use Box A to
provide full text search to both machines, or view Bookmarks app on Box A
even though it is a running on Box B. This could also avoid federation
(much of which is not yet fully implemented in most apps) and make it easy
to just combine various instances without decommissioning old ones that are
running just fine (avoiding any literal migration of data between
machines). Example: keep the little raspberry pi instance while adding a
much larger local server, with both playing nice together like legos.

I’ve solved this issue of mirroring via rclone, which allows a user to mirror Nextcloud and Owncloud instances via Webdav access. It should work at exactly mirroring data between multiple Nextcloud instances for redundancy.