Info
Content

Maintenance Mode


You can enable site maintenance mode through:

Site administration > Server > Maintenance Mode > Maintenance mode

This disables access to the site to all users except site administrators. This is fine for minor updates and patching, but for large upgrades where you intend to take a backup of the site, you should be using CLI maintenance mode.

The benefit of CLI maintenance mode is that unlike normal maintenance mode it stops all users from accessing the site which is critical if you want to take a reliable an complete backup of the database and file store. Also it will continue to work even when the database is offline.

This can be found under the standard admin CLI location:

php admin/cli/maintenance.php

Options include:

php admin/cli/maintenance.php --enable
php admin/cli/maintenance.php --disable

The message displayed will be the same maintenance mode message set up under:

Site administration > Server > Maintenance Mode > Optional maintenance message
maintenance_message

Behind the scenes, because CLI maintenance mode needs to work without database connectivity, it places a file called climaintenance.html in the data directory. This is a simple HTML web page that displays the maintenance mode message. So you can also just edit the text in this file if you want to adjust the maintenance mode message after it is enable (e.g. if you have an ETA and that has changed).

There is also a cool feature to enable it later e.g.

php admin/cli/maintenance.php --enablelater=60

Which would enable it after 60 minutes. This will tell exactly when maintenance mode will be enabled too. Good for making sure the site is in maintenance mode when you are ready to start an upgrade for example.

No Comments
Back to top