Moodle/Totara | Different ways to enable/disable maintenance mode

|
| By Webner

There are multiple ways to enable/disable maintenance mode in Moodle.

From UI

Enable Maintenance Mode:

* Go to the Site Administration.
* Click on Server.
* Click on Maintenance Mode option:
1
* On the next screen: Maintenance mode ->Select “Enable” from drop-down. And write the message which you want to display for users while in maintenance mode (optional):
2
Now your site is in maintenance mode and you can see the maintenance mode message on the homepage of your site.

Disable Maintenance Mode: To disable maintenance mode you can follow these steps:

Add /login/index.php at the end of your website URL:
For example www.xyz.com/login/index.php

Login with Admin user credentials and disable the maintenance mode by following the same steps as above which were used to enable the maintenance mode and select Disable from the drop-down in Maintenance mode screen.

Using Terminal/CLI (Command Line Interface) to enable/disable maintenance mode:

If you have shell access to your web server, you may find various CLI (command line interface) scripts for different administration works for Moodle.

Enable Maintenance Mode:

Go to your moodle directory:

$cd /path/to/your/moodle/dir

Run following command:

$sudo /usr/bin/php admin/cli/maintenance.php --enable

3

Disable Maintenance Mode:

Go to your moodle directory:

$ cd /path/to/your/moodle/dir

Run following command:

$ sudo /usr/bin/php admin/cli/maintenance.php --disable

Output:

4
Using Database:

You can also enable/disable maintenance mode directly in database by changing the variable named “maintenance_enabled” to “0” in the “mdl_config table“. If value is “1” that means the maintenance mode is enabled and “0” means disabled:
5

Leave a Reply

Your email address will not be published. Required fields are marked *