About maintenance mode
Some types of operations require that you take your GitHub Enterprise Server instance offline and put it into maintenance mode:
- Upgrading to a new version of GitHub Enterprise Server
- Increasing CPU, memory, or storage resources allocated to the virtual machine
- Migrating data from one virtual machine to another
- Restoring data from a GitHub Enterprise Server Backup Utilities snapshot
- Troubleshooting certain types of critical application issues
We recommend that you schedule a maintenance window for at least 30 minutes in the future to give users time to prepare. When a maintenance window is scheduled, all users will see a banner when accessing the site.
When the instance is in maintenance mode, all normal HTTP and Git access is refused. This includes web and API requests, for which the appliance responds with status code 503
(Service Unavailable). Git fetch, clone, and push operations are also rejected with an error message indicating that the site is temporarily unavailable. In high availability configurations, Git replication will be paused. GitHub Actions jobs will not be executed. Visiting the site in a browser results in a maintenance page.
You can perform initial validation of your maintenance operation by configuring an IP exception list to allow access to your GitHub Enterprise Server instance from only the IP addresses and ranges provided. Attempts to access your GitHub Enterprise Server instance from IP addresses not specified on the IP exception list will receive a response consistent with those sent when the instance is in maintenance mode.
Enabling maintenance mode immediately or scheduling a maintenance window for a later time
-
From an administrative account on GitHub Enterprise Server, in the upper-right corner of any page, click .
-
If you're not already on the "Site admin" page, in the upper-left corner, click Site admin.
-
In the " Site admin" sidebar, click Management Console.
-
In the top navigation bar, click Maintenance.
-
Under "Enable and schedule", decide whether to enable maintenance mode immediately or to schedule a maintenance window for a future time.
- To enable maintenance mode immediately, select the dropdown menu and click now.
- To schedule a maintenance window for a future time, select the dropdown menu and click a start time.
-
When you're satisfied with the timing of the window, select the checkbox next to "Enable maintenance mode". If you selected "now", your instance will be put into maintenance mode immediately.
Validating changes in maintenance mode using the IP exception list
The IP exception list provides controlled and restricted access to your GitHub Enterprise Server instance, which is ideal for initial validation of server health following a maintenance operation. Once enabled, your GitHub Enterprise Server instance will be taken out of maintenance mode and available only to the configured IP addresses. The maintenance mode checkbox will be updated to reflect the change in state.
If you re-enable maintenance mode, the IP exception list will be disabled and your GitHub Enterprise Server instance will return to maintenance mode. If you just disable the IP exception list, your GitHub Enterprise Server instance will return to normal operation.
You can also use a command-line utility to configure the IP exception list. For more information, see "Command-line utilities" and "Accessing the administrative shell (SSH)."
-
From an administrative account on GitHub Enterprise Server, in the upper-right corner of any page, click .
-
If you're not already on the "Site admin" page, in the upper-left corner, click Site admin.
-
In the " Site admin" sidebar, click Management Console.
-
In the top navigation bar, click Maintenance, then confirm maintenance mode is already enabled.
-
Under "Enable and configure IP exception list", select Enable IP exception list.
-
To the right of the checkbox for enabling the list, type a valid list of space-separated IP addresses or CIDR blocks that should be allowed to access your GitHub Enterprise Server instance.
-
Click Save.
Scheduling maintenance mode with the GitHub Enterprise Server APIs
You can schedule maintenance for different times or dates with the GitHub Enterprise Server APIs. For more information, see "REST API endpoints for Management Console."