# Mirroring of two nextcloud server

**URL:** <https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564>\
**Category:** 🏷️ General\
**Tags:** syncthing\
**Created:** [May 3, 2019, 10:13am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564 "2019-05-03T10:13:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![abz](https://help.nextcloud.com/letter_avatar/abz/32/6_449c533f586939b6e5f246632a46421f.png) [@abz](https://help.nextcloud.com/u/abz)\
**Post date:** [May 3, 2019, 10:13am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/1 "2019-05-03T10:13:11Z")

</div>

Hello Community,

this is the first time, that I have a problem with nextcloud, that I can’t address myself.

I want to mirror two instances of nextcloud on two different hardware servers in two different locations. Is this possible and in which way should I do this. Is federated cloud the right way or is there a different approach, that makes this easier to achieve?

Thanking you in anticipation.

---

<div class="post-metadata">

**Author:** ![SmallOne](https://help.nextcloud.com/user_avatar/help.nextcloud.com/smallone/32/5326_2.png) [@SmallOne](https://help.nextcloud.com/u/SmallOne)\
**Post date:** [May 3, 2019, 10:19am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/2 "2019-05-03T10:19:24Z")

</div>

You can solve it by using an sql cluster and some kind of mirrored storage. If you like two identical redundant systems federated is not the way to go.

---

<div class="post-metadata">

**Author:** ![FriendlyGamer](https://help.nextcloud.com/user_avatar/help.nextcloud.com/friendlygamer/32/14989_2.png) [@FriendlyGamer](https://help.nextcloud.com/u/FriendlyGamer)\
**Post date:** [May 3, 2019, 9:11pm UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/3 "2019-05-03T21:11:56Z")

</div>

That will prevent vital failures but your forgetting one thing…

The web server itself which I believe can only be done with a load balancer which doesn’t make sense to me. Since it’s a single point failure once again if the balancer itself goes.

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/6_449c533f586939b6e5f246632a46421f.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [May 3, 2019, 9:55pm UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/4 "2019-05-03T21:55:54Z")

</div>

Pardon the copy pasta, but [since I did just give a very thorough response on mirroring Nextcloud servers last week](https://help.nextcloud.com/t/mirroring-nextcloud/52211/2)…

I agree that this is super important! It does not exist for us basic users at this time. ☹  
Your current best bet is to use [Rclone](https://rclone.org/) to mirror your webdav data directory to another machine via rsync. [Borg Backup](https://www.borgbackup.org/) has been scripted by some to help automate this process.

1. [Request to optionally mirror federated data between instances](https://github.com/nextcloud/server/issues/8459) as a remotely federated share will disappear from your instance if it goes offline. There needs to be an option for these shares to be mirrored in the webui since they already will be downloaded on any clients federating them…

2. [IPFS](https://ipfs.io/), or [InterPlanetaryFileSystem for Javascript](https://js.ipfs.io/), as external storage would allow Nextcloud users to mirror their data across multiple users, similar to seeding torrent files. [See the external storage request here](https://github.com/nextcloud/server/issues/385); there is a [javascript implementation](https://github.com/ipfs/js-ipfs) that could be adapted. It has been mentioned previously on [GSOC 2017](https://help.nextcloud.com/t/google-summer-of-code-2017-we-want-in-and-need-you/7977/10) and [here discussing P2P file systems](https://help.nextcloud.com/t/p2p-seeded-file-sync/277/4).

3. [Request to support the Zot protocol](https://github.com/nextcloud/server/issues/11653), which is developed in PHP for [Hubzilla](https://help.nextcloud.com/t/hubzilla-an-interesting-selfhosted-social-network-companion-to-your-nextcloud/29389) and allows users to literally mirror and migrate their accounts across infinite trusted servers. This process is called Nomadic Identity and would completely reshape our use of Nextcloud in the best way possible! [A dev from that project has even discussed the possibility on this forum before](https://help.nextcloud.com/t/using-hubzilla-to-advance-the-development-of-nextcloud-federation/1321)!  
[HubZilla, an interesting selfhosted social network companion to your Nextcloud](https://help.nextcloud.com/t/hubzilla-an-interesting-selfhosted-social-network-companion-to-your-nextcloud/29389)

> [@Using Hubzilla to advance the development of Nextcloud federation](https://help.nextcloud.com/t/using-hubzilla-to-advance-the-development-of-nextcloud-federation/1321):
>
> For those who have not heard of [Hubzilla](http://hubzilla.org), it is an advanced platform for content publishing and social networking using a decentralized identity and permissions system. Hubzilla and Nextcloud are converging from their initially different starting points, and it would be beneficial for the two projects to begin seeing what they can learn from the other. Specifically, Nextcloud started with a focus on a robust web interface for storing personal data as well as apps to sync this data between devi…

Worth noting also that [OpenCloudMesh (OCM)](https://wiki.geant.org/display/OCM/Open+Cloud+Mesh) was [announced by devs of the Nextcloud project in 2016](https://nextcloud.com/de/blog/nextcloud-joins-open-cloud-mesh/) and [is documented here](https://lukasreschke.github.io/OpenCloudMeshSpecification/#introduction). It does not specifically address mirroring data as discussed in the previous post, but it does relate to finding common federation protocols for all the various, enterprise file sharing projects like Nextcloud, Seafile, Filerun, etc.

[Project github is located here, but has not been updated since mid-2017](https://github.com/GEANT/OCM-API). However, [Major federation improvements were added to the server in late 2018 via this Pull Request](https://github.com/nextcloud/server/pull/9345).

> [@Nextcloud pushes forward Open Cloud Mesh API with proposal for 1.0 release](https://help.nextcloud.com/t/nextcloud-pushes-forward-open-cloud-mesh-api-with-proposal-for-1-0-release/33172):
>
> Originally published at: [https://nextcloud.com/blog/nextcloud-pushes-forward-open-cloud-mesh-api-with-proposal-for-1.0-release/](https://nextcloud.com/blog/nextcloud-pushes-forward-open-cloud-mesh-api-with-proposal-for-1.0-release/) [image] Nextcloud founders Frank Karlitschek and Bjoern Schießle [invented the Federated Cloud Sharing API](https://www.schiessle.org/articles/2016/07/04/history-and-future-of-cloud-federation/) when still at ownCloud, and pushed the solution as a collaboratively developed standard under the Open Cloud Mesh initiative of the GÉANT Association, a European collaboration on e-infrastructure and services for research and education. Nextcloud formally joine…

Back in [Nextcloud 12 it was announced that Global Scale architecture would be deployed](https://help.nextcloud.com/t/nextcloud-joins-open-cloud-mesh-initiative-of-geant-to-continue-driving-federated-cloud-sharing-development/1368) to help scale up for large user case scenarios, but should be deployable on a minimum of two machines. This is designed for enterprise use, but it would address the kinds of questions you have for balancing between multiple servers. Not all of it has been implemented or documented so it is still more of a conceptual white paper.

[The Global Site Selector app](https://github.com/nextcloud/GlobalSiteSelector) is available in the app store for setting a Master/Slave relationship between multiple servers.  
[Lookup Server](https://github.com/nextcloud/lookup-server) is being developed as well, but [I think it needs additional documentation](https://github.com/nextcloud/lookup-server/issues).  
**Balancer** part of Global Scale does not yet exist, or is not yet being developed as part of Nextcloud’s overall Github.

Taken from [this old forum post](https://help.nextcloud.com/t/nextcloud-announces-global-scale-architecture-as-part-of-nextcloud-12/12873), these three things accomplish the following:

> ### Global Site Selector
> 
> The Global Site Selector (GSS) acts as a central instance that is accessed by the user during the first login, accessing it via the Web, WebDAV or REST. The GSS authenticates the user via the central user management like for example LDAP. It then looks up the node where the user is located in the lookup server and redirects the user to the right hostname. The following calls during the same session are done directly from client to the node.
> 
> ### Lookup Server
> 
> The lookup server stores the physical location of a user. It can be queried using a valid user id to fetch the federated sharing id of a user. In some situations, it is important to limit queries to a certain IP space to avoid data leaks. It also keeps track of old federated sharing IDs. The lookup server stores additional data of the users like for example the required QoS metrics like storage/quota settings, speed class, reliability class and so on.
> 
> ### Balancer
> 
> The Balancer runs on a dedicated machine, monitoring the various nodes and their storage, CPU, RAM and network utilization. It can mark nodes as online or offline and initiate the migration of user accounts to different nodes based on data in the Lookup Server like business or legal requirements, QoS settings or user location. If for example, a user would move from the US to Europe, the Balancer would initiate a migration from their data to an EU data center to improve the quality of service.
> 
> You can learn more details on [our webpage about Global Scale.](https://nextcloud.com/globalscale)

---

<div class="post-metadata">

**Author:** ![nephilim](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nephilim/32/2760_2.png) [@nephilim](https://help.nextcloud.com/u/nephilim)\
**Post date:** [May 5, 2019, 5:23am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/5 "2019-05-05T05:23:49Z")

</div>

Hello abz.

May I ask for your primary purpose?

---

<div class="post-metadata">

**Author:** ![putt1ck](https://help.nextcloud.com/letter_avatar/putt1ck/32/6_449c533f586939b6e5f246632a46421f.png) [@putt1ck](https://help.nextcloud.com/u/putt1ck)\
**Post date:** [May 5, 2019, 7:44am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/6 "2019-05-05T07:44:05Z")

</div>

I’m still of the mind that a truly useful mirroring solution for NC will be at an API level, with the mirroring servers understanding the idea of a file being (in process of being uploaded/locked/edited/…) that is not yet available on the local copy of the NC install, or one that has been deleted and therefore should be moved locally to the deleted items folder, etc… There would need to be some checks around space per server etc., but an approach like this allows branch office installs for fastest local performance, as well as hybrid cloud/local hardware solution to keep bandwidth loads separated.  
This approach also provides for an ideal DR/BC solution; an office goes down, the NC resource is still available elsewhere.

---

<div class="post-metadata">

**Author:** ![abz](https://help.nextcloud.com/letter_avatar/abz/32/6_449c533f586939b6e5f246632a46421f.png) [@abz](https://help.nextcloud.com/u/abz)\
**Post date:** [May 5, 2019, 8:36am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/7 "2019-05-05T08:36:51Z")

</div>

Thank you all for the interessing ideas.

I want to mirror my nextcloud in a second location, because of a really small internetconnection there. It has only 2 mib/s, so it is really slow, for normal operation. Therefore the second nextcloud-server should be in the local net just to have all data in faster access. The time for mirroring is not so relevant, because this can happen over night.

A second argument is hardware problems. A second instance helps me, to have access even in case of a hardware outage. I have a backup of all cloud data, but the time to reinstall the cloud is also relevant and this time could be eliminated, when there is a second instance of the cloud, that can be used as fallover server.

---

<div class="post-metadata">

**Author:** ![Krischan](https://help.nextcloud.com/letter_avatar/krischan/32/6_449c533f586939b6e5f246632a46421f.png) [@Krischan](https://help.nextcloud.com/u/Krischan)\
**Post date:** [May 6, 2019, 9:28am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/8 "2019-05-06T09:28:05Z")

</div>

There is a command line Nextcloud client that can be used to have the local server (slow connection) act as a client also. It’s far from ideal of course but I think it could be setup with a script to launch it during night hours only.

But that is just a work around. A more robust way of mirroring files would be good to have for sure.

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/6_449c533f586939b6e5f246632a46421f.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [July 7, 2019, 4:28pm UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/9 "2019-07-07T16:28:26Z")

</div>

A bounty been opened for [mirroring federated data across instances via the webui](https://github.com/nextcloud/server/issues/8459). [Please donate to it](https://www.bountysource.com/issues/55281346-request-allow-federated-storage-to-be-stored-locally-5).

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/6_449c533f586939b6e5f246632a46421f.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [October 15, 2019, 8:14pm UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/10 "2019-10-15T20:14:37Z")

</div>

- There is a [$70 bounty for Zot integration](https://github.com/nextcloud/server/issues/11653)
- [$5 bounty for mirroring federated files between servers](https://github.com/nextcloud/server/issues/8459).

Please consider increasing the bounties if you desire these features!

---

<div class="post-metadata">

**Author:** ![abz](https://help.nextcloud.com/letter_avatar/abz/32/6_449c533f586939b6e5f246632a46421f.png) [@abz](https://help.nextcloud.com/u/abz)\
**Post date:** [April 24, 2020, 3:49pm UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/11 "2020-04-24T15:49:26Z")

</div>

Nearly a year ago, I asked, if there is a possibility for mirroring one nextcloud server in one location to a second one in another location.

I follow this list, but I haven’d seen any news to this question. Is there somebody out there who has the same problem?

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/6_449c533f586939b6e5f246632a46421f.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [April 25, 2020, 3:50am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/12 "2020-04-25T03:50:09Z")

</div>

I do not believe any of the issues we’ve discussed have changed at all in the last year. There are a lot of good suggestions above.

The sacrilege model would be to switch over to [Filestash](https://www.filestash.app/), which does not include built-in syncing on purpose and is super light weight. You would then mirror all of your storage between multiple locations via [Syncthing](https://syncthing.net/).

[Filed a request here](https://github.com/cs3org/OCM-API/issues/43) tp see if the OCM-API has any future plans for development of Nextcloud Federation since it hasn’t been updated since 2017.

---

<div class="post-metadata">

**Author:** ![Krischan](https://help.nextcloud.com/letter_avatar/krischan/32/6_449c533f586939b6e5f246632a46421f.png) [@Krischan](https://help.nextcloud.com/u/Krischan)\
**Post date:** [April 25, 2020, 11:12pm UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/13 "2020-04-25T23:12:28Z")

</div>

hmm maybe the same could be done with Nextcloud if the SQL database was also syncronized? Something like CockroachDB might work for that?

---

<div class="post-metadata">

**Author:** ![KarlF12](https://help.nextcloud.com/user_avatar/help.nextcloud.com/karlf12/32/46873_2.png) [@KarlF12](https://help.nextcloud.com/u/KarlF12)\
**Post date:** [April 26, 2020, 12:15am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/14 "2020-04-26T00:15:59Z")

</div>

I’ve read about people using DRDB for replicating iSCSI targets. Seems to me you could replicate the block device(s) storing the web root and data folders, and cluster the SQL DB on non-replicated storage… Purely theoretical. I have no idea if that would work in practice.

---

<div class="post-metadata">

**Author:** ![zohaib09](https://help.nextcloud.com/letter_avatar/zohaib09/32/6_449c533f586939b6e5f246632a46421f.png) [@zohaib09](https://help.nextcloud.com/u/zohaib09)\
**Post date:** [July 22, 2022, 9:50am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/15 "2022-07-22T09:50:44Z")

</div>

Hi

I have fully functioned Nextcloud Server on VPS, we also makes backup of data and files directories. Now we are looking for such solution that if prodcution nextcloud server fails or currupted, so we up the second nextcloud server (secondary/mirrored).

please propose a solution

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/6_449c533f586939b6e5f246632a46421f.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [July 22, 2022, 3:56pm UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/16 "2022-07-22T15:56:39Z")

</div>

_edit: moving this question back into the main discussion thread so others can share thoughts._

Unfortunately, no. Try [using the forum search](https://help.nextcloud.com/search?q=mirror%20two%20nextcloud%20servers) and github search or internet search for many previous discussions on this. The answer is:  
**No, there is no simple available mirror between two Nextcloud instances.**

> <https://github.com/nextcloud/server/issues/8459#issuecomment-367580214>
>
> \### Steps to reproduce
> 1. Mount remote federated share
> 2.take remote federated… share offline
> 3.attempt to access remote federated share data locally
> 
> \### Expected behaviour
> Federated data from remote host will still be accessible from the web client while the remote host is offline. Federated share owner can allow those with remote access to keep local copies of the shared data.
> 
> \### Actual behaviour
> All access to federated remote shares is lost until host goes back online.
> 
> \### Server
> Nextcloud 13 and Nextcloud 12.0.5
> 
> \----
> There is an open bounty on this issue. Add to the bounty at \[Bountysource\](https://www.bountysource.com/issues/55281346-requesting-delta-sync-in-longterm)
> !\[badge\](https://api.bountysource.com/badge/issue?issue\_id=55281346)

> [@zohaib09](#):
>
> please propose a solution

Use a different service such as Syncthing or rsync to migrate your data directories between two servers.

Anyone else have thoughts or suggestions?

---

<div class="post-metadata">

**Author:** ![Ron\_Nahmany](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ron_nahmany/32/54253_2.png) [@Ron\_Nahmany](https://help.nextcloud.com/u/Ron_Nahmany)\
**Post date:** [September 27, 2023, 8:30am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/17 "2023-09-27T08:30:28Z")

</div>

Hey i have 2 nextcloud servers , I want to external mount files from one server to another , and on the second server , to save the file locally in case the first server goes down.  
is that possible using external storage?

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/6_449c533f586939b6e5f246632a46421f.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [September 27, 2023, 1:34pm UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/18 "2023-09-27T13:34:30Z")

</div>

Split the mirror question back into this discussion thread, to keep that talk here.

Your access question will stay in support. Cheers.

---

<div class="post-metadata">

**Author:** ![Ron\_Nahmany](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ron_nahmany/32/54253_2.png) [@Ron\_Nahmany](https://help.nextcloud.com/u/Ron_Nahmany)\
**Post date:** [October 1, 2023, 12:16am UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/19 "2023-10-01T00:16:38Z")

</div>

Hey , i have 2 linux machines running nextcloud servers.

the first nextcloud url is : [https://nextcloud01.domain/remote.php/dav/uploads/user/](https://nextcloud01.domain/remote.php/dav/uploads/user/)  
the secound nextcloud url is [https://nextcloud02.domain/remote.php/dav/uploads/user/](https://nextcloud02.domain/remote.php/dav/uploads/user/)

currently i am copying (mirroring) the two nextcloud servers using rclone.

one application running script every 10 min with  
rclone copy nextcloud1: nextcloud2:

and the other application running script every 10 min with  
rclone copy nextcloud2: nextcloud1:

in that way, i was able to “sync” the data between the application and save it to DB and data directory.

unfortunately federating the two application does not gives me a valid option in case one of the servers goes down.

only using webdav(rclone) i was able to make it work as expected.

is there is a way in nextcloud to share(copy and paste it in the other application) using the webdav like rclone does ?

---

<div class="post-metadata">

**Author:** ![anon75456558](https://help.nextcloud.com/letter_avatar/anon75456558/32/6_449c533f586939b6e5f246632a46421f.png) [@anon75456558](https://help.nextcloud.com/u/anon75456558)\
**Post date:** [October 1, 2023, 4:20pm UTC](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564/20 "2023-10-01T16:20:21Z")

</div>

No, only as you’ve already found. Connecting two Nextclouds by webdav is also known as federation.

> <https://github.com/nextcloud/server/issues/8459>
>
> \### Steps to reproduce
> 1. Mount remote federated share
> 2.take remote federated… share offline
> 3.attempt to access remote federated share data locally
> 
> \### Expected behaviour
> Federated data from remote host will still be accessible from the web client while the remote host is offline. Federated share owner can allow those with remote access to keep local copies of the shared data.
> 
> \### Actual behaviour
> All access to federated remote shares is lost until host goes back online.
> 
> \### Server
> Nextcloud 13 and Nextcloud 12.0.5
> 
> \----
> There is an open bounty on this issue. Add to the bounty at \[Bountysource\](https://www.bountysource.com/issues/55281346-requesting-delta-sync-in-longterm)
> !\[badge\](https://api.bountysource.com/badge/issue?issue\_id=55281346)

Moving this conversation to one of the existing threads on mirroring two servers. 😄

[Next page](https://help.nextcloud.com/t/mirroring-of-two-nextcloud-server/52564.md?page=2)
