Recover Unsynced Files on Nextcloud

Hey guys,
We had a problem with a Nextcloud v25.0.2 that for some reason stopped working.

To try to be more agile, we ended up doing a reinstallation and restoring a two-day backup, since it was the only one that worked.

It turns out that in this interval the client continued to save files on their local computers to synchronize later, but when we uploaded the new Nextcloud and there was synchronization these files simply disappeared.

Has anyone faced a problem like this? How did you recover these files?

Much of that depends on exactly how the system was backed up and restored. Were file timestamps maintained in the restored files? Did you also restore the database from the same backup?

The sync log on the client might also have some useful info.

Hi @KarlF12, many thanks for your reply

Perhaps the problem is because I was only able to restore the backup from the previous two days…

But the strange thing is that all the files that the client saved locally on his computer in those two days that Nexcloud was not working, simply disappeared in synchronization when we uploaded Nextcloud again.

But I will look for some logs and post them here, because my hard mission is to try to rescue these files.

Well I’ll just tell it to you straight, I don’t like your odds of getting those files. Obviously any recovery would have to be client side because those files were never on the server.

A key point when restoring from backup is you have to make sure Nextcloud doesn’t think the server data is newer than the client data because then this type of thing can happen. It’s absolutely vital to maintain the original timestamps.

If you look at Nextcloud files, is the modified date and time when you restored the backup, or is it at or before the backup was taken a couple days prior?

Thank you very much for the information, it really makes sense.

I’ll check the logs but I believe that the files that the client saved had the same name as the one in the old backup, and therefore I believe that it is almost impossible to recover.

The key to correct restoring is actually this:

See Restoring backup — Nextcloud latest Administration Manual latest documentation