Maintenance Mode w/o Database?

Hi all,

I am running OC 10.x with MariaDB as backend.
For backup purposes I stop mariadb and are backing up the files under /var/lib/mysql.

Obviously, Owncloud does not like this and daily reports a crash:

    "date": "2021-05-26T00:01:01+00:00",
    "parentId": null,
    "id": "f14e82c128d98ae01ce464b60ad8fbd3fdc63.14356812",
    "class": "Doctrine\\DBAL\\DBALException",
    "message": "Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused",
    "stacktrace": [

Before stopping the database I put OC in maintenance mode through occ:
sudo -u www-data /srv/www/ maintenance:mode --on

Looks like maintenance mode is not enough to shut down the database. Do I have to stop the web server/ httpd?



Did you also disable the cron job?

1 Like


No, I did not- as it is not so easy to disable on command line. Shouldn’t it recon the maintenance mode and stop acting?


The maintenance mode still requires DB access to be able to perform some actions.
If you need to stop the DB to make a backup, it might be better to stop the whole web server to ensure ownCloud is completely stopped.

You can also try to look for live backups for the DB so you don’t need to stop the DB. No idea about the limitations though.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.