You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo"Restoring MySQL database from ${backup_snapshot_strategy} backup snapshot on an appliance configured for ${appliance_strategy} backups ..."
276
-
ghe-restore-mysql "$GHE_HOSTNAME"1>&3
306
+
if is_external_database_target_or_snapshot &&$SKIP_MYSQL;then
307
+
echo"Skipping MySQL restore."
308
+
else
309
+
echo"Restoring MySQL database from ${backup_snapshot_strategy} backup snapshot on an appliance configured for ${appliance_strategy} backups ..."
310
+
ghe-restore-mysql "$GHE_HOSTNAME"1>&3
311
+
fi
312
+
313
+
if ghe-ssh "$GHE_HOSTNAME" -- 'ghe-config --true app.actions.enabled';then
314
+
echo"Restoring MSSQL databases ..."
315
+
ghe-restore-mssql "$GHE_HOSTNAME"1>&3
316
+
317
+
echo"Restoring Actions data ..."
318
+
ghe-restore-actions "$GHE_HOSTNAME"1>&3
319
+
echo"* WARNING: Every self-hosted Actions runner that communicates with the restored GHES server must be restarted or reconfigured in order to continue functioning."
320
+
echo" See https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners for more details on how to reconfigure self-hosted Actions runners."
321
+
fi
277
322
278
323
commands=("
279
324
echo \"Restoring Redis database ...\"
@@ -405,8 +450,13 @@ else
405
450
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh 1>&3
406
451
fi
407
452
453
+
END_TIME=$(date +%s)
454
+
echo'End time:'$END_TIME
455
+
echo'Runtime:'$(($END_TIME-$START_TIME))'seconds'
456
+
408
457
echo"Restore of $GHE_HOSTNAME from snapshot $GHE_RESTORE_SNAPSHOT finished."
409
458
410
459
if!$instance_configured;then
411
460
echo"To complete the restore process, please visit https://$hostname/setup/settings to review and save the appliance configuration."
Copy file name to clipboardExpand all lines: docs/backup-snapshot-file-structure.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ most recent successful snapshot:
32
32
|- enterprise.ghl
33
33
|- es-scan-complete
34
34
|- manage-password
35
+
|- mssql
35
36
|- mysql.sql.gz
36
37
|- redis.rdb
37
38
|- settings.json
@@ -44,3 +45,20 @@ most recent successful snapshot:
44
45
45
46
Note: the `GHE_DATA_DIR` variable set in `backup.config` can be used to change
46
47
the disk location where snapshots are written.
48
+
49
+
## MS SQL Server backup structure
50
+
Actions service uses MS SQL Server as backend data store. Each snapshot includes a suite of backup files for MS SQL Server database(s).
51
+
52
+
To save time in backup, a three-level backup strategy is implemented. Based on the `GHE_MSSQL_BACKUP_CADENCE` setting, at each snapshot, either a (**F**)ull backup, a (**D**)ifferential or a (**T**)ransaction log backup is taken.
53
+
54
+
As a result, a suite always contains following for each database: a full backup, possibly a differential backup and at least one transaction log backup. Their relationship with timeline is demonstrated below:
To save disk space, at each snapshot, hard links are created to point to previous backup files. Only newly-created backup files are transferred from appliance to backup host. When a new full/differential backup is created, they become the new source for hard links and new base line for transaction log backups, for subsequent snapshots.
63
+
64
+
During restore, a suite of backup files are restored in the sequence of full -> differential -> chronological transaction log.
0 commit comments