Skip to content

Commit 2a85d41

Browse files
authored
Merge branch 'master' into samirat/add_backup_cadence_to_appliance
2 parents db857c0 + c443bd8 commit 2a85d41

File tree

6 files changed

+31
-4
lines changed

6 files changed

+31
-4
lines changed

backup.config-example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ GHE_NUM_SNAPSHOTS=10
6060
# - Differential backup every day (1440 minutes)
6161
# - Transactionlog backup every 15 minutes
6262
#
63-
GHE_MSSQL_BACKUP_CADENCE=10080,1440,15
63+
#GHE_MSSQL_BACKUP_CADENCE=10080,1440,15
6464

6565
# If set to 'yes', ghe-backup jobs will run in parallel. Defaults to 'no'.
6666
#

docs/usage.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,15 @@ are *not* restored to prevent overwriting manual configuration on the restore
9090
host. This behavior can be overridden by passing the `-c` argument to `ghe-restore`,
9191
forcing settings, certificate, and license data to be overwritten with the backup copy's data.
9292

93+
## Backup and restore with GitHub Actions enabled
94+
95+
GitHub Actions data on your external storage provider is not included in regular GitHub Enterprise Server
96+
backups, and must be backed up separately. When restoring a GitHub Enterprise Server backup with
97+
GitHub Actions enabled, the following steps are required:
98+
99+
1. Enable GitHub Actions on the replacement appliance and configure it to use the same GitHub Actions
100+
external storage configuration as the original appliance.
101+
2. Use `ghe-restore` to restore the backup.
102+
3. Re-register your self-hosted runners on the replacement appliance.
103+
93104
[1]: https://github.com/github/backup-utils/blob/master/docs/getting-started.md

share/github-backup-utils/ghe-backup-actions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ghe_verbose "* Transferring Actions files from $host ..."
4242
ghe-rsync -avz \
4343
-e "ghe-ssh -p $port" \
4444
--rsync-path='sudo -u actions rsync' \
45-
--exclude "mutexes" --exclude "dumps" \
45+
--exclude "mutexes" --exclude "dumps" --exclude "tmp" \
4646
$link_dest \
4747
"$host:$GHE_REMOTE_DATA_USER_DIR/actions/" \
4848
"$GHE_SNAPSHOT_DIR/actions" 1>&3

share/github-backup-utils/ghe-backup-config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ export GHE_SNAPSHOT_DIR
243243
# Base path for temporary directories and files.
244244
: ${TMPDIR:="/tmp"}
245245

246+
# Backup cadence for MS SQL. Determines the kind of backup taken, either full, differential,
247+
# or transaction log, based on when the last backup of that kind was taken. This defaults to
248+
# taking a full backup once a week, a differential backup once a day, and transaction logs every
249+
# 15 minutes.
250+
: ${GHE_MSSQL_BACKUP_CADENCE:=10080,1440,15}
251+
246252
###############################################################################
247253
### Dynamic remote version config
248254

share/github-backup-utils/ghe-backup-mssql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ ensure_same_dbs() {
8181

8282
if [[ "${#locals[@]}" -ne 0 ]]; then
8383
ghe_verbose "Warning: Found following ${#locals[@]} backup files that can't be traced back to the specified GHES host."
84-
ghe_verbose "Warning: Did you recently reconfigure the GHES host? Consider deleting these backup files if no longer needed."
84+
ghe_verbose "Warning: Did you recently reconfigure the GHES host? Move or delete these backup files if no longer needed."
8585
for local in "${locals[@]}"; do
86-
ghe_verbose "$local"
86+
ghe_verbose "$1/$local"
8787
done
8888

8989
exit 1

test/test-ghe-backup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,16 @@ begin_test "ghe-backup missing directories or files on source appliance"
352352
)
353353
end_test
354354

355+
begin_test "ghe-backup has default cadence configured"
356+
(
357+
set -e
358+
enable_actions
359+
360+
[ -n "$GHE_MSSQL_BACKUP_CADENCE" ]
361+
)
362+
end_test
363+
364+
# Override backup cadence for testing purposes
355365
GHE_MSSQL_BACKUP_CADENCE=10,5,1
356366
export GHE_MSSQL_BACKUP_CADENCE
357367
setup_actions_test_data $GHE_REMOTE_DATA_USER_DIR

0 commit comments

Comments
 (0)