Unchecking synchronized subfolder without local delete

Expected behaviour

If I select a folder (“A”) to synchronize with server and later decide not to synchronize one of its subfolders (“A.B”), I might not want local files to be deleted. Just because I don’t want something to be synchronized anymore doesn’t necessarily mean I want it to be removed from my local machine.

Actual behaviour

Currently there seems to be no option to do that (apart from removing folder A completely and setting it up again while unselecting subfolder A.B) so it would be great if the user could somehow choose whether local files are to be deleted.

Steps to reproduce

  1. Set up a folder to be synchronized with the server.
  2. Later click on “Choose What to Sync” for that folder.
  3. Uncheck subfolders that you don’t want to synchronize anymore.

From: Unchecking synchronized subfolder without local delete · Issue #2502 · owncloud/client · GitHub


I have found some posts from an interesting discussion from the help forums: Unchecked folders will be REMOVED from your file system

Again I want to stress, this CANNOT be the way this works, or users will be losing files constantly and won’t know why. NO WAY any solution should remove local files. The LOCAL files should ALWAYS be the master.

NO SOLUTION should delete local files simply because a checkbox is unchecked

I am never going to convince developers there why this is such a bad idea, so I simply will not use this product.

I have reviewed several cloud systems. Absolutely none work the way NextCloud works. They can’t. No one would use them. No one would take the risk. There is a scenario where someone could uncheck a folder, delete the local files, not know what to do, and so delete the account on the nextcloud server, thereby permanently losing their files.

This user from 2017 is absolutely right.


New post from user hcoin:

"If the original source of every file was the server (think ‘netflix movie downloads’) the idea files ‘go away when the connection goes away’ feels normal. When answering this question above we see the nextcloud devs narrow the timeframe they allow in their thinking, they begin with the assumption that the ‘server was the source’ so ‘naturally’ clients disconnecting wouldn’t want the files from there anymore either. This is of course a logical impossibility, the server is never the source, phones are the source of nearly all photos and video clips, desktops are the source of nearly all documents.

Also, we read ‘nextcloud isn’t a backup solution’ proposed as the reason why deleting files from the clients when the server connection is broken ‘makes sense’. This has the same feeling of being told since cars are not trains you shouldn’t travel. You’d think if nextcloud authors didn’t want the nextcloud server to be relied upon for backup they would be more likely to provide a way for disconnections to retain local files, not less.

I think the ‘real reason’ for deleting files on the clients upon disconnection is having to face the daunting logic puzzle of nextcloud being presented with ‘a new directory to sync’ already populated with a great may files that already exist on the server. Is a file with the same name and with different content and an older date than one on the server – but in ‘a newly presented directory’-- ‘what the user really wants’ or would they like that file on the local system replaced with the ‘newer one with the same name’ on the server, or renamed then uploaded to the server as the older file? Or uploaded to the server as ‘an older version’ then ‘the new one’ replace it
 or
 maybe require all newly connected directories that already exist on the server only if they contain older content to be renamed on the client, then the new ‘empty’ directory on the client populated with what’s on the server?

Coming up with an answer to that one that ‘isn’t confusing to most people’ – that’s I think the real issue preventing the right thing from happening here: Certainly at least on desktop systems DO NOT DELETE CLIENT FILES upon disconnection by default, ever. If I was coding this: Upon connection of a new directory to the server, any file on the client that’s older than on the server, for which a prior version doesn’t already exist on the server, should be uploaded as an older version then replaced with the latest on the server. If ‘versioning’ isn’t enabled on the server, then if a non-empty directory is presented for connection to the server that already exists on the server – rename the client directory and create an empty one with the name on the server and populate it from the server, let the client figure out what to do with the files in the ‘old’ directory."

Also reported at Owncloud (same issue) - but they do not fix it. See Unchecking synchronized subfolder without local delete · Issue #2502 · owncloud/client · GitHub

1 Like

If you want to keep a local copy of certain things on your device but don’t want it to be synchronized anymore, I suggest you simply copy it to a location outside of the local Nextcloud folder. Problem solved.

Probably because they think it makes sense the way it works now and therefore they don’t want to change it.

Also, I don’t think it makes much sense to bring this discussion to the forums, instead of opening a feature request on the issue tracker of the Nextcloud client (if there isn’t one already). However, I suspect that the developers arguments against this feature will be similar to the one made here, which I tend to agree with.

Just my 2 cents :wink:

Then everyone who starts using the Nextcloud Desktop Client must be informed that this is a centralized backup-sync solution where the server is the master.

It cannot be that when you do your first Desktop client sync, that certain folders get removed from your local harddrive. NEVER remove data that has not been synced yet. Or ask the user what he wants to do with those folders.

But do not just remove them.

Please read this again to understand your users:

Well, you have the developers opinion and 90 % of the users expected behavior. What is more important for a good and solid product? JM2C.

Nextcloud is not a “backup sync” solution and was never intended as such. And in general, I would be very careful with the term “backup sync”, because mixing and matching these two very different concepts with the help of tools that are not designed for this purpose literally screams data loss :wink:

Congratualtions, you got it. :wink:

That’s exactly what it is supposed to be, and nothing implies otherwise. And again, synchronisation in general has never meant to be a replacement for backups, and should never be used as such!

