When to run occ maintenance:data-fingerprint?

I accidentally deleted my Nextcloud database and Nextcloud config.php.

I could restore an old database, and I also found a previous config.php.

But Nextcloud has been offline for around three months and only now I’m trying to restore it.

There are several Nextcloud Desktop sync clients that should sync with Nextcloud, but they are now three months ahead of the to be restored Nextcloud.

Also, the database backup was roughly one month old at the time that I deleted the database accidentally.

Imagine that I restore the database backup and the config.php.

I guess I have to run occ files:scan to make the database up-to-date.

I think I also have to run occ maintenance:data-fingerprint, because the Nextcloud clients are three months ahead.

I have a few questions:

  1. What should I run first occ files:scan or occ maintenance:data-fingerprint, or does the order not matter?
  2. Are there any risks involved in running occ maintenance:data-fingerprint? Can this command be dangerous, or is it harmless.

The documentation here (Using the occ command) and here (Synchronising with clients after data recovery) is not totally clear for me.

At this time or in general in context of restore there is no need to run occ files:scan - this command is required if you fiddle with server storage - in other word if you change files inside of data directory outside of Nextcloud.

you already spot the right procedure: right after DB restore run occ maintenance:data-fingerprint

IMHO the docs is pretty clear how to proceed:

If the recovered backup is outdated the state of the clients may be more up to date than the state of the server. In this case also make sure to run the maintenance:data-fingerprint command afterwards. It changes the logic of the synchronisation algorithm to try an recover as much data as possible. Files missing on the server are therefore recovered from the clients and in case of different content the users will be asked.

But I would still suggest you make another copy of clients data before you start the sync to avoid any surprises.

1 Like

The database was a bit older than the files on the server. I think that I therefore also had to run occ files:scan.

In the end I did:
First occ files:scan
Later occ maintenance:data-fingerprint

All went well (from this perspective, there were some other unrelated issues). The clients synced correctly. Some conflicts were correctly reported, and I could solve them via Nextcloud Desktop.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.