Migrate Nextcloud config and Maria DB5 to DB 10

Nextcloud version (eg, 20.0.5): 21.0.3
Operating system and version (eg, Ubuntu 20.04): Synology DSM 6.2.4-25556
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4
PHP version (eg, 7.4): PHP 7.4

The issue you are facing:

Since DSM 7 & Nextcloud 21 drops the support for Maria DB5, I would like to test a fresh, new and separate Nextcloud 21 installation in combination with Maria DB10.
The actual Nextcloud version is 20.0.11

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

Steps to replicate it:

  1. Backup and restore Nextcloud DB as described here: How to migrate databases from MariaDB 5 to MariaDB 10 - Synology Knowledge Center
  2. Extracted Nextcloud 21.0.3 into a new subdirectory under /web
  3. copy Nextcloud /config/config.php into the new config folder. (What should I change here in order to get the old config working with a new maria DB version?

The output of your Nextcloud log in Admin > Logging:

Not accessible, because of this behavior
The logfile which is generated through the config file generate an empty logfile.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => 'ip',
  'datadirectory' => '/volume1/web/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://ip/nextcloud',
  'dbname' => 'nx',
  'dbhost' => '',
  'dbport' => '3307',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nx',
  'dbpassword' => 'password',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'maintenance' => false,
  'updater.release.channel' => 'stable',
  'theme' => '',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'installed' => true,
  'mysql.utf8mb4' => true,
  'log_type' => 'file',
  'logfile' => 'nextcloud.log',
  'loglevel' => 3,
  'logdateformat' => 'F d, Y H:i:s',

The output of your Apache/nginx/system log in `/var/log/____`:

It seems that I am too dump to find the proper logfiles for the webserver in the Synology, because the protocol center has nothing valuable.

Please also read backup and restore.

If possible use command line for dump and insert data in MariaDB see my links.

Please use same nextcloud version for backup and restore.
Only change between “backup” and “restore” MariaDB version.

Nextcloud 20.0.11 vs. Nextcloud 21.0.3

I think you must backup and restore with Nextcloud 20.0.11 and after restore upgrade to Nextcloud 21.0.3.

Thanks for the links! I will create first another v20 installation, restore it on this. Upgrade to 21.
Once it is upgraded to v21, I will try to upgrade Maria DB 10

Thanks. Please post your successful steps in this thread for other users.

Not sure why, but when I try to create the DB with the mysql command. I get the error: ERROR 2005 (HY000): Unknown MySQL server host

Even when I stop Maria DB5 and try to connect to the Database (While Maria DB10 is active) with “mysql --host=localhost” I got as a result ERROR 2005 (HY000): Unknown MySQL server host ‘localhost:3307’ (0)

It seems I have first to bother with this issue befor I can do the upgrade.

The Migration worked as you described. I got some troubles to get a connection to the DB10, but it worked with the IP address instead of localhost.

1 Like

Perhaps you can use “” instead of e.g. “localhost” or the other way.
My config:

  'dbhost' => 'localhost',
  'dbport' => '',

Also you can use perhaps a .sock-file . Search in the internet: mysql.sock

  'dbhost' => 'localhost:/run/mysql/102/mysql.sock',

Perhaps your settings differ.
find /run -name mysql.sock

I was very busy with private topics and did not had much time to spend it there and I made it easy.

I’ve made a backup of the database, the calender and the contacts and restored them on a different service to check them all.

I fully removed MariaDB5 and 10 and all Nextcloud instances. After then I’ve started from scratch.
The DBhost entry is :3307 as it is the same port that shows me the DSM GUI for the MariaDB10 config.