Can't restore files after re-installaion

The Basics

  • Nextcloud Server version: 31.0.7
  • Operating system and version: Ubuntu 22.04 LTS (WSL2)
  • Web server and version: Apache 2.4.52
  • Reverse proxy and version: No reverse proxy
  • PHP version: 8.1
  • Is this the first time you’ve seen this error?: Yes
  • When did this problem seem to first start?: After re-installing NextCloud due to a 3rdparty app error
  • Installation method: Manual install from tarball (archive)
  • Are you using Cloudflare, mod_security, or similar?: No

Summary of the issue you are facing:

I reinstalled my NextCloud instance manually (had this “Composer autoloader not found, unable to continue. Check the folder “3rdparty”. Running “git submodule update --init” will initialize the git submodule that handles the subfolder “3rdparty”.” ) and restored backups of the data/ and config/ directories.
The files exist on disk under /mnt/storage/www/data/mazal/files/, but in the NextCloud Web UI I only see folders, not the files inside them.

File names look correct now (e.g. Document.docx, not Document.docx.d123456789) and permissions are www-data:www-data.
The datadirectory is correctly set to /mnt/storage/www/data, and file ownership is correct.

I’ve run:

sudo -u www-data php occ files:scan --all

It scanned millions of files with no errors.
Still, no files show up in the UI — just empty folders.


Steps to replicate it:

  1. Install NextCloud manually
  2. Restore backups of config/ and data/ directories (only these two were backed up)
  3. Set correct permissions for all files/folders
  4. Run occ files:scan --all
  5. Visit the Web UI — folders show up, but all are empty

Log entries

Nextcloud log (/mnt/storage/www/data/nextcloud.log)

{"reqId":"...","level":2,"time":"2025-08-02T23:11:34+00:00","remoteAddr":"...","user":"mazal","app":"no app in context","method":"PROPFIND","url":"/remote.php/dav/files/mazal/","message":"File with name ... could not be located","userAgent":"Mozilla/...","version":"31.0.7.1"}

(Repeats with different paths)


Web Browser Console

Only HTTP 207 multi-status requests. No errors in Console or Network tab.
UI just shows folders, but no files inside.


Web server logs

No relevant errors. Apache is serving correctly. PHP-FPM also OK.


Configuration

config.php

  'datadirectory' => '/mnt/storage/www/data',
  'dbtype' => 'mysql',
  'dbname' => 'nextcloud',
  'installed' => true,
  ...

occ config:list system

(Truncated for brevity — matches above)


Apps

sudo -u www-data php occ app:list

Enabled (excerpt):

- files: 2.3.1
- files_versions: 1.24.0
- files_trashbin: 1.21.0
- theming: 2.6.1
- workflowengine: 2.13.0

Disabled:

- encryption: 2.19.0
- admin_audit
- photos

Things I’ve already tried

  • Verified datadirectory path is correct
  • Fixed all file permissions (www-data:www-data)
  • Removed .d123456789 suffixes from files
  • Verified presence of .ocdata file in data/
  • Ran occ files:scan --all several times
  • Confirmed disk usage shows correct data (~360GB)
  • Checked user:info shows valid paths

The question

:white_check_mark: How can I get NextCloud to recognize the actual files on disk (which are in the correct place) and make them appear in the web UI?

Did restoring only config/ and data/ cause metadata mismatches? Do I need to repopulate the database in some way beyond files:scan?

Thank you! :folded_hands:

permissions to new directory?
and

sudo chmod -R /path/to/new/dir

stop apache2: `sudo service apache2 stop`

apache2:
sudo nano /etc/apache2/sites-enabled/000-default.conf

change under DirectoryRoot /new/path

save Ctl+O, enter
restart Webserver:
sudo service apache2 restart

Normally when restoring from backup, you’d also restore a snapshot of your database from backup. Is that what you did? The file meta data is actually stored in the database.

Are the restored files in the same underlying storage path they were in before or did you restore into a different spot or change anything else during the course of restoring things?

Also, to clarify, what was the original issue? What were you doing involving git?

P.S. It would also be helpful if you posted your real parsed config (using occ config:list system) and app lists (using occ app:list) as noted in the support template).

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