root@webserv:/var/www/nextcloud# sudo -u www-data php updater/updater.phar
Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4
Current version is 21.0.0.
Update to Nextcloud 21.0.1 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-21.0.1.zip
Open changelog ↗
Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done
Start update? [y/N] y
Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.
[✔] Check for expected files
[✔] Check for write permissions
[ ] Create backup ...PHP Warning: copy(/var/www/nextcloud/config/config.php.bak): Failed to open stream: Permission denied in phar:///var/www/nextcloud/updater/updater.phar/lib/Updater.php on line 395
[✘] Create backup failed
Could not copy "/var/www/nextcloud/config/config.php.bak" to "/mnt/nextcloud/updater-ocgy2wtg640w/backups/nextcloud-21.0.0.18-1619406940/config/config.php.bak". Source /var/www/nextcloud/config/config.php.bak is not readable. Destination /mnt/nextcloud/updater-ocgy2wtg640w/backups/nextcloud-21.0.0.18-1619406940/config/config.php.bak is not writable
Update failed. To resume or retry just execute the updater again.
root@webserv:/var/www/nextcloud#
So, before you start your update, have you checked your directory permissions of nextcloud folders?
For the updater to work i ususally set my folders beneath /var/www/nextcloud chown -R www-data:www-data so that the updater is owner of the files that have to be overwritten.
Maybe your data folder also should be in ownership of your www user → check were you have placed your data folder in config.php.
The backups will be placed in a subfolder of your data folder, so it looks like your data folder is not writable by your www user in the moment when the updater starts the backup.
→ /mnt/nextcloud/…
check sudo su - and after that ls -la /mnt/nextcloud/... if all folders are owned by www user (www-data)
if there is one folder not in ownership of www-data:www-data then retry
sudo chown -R www-data:www-data /mnt/nextcloud
That will set recursive (incl. subfolders) every folder and file in ownership to www-data
mine problem was in file config.php.back owned by root so updater was unable to make backup of config file, after taken ownership of this file to www-data it update worked.
sorry that i get this thread out of death, but i updated my nextcloud with this commands (i had some errors with permission and wanna ask how to “update columns and indicies” proberly. Can you help me with this please? otherwise the update works now for me. Perfect
yes you wrote “dont forget to update columnes and indices”
But with
it says "
Command “db:add-primary-keys” is not defined.
Did you mean one of these?
db:add-missing-columns
db:add-missing-indices
db:add-missing-primary-keys
db:convert-filecache-bigint
db:convert-mysql-charset
db:convert-type