I migrated my Nextcloud from a Rasperry Pi (with NextcloudPi running) to a NUC type server and everything is running fine.
But today’s attempt to update from 25.0.4 to 25.0.5 gives me the following error.
“The following extra files have been found:
I searched this of course but didn’t find my problem, because ncdata is not a file (also not a hidden file) but my nextcloud data directory located in var/www/nextcloud instead
My data directory (which I did not change during migration) is correctly set up in config.php
‘datadirectory’ => ‘/var/www/nextcloud/ncdata’,
Can someone please give me an idea what to do?
thanks and best
I prefer to have the nextcloud data directory not in the webroot of the nextcloud server.
→ Nextcloud webroot and data directory - best practices on Ubuntu 18.04 LTS
try the following steps:
stop all nginx, database redis tasks
systemctl stop nginx …
- make a directory somewhere outside the path /var/www/nextcloud → maybe /media/nextcloud/my-data-dir
- change ownership of this new data dir → sudo chown -R www-data:www-data /media/nextcloud/my-data-dir
- copy all (!) hidden and no-hidden files of your actual data dir /var/www/nextcloud/ncdata to /media/nextcloud/my-data-dir
- zip your old ncdata dir as backup if something needs to be restored later (!)
- move the zip file away from /var/www/nextcloud and delete your ncdata folder
- edit your /var/www/nextcloud/config/config.php datadirectory path to your new path /media/nextcloud/my-data-dir
- repeat the command sudo chown -R www-data:www-data /media/nextcloud/my-data-dir to be sure that all files and folders are owned by your webserver user and also check that www-data user has read/write access to all files and folders (!)
- start the nginx, database, etc.
- run command sudo -u www-data php /var/www/nextcloud/occ integrity:check-core
Login to your WebUI and enter the Admin section and re-check if everything works fine.
@chrissi55 Thank you very much for your comprehensive answer. However, I’d like to go a less severe change before moving the data directory.
What I don’t get is: It must work and it did. Nextcloud recommends the data directory installed. And on my Raspy, I had automatic update enabled. This worked perfectly. Now my administration view it says “Last background job execution ran last month. Something seems wrong.” Maybe the conflict is lying here? So that there is still an old script present? I searched for “autoupdate”. There were no results.
What do you think of by … data dir installed? Of course NC needs a data dir but the admin manual itself recommends to place the data dir outside the webroot
see this help
You may give the admin guide recommendation a try and see if this solves the problem and you’ll get a more secure installation on top.
Sorry, the sentence missed some words. It should have read “Nextcloud recommends the data directory to be installed in the nextcloud folder”. cf Configuration Parameters — Nextcloud latest Administration Manual latest documentation