{"id":2724,"date":"2018-08-14T19:10:41","date_gmt":"2018-08-15T00:10:41","guid":{"rendered":"http:\/\/osric.com\/chris\/accidental-developer\/?p=2724"},"modified":"2018-08-14T19:10:41","modified_gmt":"2018-08-15T00:10:41","slug":"migrating-to-a-new-github-enterprise-host","status":"publish","type":"post","link":"https:\/\/osric.com\/chris\/accidental-developer\/2018\/08\/migrating-to-a-new-github-enterprise-host\/","title":{"rendered":"Migrating to a new GitHub Enterprise host"},"content":{"rendered":"<p>I&#8217;m moving my VMWare infrastructure from old hardware to new hardware. One of the last guest VMs I&#8217;ve waited to move is my GitHub Enterprise (GHE) host. My plan to migrate the system was simple: <\/p>\n<ol>\n<li>Create a new, empty GitHub Enterprise VM on the new VMWare infrastructure<\/li>\n<li>Put the old GHE system in maintenance mode<\/li>\n<li>Take a backup of the old GHE system<\/li>\n<li>Shut down the old GHE system<\/li>\n<li>Start the new GitHub Enterprise VM and select the Migrate option<\/li>\n<li>Restore the backup to the new GHE system using the ghe-restore tool<\/li>\n<\/ol>\n<p>The <a href=\"https:\/\/help.github.com\/enterprise\/2.14\/admin\/guides\/installation\/\">installation instructions<\/a> provided by GitHub are pretty good. To deploy a new GitHub Enterprise image I followed <a href=\"https:\/\/help.github.com\/enterprise\/2.14\/admin\/guides\/installation\/installing-github-enterprise-on-vmware\/\">Installing GitHub Enterprise on VMWare<\/a>.<\/p>\n<p>Of course, no process is perfect. Here are a couple minor points that may save you some time:<\/p>\n<p><!--more--><\/p>\n<p>When I started the new GitHub Enterprise VM and connected to the console. Once I configured networking, the console provided the next step:<\/p>\n<pre><code>Visit http:\/\/192.168.0.123\/setup to configure GitHub Enterprise.<\/code><\/pre>\n<p>However, that didn&#8217;t work. It directed me to a blank page at http:\/\/192.168.0.123\/ssl_warning.html.<\/p>\n<p>The answer? Specify <strong>https<\/strong> instead, e.g.:<\/p>\n<pre><code>Visit https:\/\/192.168.0.123\/setup to configure GitHub Enterprise.<\/code><\/pre>\n<p>I added the appropriate SSH key from a system where I had the GHE backup and restore tools installed, and then selected the <em>Migration<\/em> option. It prompted me to run <code>ghe-restore<\/code>:<\/p>\n<pre><code>$ .\/ghe-restore 192.168.0.123\r\nChecking for leaked keys in the backup snapshot that is being restored ...\r\n* No leaked keys found\r\nNo ECDSA host key is known for [192.168.0.123]:122 and you have requested strict checking.\r\nHost key verification failed.\r\nError: ssh connection with '192.168.0.123:122' failed\r\nNote that your SSH key needs to be setup on 192.168.0.123:122 as described in:\r\n* https:\/\/enterprise.github.com\/help\/articles\/adding-an-ssh-key-for-shell-access<\/code><\/pre>\n<p>At first I thought I could just add the key to my known_hosts file:<\/p>\n<pre><code>$ ssh-keyscan -t ecdsa 192.168.0.123<\/code><\/pre>\n<p>But <code>ssh-keyscan<\/code> exited with an error code and returned no output.<\/p>\n<p>Eventually I decided to disable <code>StrictHostKeyChecking<\/code> in my <code>.ssh\/config<\/code> file for the target IP address:<\/p>\n<pre><code>Host 192.168.0.123\r\n\tStrictHostKeyChecking no<\/code><\/pre>\n<p>(Just remember to remove that entry when done! <code>StrictHostKeyChecking<\/code> is an important security control.)<\/p>\n<p>I should also note that the <em>Running migrations<\/em> step took forever. I often wondered if it was still working. The first three steps were almost instant, but <em>Running migrations<\/em> goes on for hours:<\/p>\n<ol>\n<li>Preparing storage device &#x2714;<\/li>\n<li>Updating configuration &#x2714;<\/li>\n<li>Reloading system services &#x2714;<\/li>\n<li>Running migrations<\/li>\n<li>Reloading application services<\/li>\n<\/ol>\n<p>I tried visiting the regular (i.e. non-admin interface) and it gave me the following message:<\/p>\n<pre><code>Migrating...\r\nPlease be patient, this may take a long time. Please do not reboot or shutdown the appliance until this has completed.  \r\nPerforming hookshot database migrations.<\/code><\/pre>\n<p>How long is a long time? What is a hookshot database migration? Who knows, be patient.<\/p>\n<p>The console shows these messages over and over and over:<\/p>\n<pre><code>19:59:04 elasticsearch: Starting Elasticsearch...\r\n19:59:04 elasticsearch: Started Elasticsearch.\r\n19:59:12 elasticsearch: elasticsearch.service: main process exited, code=exited, status=1\/FAILURE\r\n19:59:12 elasticsearch: Unit elasticsearch.service entered failed state\r\n19:59:12 elasticsearch.service holdoff time over4, scheduling restart.\r\n19:59:12 cloud-config: Cannot add dependency job for unit could-config.service, ignoring: Unit cloud\r\n19:59:12 elasticsearch: Stopping Elasticsearch...<\/code><\/pre>\n<p>The reason was that I missed an important step. With the upgrade from 2.13 to 2.14, you need to upgrade the Elasticsearch indices (see <a href=\"https:\/\/help.github.com\/enterprise\/2.14\/admin\/guides\/installation\/migrating-elasticsearch-indices-to-github-enterprise-2-14-or-later\/\">Migrating Elasticsearch indices to GitHub Enterprise 2.14 or later<\/a>).<\/p>\n<p>I started from the beginning again, adding the above Elasticsearch migration step just after putting GHE into maintenance mode. Everything else proceeded smoothly, and in a much more reasonable amount of time.<\/p>\n<p>It would have been nice if the GitHub Enterprise migration software had been able to identify and notify me of this problem instead of going into an infinite loop. An infinite loop that occurs simultaneously with a <em>Please be patient, this may take a long time<\/em> message. I hope that by including my misstep here, I might save someone else a few minutes &#8212; or hours &#8212; of frustration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The instructions to migrate your GitHub Enterprise instance to a new host are straightforward and largely correct. I decided to upgrade from GitHub Enterprise 2.13 to 2.14 at the same time as migrating to a new host. There were a few points I cover here that caused me trouble during the upgrade and migration process (not least of which was my failure to read all of the instructions).<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[497],"tags":[515,482],"class_list":["post-2724","post","type-post","status-publish","format-standard","hentry","category-git","tag-ghe","tag-github"],"_links":{"self":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/comments?post=2724"}],"version-history":[{"count":8,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2724\/revisions"}],"predecessor-version":[{"id":2739,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2724\/revisions\/2739"}],"wp:attachment":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/media?parent=2724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/categories?post=2724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/tags?post=2724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}