Upgrade from 25.0.7 to 26.0.2 fails on app "files"

# occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Updating database schema
Updated database
UnexpectedValueException: The files of the app "files" were not correctly replaced before running the update
Update failed

Nextcloud version (eg, 20.0.5): 25.0.7
Operating system and version (eg, Ubuntu 20.04): FreeBSD
PHP version (eg, 7.4):

PHP 8.1.13 (cli) (built: Nov 27 2022 21:51:54) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.13, Copyright (c), by Zend Technologies

The issue you are facing:

I am unable to upgrade to 26.

Is this the first time you’ve seen this error? (Y/N): yes

Steps to replicate it:

  1. Click the upgrade button in nextcloud admin panel
  2. Try to finish the upgrade with occ upgrade

Are you running occ as the same user as your web server?

You didn’t see any indications of issues with the web based update portion?


You can also try a command line update process (in the above doc) to repeat to the web based one and see if something is being showing indicating an issue.

Again, run as the correct user (generally not root, which your prompt is indicating).

Heh. My occ script is not nextcloud’s:


for arg in "$@" ; do
    if [ "${arg#* }" != "${arg}" ] ; then
       args="${args} '${arg}'"
       args="${args} ${arg}"

cd /nextcloud
su -m nextcloud -c \
    "/usr/local/bin/php --define apc.enable_cli=1 /nextcloud/occ ${args}"

Also, /nextcloud is really the ZFS volume where I keep the nextcloud install, so I can snapshot and rollback. In fact, I’ve done this after the failed upgrade. The files in the folder belong to nextcloud too.

I saw no issues with the web update portion.

Can you provide your updater.log?

The files app is a shipped app. Somehow you have an old version around that was not able to be updated by the updater. Do you by chance of multiple *app* folders? I can’t really think of a good reason for this to occur.

No need now. Just the act of searching for updater.log revealed the problem. In rearchitecting my zfs volumes so code is separate from data, I failed to add a symlink so nextcloud could find it’s own code. This has been fixed and I am now on

Two more versions to go. :slight_smile: Thanks for your help.