Maintenance mode: Difference between revisions

From MoodleDocs
(→‎Setting maintenance mode: deleted signature and "TEST" from Russ Jones)
 
(28 intermediate revisions by 9 users not shown)
Line 1: Line 1:
Location: ''Administration > Server > Maintenance mode''
{{Server settings}}
 
==Preventing access whilst maintenance is taking place==
 
Maintenance mode is for preventing any users other than administrators from using the site while maintenance is taking place, though ''it's not designed to prevent user access during version upgrades''.
Maintenance mode is for preventing any users other than administrators from using the site while maintenance is taking place.


When users attempt to access a course when your site is in maintenance mode, they obtain a message informing them that the site is in maintenance mode. If you wish, you can create a customized maintenance mode message, perhaps stating when the site will be available again or giving the reason for doing maintenance.
When users attempt to access a course when your site is in maintenance mode, they obtain a message informing them that the site is in maintenance mode. If you wish, you can create a customized maintenance mode message, perhaps stating when the site will be available again or giving the reason for doing maintenance.
Line 10: Line 9:
==Setting maintenance mode==
==Setting maintenance mode==


To put your site in maintenance mode:
An administrator can put the site into maintenance mode in ''Administration > Site administration > Server > Maintenance mode''.
 
When a site is in maintenance mode, the link "In Maintenance Mode" is displayed near the top right of each page (except the front page) for admins.
 
If your session finished while still in Mainenance mode, you can re-login by typing the login URL directly (<nowiki>http://yoursitename/login/</nowiki>)
 
==CLI maintenance mode==
 
Admins can enable CLI maintenance mode by adding a file <tt>$CFG->dataroot/climaintenance.html</tt>. If it exists, this file will be sent to the navigator instead of the standard Moodle home page.
The difference from the standard maintenance mode is that all web access is prevented, CLI scripts continue to work (with the exception of admin/cli/cron.php). This CLI maintenance mode is often used during CLI version upgrades.
 
It is possible to use the admin/cli/maintenance.php to schedule the CLI maintenance mode and then to display a message to users warning them when the site will become unavailable. In the scheduled maintenance mode, the maintenance message is taken from admin setting, template file <tt>$CFG->dataroot/climaintenance.html</tt> and the language pack, in this order. See MDL-37596 for details.
{|
|[[File:maintenancecli25.png|thumb|Scheduled  maintenance mode]]
|}
See also the section on maintenance mode in [[Administration via command line]].
 
==Allowing non-admin users access to site whilst in maintenance mode==
 
Non-admin users may be given access to the site whilst in maintenance mode as follows:


#Access ''Administration > Server > Maintenance mode''.
# Create a new role with the capability [[Capabilities/moodle/site:maintenanceaccess|moodle/site:maintenanceaccess]] allowed
#Click the Enable button.
# Assign it to selected users as a system role


If for some reason the webinterface is not available you can also put the Moodle installation in maintenance mode by creating a file called ''maintenance.html'' in the folder called ''1'' (i.e. numeric 'one') in your moodle data folder. Any text in that file will be displayed to users trying to access anything other than the frontpage.
==Outage manager additional plugin==
This is a Moodle plugin which makes the student experience of planned outages nicer, and provides extra tools for administrators and testers that help before and after the outage window.


----
The main idea is that instead of an outage being a very boolean on/off situation, this plugin creates the concept of graduated outages where at predefined times before an outage and after, different levels of warning and access can be provided to students and testers letting them know what is about to happen and why.
When you go into Maintenance mode and create this file you will need to test the Maintenance mode to make sure that you can come out of Maintenance mode and a non admin user can login. If they can't you may have to delete the maintenance.html for non admin users to be able to login. Be sure it works before you are stuck in Maintenance mode and non admin users are unable to login past the front page.


{{Moodle 1.9}}In Moodle 1.9.3 onwards, when a site is in maintenance mode, the link "In Maintenance Mode" is displayed near the top right of each page (except the front page) for admins.
See [https://moodle.org/plugins/auth_outage Outage manager] - A plugin to manage outage periods, such as scheduled maintenance, including CLI tools to embed in your scripting.


==See also==
==See also==
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=46451 Maintenance mode?] forum discussion


[[Category:Administrator]]
Forum discussions:
*[https://moodle.org/mod/forum/discuss.php?d=245299 Maintenance mode cannot be switched off]
*[https://moodle.org/mod/forum/discuss.php?d=251954 Moodle for Windows stuck in Maintenance mode]
*[https://moodle.org/mod/forum/discuss.php?d=318890 Turned on Maintenance and can't get back in]


[[eu:Mantenu-modua]]
[[es:Modo de mantenimiento]]
[[fr:Mode de maintenance]]
[[fr:Mode de maintenance]]
[[hu:Karbantartási üzemmód]]
[[ja:メンテナンスモード]]
[[ja:メンテナンスモード]]
[[de:Wartungsmodus]]
[[de:Wartungsmodus]]

Latest revision as of 18:11, 24 February 2020

Preventing access whilst maintenance is taking place

Maintenance mode is for preventing any users other than administrators from using the site while maintenance is taking place, though it's not designed to prevent user access during version upgrades.

When users attempt to access a course when your site is in maintenance mode, they obtain a message informing them that the site is in maintenance mode. If you wish, you can create a customized maintenance mode message, perhaps stating when the site will be available again or giving the reason for doing maintenance.

Note: The front page of your site will appear as normal when your site is in maintenance mode. Users will only see the maintenance mode message when they attempt to access a course.

Setting maintenance mode

An administrator can put the site into maintenance mode in Administration > Site administration > Server > Maintenance mode.

When a site is in maintenance mode, the link "In Maintenance Mode" is displayed near the top right of each page (except the front page) for admins.

If your session finished while still in Mainenance mode, you can re-login by typing the login URL directly (http://yoursitename/login/)

CLI maintenance mode

Admins can enable CLI maintenance mode by adding a file $CFG->dataroot/climaintenance.html. If it exists, this file will be sent to the navigator instead of the standard Moodle home page. The difference from the standard maintenance mode is that all web access is prevented, CLI scripts continue to work (with the exception of admin/cli/cron.php). This CLI maintenance mode is often used during CLI version upgrades.

It is possible to use the admin/cli/maintenance.php to schedule the CLI maintenance mode and then to display a message to users warning them when the site will become unavailable. In the scheduled maintenance mode, the maintenance message is taken from admin setting, template file $CFG->dataroot/climaintenance.html and the language pack, in this order. See MDL-37596 for details.

Scheduled maintenance mode

See also the section on maintenance mode in Administration via command line.

Allowing non-admin users access to site whilst in maintenance mode

Non-admin users may be given access to the site whilst in maintenance mode as follows:

  1. Create a new role with the capability moodle/site:maintenanceaccess allowed
  2. Assign it to selected users as a system role

Outage manager additional plugin

This is a Moodle plugin which makes the student experience of planned outages nicer, and provides extra tools for administrators and testers that help before and after the outage window.

The main idea is that instead of an outage being a very boolean on/off situation, this plugin creates the concept of graduated outages where at predefined times before an outage and after, different levels of warning and access can be provided to students and testers letting them know what is about to happen and why.

See Outage manager - A plugin to manage outage periods, such as scheduled maintenance, including CLI tools to embed in your scripting.

See also

Forum discussions: