Files in Nextcloud web don't reflect the files in /var/lib/nextcloud/data

I’m trying to migrate my user files from an old installation to a new one. I put Nextcloud into maintenance mode, I deleted the default new user files, and then I moved my user’s files from my old installation to /var/lib/nextcloud/data/<my-user>/files. But when browsing the files in the Nextcloud web interface, the default files are still there. I checked my config.php, and my Nextcloud data directory is definitely /var/lib/nextcloud/data/.

Server OS: Arch Linux
Nextcloud Version: 21.0.1

1 Like

Here are commands I run when I update the files externally, so they are accessible to nextcloud. Maybe this will help you too!

chown -R www-data:www-data /var/lib/nextcloud/data/<my user>/files
sudo -u www-data php /var/www/nextcloud/occ files:scan <my user>"

If you’re going to make it a habit of changing the files directly in the filesystem rather than through nextcloud, you can also set the config option 'filesystem_check_changes' => 1, which will cause nextcloud to refresh its view of the filesystem on request.


Thanks! The files:scan command fixed it.

1 Like