Swapping a Replica to a new Primary in GitHub Enterprise

Hi friends,

I’ve just finished setting up a new instance of our GitHub Enterprise primary in our development environment, after syncing a recent snapshot from production. Now I am ready set up the replica for the instance in dev. Since we already had a replica instance running, pointing at the old instance, I’m wondering if it would be simpler to point the existing replica the new primary. Or if it’s preferable to start fresh with a new replica.

I see in the Documentation that there is a command ghe-repl-teardown that can be used to reset the state, but the doc is rather vague about what the command does specifically. I’m wondering if it resets the instance to one of the steps listed in the Creating an HA Replica docs, and if so, which step? Or if it renders the instance unusable.

Could it be as simple as running the following commands?

ghe-repl-stop
ghe-repl-teardown
ghe-repl-setup PRIMARY IP

Or am I better off not attempting to take a shortcut, and simply set up a new replica from scratch?

1 Like