I’m running NextCloud in a VM and the data directory is a separate virtual disk. Just the other day, there was some corruption to the data disk, which brought up a question in my mind:
If the data directory is lost, but the remainder of the server, including database and config file was intact, could I simply recreate the data drive, mount it, and let the clients re-upload the data to the server?
I don’t think that works. I guess it throws some errors when trying to update a file that is not there anymore.
Also I’m not sure if the client is capable to force-push all its local files.
Be careful!
If the servers timestamp is newer than clients timestamp then the clients are going to delete their local data.
You can do following
- move the data on clients to temporal folder
- start empty sync
- move back data on clients they will pull back local data to the server.
and of course as usual do some backups before testing.
Good point, @Arman_Khalatyan!
What about manually purging / modifying the database, so that the NextCloud server is unaware of the files? Will that then prompt the client to re-upload said files?
The problem is that the sync client keeps track of what it uploaded. And I would not touch the local database of the sync client for sure!
So it looks like in a scenario where the data directory on the server was lost or corrupt, the only way to get the clients to re-upload the files is by manually going to each workstation and preforming some actions. I wonder if simply changing the “Modified” date/time of all the files on the client would accomplish this; as that’s something that could probably be scripted or deployed en masse (just thinking out loud).