Technical Q&A
[SOLVED] How to Enable or disable Maintenance Mode using Drush in Drupal 9
Steps for Enabling or disabling maintenance mode using Drush
1. Run the following Drush commands to enable maintenance mode and clear
drush state:set system.maintenance_mode 1
drush cr
2.Run the following Drush commands to disable maintenance mode and clear the cache:
drush state:set system.maintenance_mode 0
drush cache:rebuild
After running either set of commands, verify that your site is either in or out of maintenance mode by visiting the site in a browser where you are not logged in.
Zyxware is a leading drupal development company in India that has operations in the US, UK, Canada, Australia, and the Middle East. Get in touch with us if you are looking to build a career in Drupal.
References
https://www.drupal.org/docs/user_guide/en/extend-maintenance.html
https://drupal.stackexchange.com/questions/16/how-to-take-a-site-offline-using-drush