0

I’m an Owncloud newbie and would like to deploy a containerized version of Owncloud on my NAS (QNAP) as a private alternative to Dropbox. I can run a docker container of Owncloud without any problem using the default sqlite database: I access the GUI, create the admin user, browse the file structure, etc. But I’d like to switch to Mysql and I was so far unable to do as Owncloud “seems” to ignore the settings in config.php.

I created a MySQL instance (MariaDB) in a separate container and added an empty owncloud-reserved database to it: I verified that from the Owncloud container I can successfully login into the MySQL’s via the command line using the appropriate credentials, so the database is reachable.

Following some instructions I found online I edited file config.php and changed field “installed” in variable $CONFIG from “true” to “false”: this triggers the db configuration wizard upon login. In the wizard I select “MySQL” and await the completion of the setup procedure. When it’s done I checked that:

  1. Owncloud tables have been created in the MariaDB database (the db was empty before running the wizard)

  2. The config.php file has been modified and now I see all mysql db settings, particulary: 'dbtype' => 'mysql', (the file showed before the sqlite settings)

So apparently the wizard did his stuff.

Despite the above, if I go to the Settings page of my admin user, under General I still see the red warning: “SQLite is used as database…etc”. For testing, I added a new user and indeed the data are still stored in the sqlite file rather than MySQL

So my conclusion is that Owncloud is ignoring config.php in my setup.

Things I tried to no avail:

Recreating the Owncloud container multiple times Restart the container after the database change Running the suggested sqlite to mysql migration script as per the owncloud official documentation

What am I missing? Thanks in advance Regards Sergio

shivlal kumavat
  • 868
  • 1
  • 12
  • 28
Sergio
  • 25
  • 3

1 Answers1

1

Problem solved. Adding the following variables with appropriate values to the container's environment did the trick:

OWNCLOUD_DB_TYPE=mysql
OWNCLOUD_DB_HOST=name or ip of the host (container) where the db is running
OWNCLOUD_DB_NAME=name of the database
OWNCLOUD_DB_USERNAME=name of the user to authenticate with (must have full privs on the db)
OWNCLOUD_DB_PASSWORD=its password

Thanks S.

Sergio
  • 25
  • 3
  • This was the answer I've been looking for after wasting 3 hours chasing misleading logs. This is not well documented. Thanks. – Alex Ward Jun 25 '23 at 17:00