What happens to files in Nextcloud desktop client folder when server crashes?

Hi,

I am running Nextcloud on Ubuntu on an old PC. I have just discovered Nextcloud Desktop Client. Up until now I have used Dropbox to sync text files, pictures etc across devices.

My question is this: given the PC is old, it could crash. Should that happen, would the files stored in folders under Nextcloud’s Desktop Client stay in their folders, or would the client start deleting those files too?

Thanks,

It depends how it crash.

Your server could have a HDD crash, witch require a data rescue if you don’t save it !!! (Nextcloud is sync, not a backup solution)
So as long as your NC client can’t connect to the server you won’t have any files deleted on your PC.

If you really messed up with your server you can arrive at a situation where NC server think you have nothing in your user folder and the action on the NC client can depend : your files stays on your PC but with a yellow icon meaning they won’t be sync. Or Your files will be deleted by NC client.

So advise 1 : make backup of your NC Server on a safe way. Backup files / database dump / configuration files.
Every day / week (depend on your usage)
Advise 2 : check your Server component to avoid crash. HDD / RAM / Power supply

Thanks - I guess my question is: if someone unplugged my hardware server, would my synced files on various hardware devices stay there or be deleted?

I don’t fully understand your comment on backing up - where would I place backup files? As long as the nextcloud desktop client doesn’t start deleting local files should the server disappear, then those local folders are a backup of my files, aren’t they?

If the Server have no AC Power, then all your device won’t see NC Server and you can only modifiy and work on the folders/files you have synced on your devices. When your server get to life again, all NC Clients will sync the modifications you made.

About the Backup it’s more touchy.
For your case all the data on the NC Server is on your computer, so you can think NC is a backup. Well it’s not quite true. Imagine you get a ransomware, all your folder get crypted, but NC Client still work, and upload all this modification to your NC Server. You didn’t notice it because you weren’t in front of your computer (drinking a cafe for ex.) Imagine then the versioning app didn’t work because they were too much modification and your Server HDD is full… How can you get back files/folders that are no longer on your PC, and no longer in the Server ?
Most of the case the NC Server have a lot of HDD space exemple 4To. Your PC have a small SSD of 256Go, you sync with NC about 50Go let say. You use your iPhone with NC Server too, using the Photo Backup App, you get growing the space by taking photos. You use another PC with a 500Go HDD and sync 300Go of Data. You can’t say, well if the server crash i have all the data in multiple devices…
Another thing important into the NC Database you have the users, the shares, calendars and so much, if your server break you have to reinstall NC from scratch and redo all the users, shares etc…

So you have to make a Backup of the NC Server (not just the files), and then you have a lot of choice to do that :
Pluging a USB HDD on it and doing rsync
Having a NAS in the home and doing rsync
Having a space in a another Cloud and encrypt it and rsync… it’s all your choice but you have to take :

The data folder (default is /var/www/nextcloud/data but it’s important to not having it into www folder)
The Nextcloud folder (default is /var/www/nextcloud) inside you have the configuration files IMPORTANT too
The WebServer files configuration depend if you use Apache or Nginx /etc/apache/sites-enable or /etc/nginx/conf.d
A Dump of the Database, you have to periodicaly do that, search on the net how to do that depending if you use Mysql/MariaDB or Postgresql

Thanks for your detailed reply, Nemskiller. I think I’d better investigate backup options.