Why not? They originate from the Nextcloud server and were never on your desktop until you decided to synchronise them with your desktop.

Well, if you put something in a folder it synchronises almost immediately. If you then decide to remove the folder from synchronisation before the checkmark turns green, you would a) have to be very quick, and b) I am not even sure if the folder would be deleted before the synchronisation is completed. Either way, I think this scenario is somewhat fabricated by you to make a point :wink:

Well, I am a user and I wouldn’t want it to be any other way.

I use the desktop client for what it is intended, namely to make the contents of my Nextcloud server available on my computer.

So, when I change something in the Nextcloud folder on my desktop I want it to be changed on the server as well, if I delete something it should be deleted on the server as well, and if I decide I don’t want to synchronise certain folders (anymore), they should not appear in my local Nextcloud folder, respectively they should disappear after I disabled them.

Doing it the way you suggest, on the other hand, would lead to a mess and lots of inconsistencies, i.e. I would have different versions of the same files locally and on the server, which would be difficult to manage and in the worst case could lead to data loss if I accidentally delete the wrong version of a file.

Example: What is the client supposed to do if you decide to synchronise the folder again after a few months, and changes have been made to the files on both ends? Then it would need some (manual) conflict management, to decide which version it should keep. But do you still know for each individual file which version you want to keep? Or should it keep both versions, which would even lead to a bigger mess, where, on the other hand, keeping the wrong version could mean loss of data?

People already lost data, if you have a folder with many files or larger files, the sync process can take some time, even more on less optimized machines. If this was detected, it would be a much better user experience.

What we/I don’t know how much effort it is to implement this, but you need to check this with the developers. And then perhaps see how often it happens, there are perhaps different ways to mitigate this problem.

Please leave a link here, so people interested in this issue can follow the discussion there.

Absolutely, if the local data actually gets deleted before the synchronisation is complete, which I never expirienced, I would consider this a bug, and this should of course be detected.

However, simply leaving the local folders in place, just in case, would be a poor workaround, and introduces its own problems, as I tried to explain in my previous posts.

I won’t open an issue, becuse I didn’t expirience any issues. :wink:

Well, you could come up with different workarounds.

This is like saying “I never had a car accident, so there are no car accidents.” (!) :see_no_evil:

Scenario that was leading to the BUG

  1. Setting up Nextcloud
  2. Setting up Computer A with desktop client to sync harddrive D: to Online-Storage
  3. Computer A synced all data to Online-Storage
  4. Setting up Computer B with desktop client to sync Online-Storage to harddrive D:
  5. Computer B had existing data on harddrive D: which was confidential (computer A should not get it), so of course, I unchecked this specific folder in the desktop client :warning:
  6. Result: Nextcloud desktop client deleted my confidential folder

And sidenote: The warning message is font size 10px. It is nearly invisible to the user!

It is very unexpected and confusing that a local folder I unchecked, so it does not get synched, gets deleted!

Is it not clear enough that this is a severe bug?!

Why would you sync the contents of your Nextcloud to the root path of your to harddrive? You really shouldn’t do that. Again, Nextcloud is not a backup app. Define a folder like D:\Nextcloud where you going to sync the contents of your Nextcloud to, and put only things into that folder, which you want to get synched to your Nextcloud server.

Then you would uncheck it on computer A, instead of compuer B. But either way, the data would still be on your Nextcloud server. If it’s not, it never got uploaded to the server, which I agree, shouldn’t happen.

Nevertheless, I think that despite this possible bug, this is still mostly a case of “you’re holding it wrong”, so let me try to explain the hole thing again, in different words:

The Fundamentals

  1. You should think of Nextcloud as the master in this hole synchronisation thing!
  2. The desktop client is meant to make the contents of your server available in one or multiple folders on your computer.
  3. It is not meant to backup the contents of your computers, and you shouldn’t use it for that purpose!
  4. In my experience, the client also has only limited capability to synchronise app and/or data folders from locally installed programmes across several computers, especially if some kind of database is involved.

Daily usage:

  1. If you connect the client to a Nextcloud account on a compuer for the first time, the clinet will show you all the folders that are on the server, from which you then can exlude certain folders by uncecking them, so they won’t get synced to your loacal machine, and therfore won’t appear on your local machine in the first place.

  2. With that in mind, it is only logical, that when you unceck one of these folder later on, they’ll disappear from your local machine. However, the data will still be on the server in that exact same same folder, and if you check the folder again, the folder will re-appear on your computer, and the data will get downlodaed again.

  3. The “add additional folders to the synchronization”, option isn’t any different, and works exatley the same way. But yes, that should probably made more clear, and I kind of get it, that it could be confused with adding local folders to your synchronistaion, while it is in fact meant to add additional synchronisation targets on your computer.

TL:DR (oversimplified)

The checkboxes define which server folders should appear in which folder on the specific computer the clinet is installed, not the other way arround.

It’s about this case because you really loose data. Workaround could be that it moves the files to some other place, ends up in the trash bin, exclude this folder from syncing 
 (all with possible drawbacks).

I’m closing here, because this needs to be discussed with the developers. Perhaps they find other ways to avoid this situation, they are unaware of a different problem etc. but we don’t know all that. However, users have experienced problems.