Skip to content

Use old rsync restore method for pages prior to 2.13 #426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bin/ghe-restore
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,17 @@ if $CLUSTER || [ "$(version $GHE_REMOTE_VERSION)" -ge "$(version 2.13.0)" ]; the

echo "Restoring Gists ..."
ghe-restore-repositories-gist "$GHE_HOSTNAME"

echo "Restoring GitHub Pages ..."
ghe-restore-pages "$GHE_HOSTNAME" 1>&3
else
echo "Restoring Git repositories and Gists ..."
ghe-restore-repositories-rsync "$GHE_HOSTNAME" 1>&3

echo "Restoring GitHub Pages ..."
ghe-restore-pages-rsync "$GHE_HOSTNAME" 1>&3
fi

echo "Restoring GitHub Pages ..."
ghe-restore-pages "$GHE_HOSTNAME" 1>&3

echo "Restoring SSH authorized keys ..."
ghe-ssh "$GHE_HOSTNAME" -- 'ghe-import-authorized-keys' < "$GHE_RESTORE_SNAPSHOT_PATH/authorized-keys.json" 1>&3
Expand Down
21 changes: 21 additions & 0 deletions share/github-backup-utils/ghe-restore-pages-rsync
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
#/ Usage: ghe-restore-pages-rsync <host>
#/ Restore an rsync snapshot of all Pages data to a GitHub instance.
#/
#/ Note: This script typically isn't called directly. It's invoked by the
#/ ghe-restore command when the rsync strategy is used.
set -e

# Bring in the backup configuration
# shellcheck source=share/github-backup-utils/ghe-backup-config
. "$( dirname "${BASH_SOURCE[0]}" )/ghe-backup-config"

# Show usage and bail with no arguments
[ -z "$*" ] && print_usage

bm_start "$(basename $0)"

# Restore all pages data via rsync
ghe-restore-userdata pages "$1"

bm_end "$(basename $0)"