Skip to content

Commit 7810430

Browse files
jianghao0718subatoiam-steadjc-clark
authored
Public documentation update for backup service as it is GA in 3.20 (#59106)
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com> Co-authored-by: Anne-Marie <102995847+am-stead@users.noreply.github.com> Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com>
1 parent 1a93632 commit 7810430

File tree

6 files changed

+151
-30
lines changed

6 files changed

+151
-30
lines changed

content/admin/backing-up-and-restoring-your-instance/backup-service-for-github-enterprise-server/about-the-backup-service-for-github-enterprise-server.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ topics:
1212
- Infrastructure
1313
---
1414

15+
{% ifversion ghes < 3.20 %}
1516
>[!NOTE] {% data variables.product.prodname_enterprise_backup_service %} is currently in {% data variables.release-phases.public_preview %} and subject to change. The service is available at no additional cost and will remain free.
17+
{% endif %}
1618

1719
## About the {% data variables.product.prodname_enterprise_backup_service %}
1820

@@ -29,7 +31,9 @@ Compared to the legacy backup utilities, the {% data variables.product.prodname_
2931
* Doesn’t require a separate host for backup software.
3032
* Stores backups on a dedicated storage volume directly accessible by your instance.
3133

34+
{% ifversion ghes < 3.20 %}
3235
>[!NOTE] {% data variables.product.prodname_enterprise_backup_service %} is currently only supported on standalone instances and high availability primary nodes. Cluster configurations and replica nodes are not yet supported.
36+
{% endif %}
3337

3438
## How does the backup service differ from a High Availability replica?
3539

@@ -47,8 +51,7 @@ The backup service is a disaster recovery solution. It captures full, timestampe
4751

4852
## Further reading
4953

50-
* [AUTOTITLE](/admin/backing-up-and-restoring-your-instance/configuring-backups-on-your-instance)
51-
* [About {% data variables.product.prodname_enterprise_backup_utilities %}](https://github.com/github/backup-utils#readme)
52-
* [AUTOTITLE](/admin/configuration/configuring-your-enterprise/accessing-the-administrative-shell-ssh)
53-
* [AUTOTITLE](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)
54-
* [AUTOTITLE](/admin/github-actions/advanced-configuration-and-troubleshooting/backing-up-and-restoring-github-enterprise-server-with-github-actions-enabled)
54+
* [AUTOTITLE](/admin/backing-up-and-restoring-your-instance/backup-service-for-github-enterprise-server/understanding-the-backup-service)
55+
* [AUTOTITLE](/admin/backing-up-and-restoring-your-instance/backup-service-for-github-enterprise-server/configuring-the-backup-service)
56+
* [AUTOTITLE](/admin/backing-up-and-restoring-your-instance/backup-service-for-github-enterprise-server/restoring-from-a-backup)
57+
* [AUTOTITLE](/admin/backing-up-and-restoring-your-instance/backup-service-for-github-enterprise-server/restoring-with-github-actions-enabled)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Backup from replica in high availability
3+
shortTitle: Backup from replica
4+
intro: 'Enable backup from a high availability replica node.'
5+
versions:
6+
ghes: '> 3.19'
7+
type: how_to
8+
topics:
9+
- Backups
10+
---
11+
12+
## Configuring backups from a replica node
13+
14+
For high availability, you can designate a replica node as your backup server. To minimize latency, {% data variables.product.github %} recommends picking a replica node in the same region or datacenter as your primary node.
15+
16+
> [!IMPORTANT]
17+
> Backups from cache replica nodes or active geo replica nodes are not supported.
18+
19+
To configure your backup server, run the following commands, replacing `HOSTNAME` with the hostname of the node:
20+
21+
```shell
22+
ghe-config cluster.HOSTNAME.backup-server true
23+
24+
ghe-config-apply
25+
```
26+
27+
You can now run `ghe-backup` directly on your replica node.
28+
29+
> [!WARNING]
30+
> Due to the latency between primary and replica nodes, you may lose data when backing up from a replica node.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Backup in clustering mode
3+
shortTitle: Backup in clustering
4+
intro: 'Enable backup from a node in cluster.'
5+
versions:
6+
ghes: '> 3.19'
7+
type: how_to
8+
topics:
9+
- Backups
10+
---
11+
12+
## Configuring backups from a cluster node
13+
14+
For clustering, you can designate a node as your backup server. To minimize latency, {% data variables.product.github %} recommends picking a data node (for example, a `mysql-server` node or a `git-server` node) instead of a frontend node.
15+
16+
> [!IMPORTANT]
17+
> Only one node can be specified as a `backup-server` node.
18+
19+
1. To configure your backup server, set up a backup disk on one of the cluster nodes of your choice. See [AUTOTITLE](/admin/backing-up-and-restoring-your-instance/backup-service-for-github-enterprise-server/configuring-the-backup-service).
20+
21+
1. After `ghe-storage-init-backup` is executed, the `backup-server` role will be set on this cluster node. You can now run `ghe-backup` directly on this node, or use the management console to schedule backups.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Configuring remote archives for backups
3+
shortTitle: Configure remote archives
4+
intro: 'Enable a remote archive for backups through SSH.'
5+
versions:
6+
ghes: '> 3.19'
7+
type: how_to
8+
topics:
9+
- Backups
10+
---
11+
12+
If you are running {% data variables.product.prodname_ghe_server %} on a cloud platform or virtualization platform that supports disk snapshots, we recommend that you use snapshots to archive your backup disk, and recreate a new backup disk for testing, restoring, or disaster recovery purposes. However, if your infrastructure does not support disk snapshots or similar solutions, you can setup a {% data variables.product.prodname_ghe_server %} backup archive on a remote {% data variables.product.prodname_ghe_server %} appliance for data replication and restoration purposes.
13+
14+
## Set up a remote archive destination
15+
16+
Remote archives are required to be saved on a backup disk of a {% data variables.product.prodname_ghe_server %} appliance, which is used as a staging or testing {% data variables.product.prodname_ghe_server %} appliance. Follow these steps to configure remote backup archives.
17+
18+
1. Set up a backup disk on a remote {% data variables.product.prodname_ghe_server %} appliance. See [AUTOTITLE](/admin/backing-up-and-restoring-your-instance/backup-service-for-github-enterprise-server/configuring-the-backup-service).
19+
1. From the production appliance, run the following command to initiate configuration and display the SSH public key that needs to be added to the remote {% data variables.product.prodname_ghe_server %} appliance:
20+
21+
```bash
22+
ghe-backup-remote-add <hostname-or-ip-of-remote-appliance>
23+
```
24+
25+
This command will print a public SSH key that you need to add to the remote {% data variables.product.prodname_ghe_server %} environment through the management console.
26+
1. After the SSH key has been added to the remote {% data variables.product.prodname_ghe_server %} appliance, run the same command again to complete the configuration:
27+
28+
```bash
29+
ghe-backup-remote-add <hostname-or-ip-of-remote-appliance>
30+
```
31+
32+
It will display "Done: Configured remote backup archive destination host to <hostname-or-ip-of-remote-appliance>." A {% data variables.product.prodname_ghe_server %} configuration `ghe-config backup.remote-archive-destination-host` will be set.
33+
1. After that, any successful invocation of `ghe-backup` will sync the latest backup to this remote archive destination in the background, displaying a message like "Uploading backup data to remote host <hostname-or-ip-of-remote-appliance> in background...".
34+
35+
### Manually sync a snapshot
36+
37+
To push the current snapshot immediately without taking a new backup, you can manually run: `/usr/local/share/github-backup/ghe-backup-remote-archive`.
38+
39+
### Limitations
40+
41+
{% data variables.product.prodname_ghe_server %} remote backup archives are archived via SSH and are limited by your network and I/O. We recommend using disk snapshots whenever your infrastructure allows, instead of remote archives.

content/admin/backing-up-and-restoring-your-instance/backup-service-for-github-enterprise-server/configuring-the-backup-service.md

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,35 @@ If you're using a dedicated block device as your backup target, you need to init
8787
From {% data variables.product.prodname_ghe_server %} 3.17.4 onward, the script is installed in PATH so you can run it directly using: `ghe-storage-init-backup /dev/YOUR_DEVICE_NAME`.
8888
{% endif %}
8989
90+
91+
#### Detach a backup disk
92+
93+
> [!WARNING]
94+
> Before detaching a backup disk, ensure that no backups or restores are currently in progress. Detaching a disk while it is in use can result in data loss or service interruption.
95+
96+
In case you need to detach backup disk from {% data variables.product.prodname_ghe_server %}, please use following steps
97+
98+
1. List block devices and unmount `/data/backup`.
99+
100+
```bash
101+
sudo lsblk
102+
sudo umount /data/backup
103+
```
104+
105+
1. List logical volumes and deactivate logical volume.
106+
107+
```bash
108+
sudo lvs
109+
sudo lvchange -an <backup_VG>/<backup_LV>
110+
```
111+
112+
1. Detach disk using console or CLI provided by cloud provider or hypervisor.
113+
1. Remove mount point.
114+
115+
```bash
116+
sudo rmdir /data/backup
117+
```
118+
90119
#### Reusing a previously initialized disk
91120
92121
If the device was already initialized using `ghe-storage-init-backup`, you can reuse it without reformatting:
@@ -110,7 +139,7 @@ If the device was already initialized using `ghe-storage-init-backup`, you can r
110139
111140
### Configuring backup settings
112141
113-
After the backup target is mounted, the Backup Service page will become available in the {% data variables.enterprise.management_console %}. {% ifversion ghes > 3.19 %} If your instance is part of a clustered environment, the system will automatically detect the node that was initialized with `ghe-storage-init-backup` and treat it as the backup server. {% endif %}
142+
After the backup target is mounted, the Backup Service page will become available in the {% data variables.enterprise.management_console %} in the "Backup" section. {% ifversion ghes > 3.19 %} If your instance is part of a clustered environment, the system will automatically detect the node that was initialized with `ghe-storage-init-backup` and treat it as the backup server. {% endif %}
114143
115144
>[!NOTE] The settings page won’t appear until the backup storage is mounted at `/data/backup` by completing the initialization or mount steps above.
116145
@@ -125,36 +154,30 @@ If you're migrating from {% data variables.product.prodname_enterprise_backup_ut
125154

126155
Use the `--dry-run` flag to preview changes without applying them.
127156

128-
#### Scheduling automated backups
129-
130-
Once the service is configured, you can define a backup schedule.
131-
132-
1. In the {% data variables.enterprise.management_console %}, open the "Backups" tab from the top menu.
133-
1. In the "Backup Schedule" section, choose a predefined schedule (e.g., Daily) or enter a custom cron expression.
134-
1. Click **Save** to apply the changes.
135-
136-
The first run will be a full backup. Future runs will be incremental. If a new backup attempt starts while a previous one is still running, it may be skipped or fail. In that case, adjust the schedule to avoid overlap.
137-
138157
{% ifversion ghes > 3.19 %}
158+
#### Take a backup
139159

140-
### Configuring backups from a replica node
160+
Once the service is configured, you can take a backup manually using the following steps:
141161

142-
For high availability, you can designate a replica node as your backup server. To minimize latency, {% data variables.product.github %} recommends picking a replica node in the same region or datacenter as your primary node.
143-
144-
> [!IMPORTANT]
145-
> Backups from cache replica nodes or active geo replica nodes are not supported.
146-
147-
To configure your backup server, run the following commands, replacing `HOSTNAME` with the hostname of the node:
162+
1. In the {% data variables.enterprise.management_console %}, open the "Backups" tab from the top menu.
163+
1. Click **Backup Now**.
148164

149-
```shell
150-
ghe-config cluster.HOSTNAME.backup-server true
165+
A {% data variables.product.prodname_ghe_server %} backup will be taken, and displayed in a list.
151166

152-
ghe-config-apply
153-
```
167+
{% endif %}
154168

155-
You can now run `ghe-backup` directly on your replica node.
169+
#### Scheduling automated backups
156170

157-
> [!WARNING]
158-
> Due to the latency between primary and replica nodes, you may lose data when backing up from a replica node.
171+
Once the service is configured, you can define a backup schedule.
159172

173+
{% ifversion ghes > 3.19 %}
174+
1. In the {% data variables.enterprise.management_console %}, open the "Settings" tab from the top menu.
175+
1. In the "Backup" section, choose a predefined schedule (e.g., Daily) or enter a custom cron expression.
176+
1. Click **Save settings** to apply the changes.
177+
{% else %}
178+
1. In the {% data variables.enterprise.management_console %}, open the "Backups" tab from the top menu.
179+
1. In the "Backup Schedule" section, choose a predefined schedule (e.g., Daily) or enter a custom cron expression.
180+
1. Click **Save** to apply the changes.
160181
{% endif %}
182+
183+
The first run will be a full backup. Future runs will be incremental. If a new backup attempt starts while a previous one is still running, it may be skipped or fail. In that case, adjust the schedule to avoid overlap.

content/admin/backing-up-and-restoring-your-instance/backup-service-for-github-enterprise-server/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ children:
1212
- /configuring-the-backup-service
1313
- /creating-and-monitoring-backups
1414
- /restoring-from-a-backup
15+
- /configuring-remote-archives-for-backups
16+
- /backup-from-replica-in-high-availability
17+
- /backup-in-clustering-mode
1518
- /restoring-with-github-actions-enabled
1619
- /backup-service-settings-reference
1720
- /understanding-the-snapshot-file-structure

0 commit comments

Comments
 (0)