I used an old HDD to set up a Nextcloud instance via snap. It performed well, but the disk crashed and an attempt to rescue it is underway. I have swapped the drive with another model, and have changed my config.php file to point to the new location. I manually created the .ocdata file by running
touch .ocdata in the data directory.
I can now log onto the browser interface (but my iPhone is giving me trouble by repeatedly asking for a password and refusing to upload anything).
However, Nextcloud seems to be storing a database of files somewhere outside the data directory I specified within config.php. When I log onto the web interface, I am greeted by a list of files that no longer exist (as they were not copied to the new hard drive), and opening them naturally produces an error.
I have already tried running
sudo nextcloud.occ files:scan --all
but for each user in the system I get the message: “Home storage for user x not writable. Make sure you’re running the scan command only as the user the web server runs as.”
I’ve also ran
sudo nextcloud.occ maintenance:repair
but the command only returns a bullet point list of things it has not done (along the lines of “0 files” or “nothing to do”).
How do I reset this database and force a re-scan of the files present in the data directory?
Thank you for your help!