Nextcloud + Syncthing

I am perhaps Continuing the discussion from Sync files nextcloud with a pool on truenas?:

Which was from 2020. However the thread came to a dead stop. I may have a similar question?

Let me thank you all, and particularly Tom for all the help. I watch the videos often and have an entire home lab based on many of the suggestions in the videos.

Query:

I have SyncThing on all my devices. I Sync to my TrueNAS as my main system file storage. However. I decided to install a nextcloud instance and virtual disk on my XCP-NG server. It runs VM of Ubuntu 22.04 with nextcloud. I used Jay’s (Learn linux TV) guide recently released to set it up. So far everything is running very well. I have automatic backups from XCP-NG NC VM > TrueNAS dataset for redundancy. Syncthing is not yet installed on this server. Before I do attempt??

Dear Forum users, I would like to sync data from SyncThing to NC data folders on internal storage of my dell server running XCP-NG. Most of my files are created on my devices and automatically synced to TrueNAS. I would like them also in folders on NC so I can share data via links and manage permissions to links, teams, etc. I would also like those with accounts on my NC to be able to UL their own data and have it sync to my devices. Is Syncthing (the tool I already have used for many years) a possible way?

Now I recall that I tried to do something like this back on NC 14, which was the last time I used NC with any regularity. I was not as skilled as a linux sys admin back then and probably didn’t understand a permissions issue or some other thing metadata issue. Perhaps I still do not grasp those things well. lol

I wonder if anyone has attempted this with success? What are the things to watch out for?
If I remember correctly I had issues with permissions, NC and SyncThing getting confused about versioning and the NC marinadb getting very confused how to make sense of the syncthing metadata as well as vice versa. Syncthing perhaps not sure how to handle files in NC? It was a while ago and try as I might I could not find my notes on this. All I do remember is that I had to give up on the idea above. My pictures and documents from my phone would not be synced to NC. To run both NC app and Syncthing app on my phone caused so much loss of battery life as to be impractical. Etc. I need the function of NC to interact with the data and the function of syncthing to get the data once manipulated to all of its destinations, including for backup and redundancy.

I am about to give it another go. I think we are on NC 24 now? It has clearly been a while. I am more skilled. Yet, it seems like a use case that someone may have attempted before? Would anyone care to steer me in the right direction? At least They are both FOSS, where there is a will there is a way? Hopefully?

Thanks to everyone

Hi @omcn

I’m using Nextcloud for about five years now and I strongly advice against pursuing your plan any further…

With Nextcloud you should generally avoid writing files to the Nextcloud data folder directly, because Nextcloud references all files in the database. So if you write files via Syncthing to the Nextcloud data folder, Nextcloud is not aware that new files are there. It is possible to make Nextcloud aware of the new files via occ:scan command, but this would be a manual process and is therefore not really a viable way to use it together with a real time synchronization tool like Syncthing. Also all files must have the ownership of the webserver user e.g. www-data to be recognized by Nextcloud.

One way that might work would be to add the folder you are using with Syncthing to Nextcloud via the External Storage App. But even this brings additional hoops, which i would rather avoid and at best consider as a stopgap solution for very specific use cases.

So in practice it is an either or question. Either use Nextcloud or Syncthing. If you intend to use Nextcloud, I recommend you to either use the WebUI to work with your files or you can use the official mobile apps and the desktop client. Nextcloud also has full support for the WebDAV protocol, so basically you can use any software that supports WebDAV as a synchronization target or storage backend.

1 Like

Hey thank you @bb77 you found my notebook from years ago I was looking for! You saved me at least a day or two (perhaps a week) of trying all this again! I did try EXACTLY what you have suggested.

Setting permissions on an external storage solution, messing about with shares and their permissions, setting occ:scan as a chron job, dealing with syncthing saying everything was out of sync and has no write permissions. Nextcloud missing all or some of the data. The resource usage of the server going into power consumption I was not wanting cause databases were filled with dupes and the err logs were filling up too. It was … no fun. I did try “might work” and no… it was a terrible idea! It seems like a good idea. Oh no, it isn’t. Now I remember. Run away! … Keep running!

Thank you so much for your suggestion Re: WebDAV and NC Native Apps. I think for some of my homelab stuff syncthing is the way to go. For my work stuff? Migrate to NC entirely. It is far more professional client facing. Fancy UI… make folks go OOOOoooo and all that plus all the features with FOSS noooooo Microsoft or Google whom take so much and give so little. I will now use Brave search to research WebDAV and learn all about that protocol instead of banging my head against the same wall I did with NC 14. Once again thank you for finding my notebook… I seriously looked everywhere! :upside_down_face:

1 Like