Migration from Owncloud 10.6 to Nextcloud 21: ✅

Since I didn’t find much information for migrating a current Owncloud 10.6 to Nextcloud 21, I’m sharing my little experience report here: First of all, except for a few minor hiccups, it went reasonably smoothly.

First I initiated a direct manual upgrade from OC10.6 to NC21 as described here: Upgrade manually

After backing up the MariaDB and Owncloud directories and adjusting the file permissions in the new Nextcloud directory with:

chown -R www-data:www-data nextcloud
find nextcloud/ -type d -exec chmod 750 {} \;
find nextcloud/ -type f -exec chmod 640 {} \;

I started the upgrade:

sudo -u www-data php occ upgrade

This attempt failed with the note:

Updates between multiple major versions are unsupported

Since i have a backup of everything, I just changed the version of the old owncloud installation from 10.6 to 10.5 in the config.php file in the new nextcloud directory.

‘version’ => ‘’, changed to ‘version’ => ‘10.5’,

Triggered the upgrade again, everything runs through until an error message:

app ‘Brute-force settings’ cannot be installed

After I turned off the maintenance mode anyway:

sudo -u www-data php occ maintenance:mode --off

I was able to log into the new Nextcloud via browser and install the app ‘Brute-force settings’ from the backend.

In the backend under Settings → Overview some hints appeared what still had to be done. The commands were quickly processed:

apt-get install php-bcmath
apt-get install php-gmp
sudo -u www-data php occ db:convert-filecache-bigint
sudo -u www-data php occ db:add-missing-columns
sudo -u www-data php occ db:add-missing-primary-keys
sudo -u www-data php occ db:add-missing-indices

This is where the biggest problem occurred, because the last command gave an error message

An index with name ‘cards_abiduri’ was already defined on table ‘oc_cards’.

That required some time of searching. Finally, I had to drop the index with:

MariaDB → use [db-name]
alter table oc_cards drop index cards_abiduri;

Afterwards, the table still had to be adjusted, as described here:

MariaDB [db-name] >
ALTER TABLE oc_activity CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

After a final

sudo -u www-data php occ maintenance:repair
sudo -u www-data php occ db:add-missing-indices
sudo -u www-data php occ maintenance:mode --off

there were no more error messages and nextcloud 21 is running. :crossed_fingers:

1 Like