We recommend storing your repository data on a separate block device to make backups and future expansions easier. If you have a significant amount of repository data on an external block device, you may find it more efficient to migrate the entire block device to a new installation instead of copying the data between devices.
For more information on adding a block device, see our instructions for VMware or VirtualBox.
If you don't have copies of the latest GitHub Enterprise virtual appliance (OVA file), GitHub Enterprise software package (GHP file), and license (GHL file), download them now.
Enable maintenance mode on your existing GitHub Enterprise installation.
-
Run ghe-export-mysql on your existing installation to back up MySQL data. This includes user accounts, commit comments, pull requests, and issues.
ssh admin@old-ghe-hostname -- 'ghe-export-mysql' | gzip > ghe-mysql-backup.sql.gz
-
Run ghe-export-redis to back up Redis data. This includes a variety of cached data counts and other settings required by the application.
ssh admin@old-ghe-hostname -- 'ghe-export-redis' > ghe-redis-backup.rdb
-
Run ghe-export-pages to back up generated GitHub Pages sites.
ssh admin@old-ghe-hostname -- 'ghe-export-pages' > ghe-pages-backup.tar
Back up or take a snapshot of your block device.
Shut down your existing installation and detach the block device from it.
Import the latest OVA (which you downloaded earlier) on your hypervisor as a new VM.
Attach your block device to the hardware on which the VM is provisioned.
Boot your new VM.
Open
http://[new-ghe-hostname]/setup
in your browser and upload your license and GHP file.Open
http://[new-ghe-hostname]/setup/settings
in your browser.Without saving your settings, upload a public SSH key.
-
Run ghe-import-mysql to restore MySQL data onto your new GitHub Enterprise installation.
gzip -dc ghe-mysql-backup.sql.gz | ssh admin@new-ghe-hostname -- 'ghe-import-mysql'
-
Run ghe-import-redis to restore Redis data onto your new GitHub Enterprise installation.
ssh admin@new-ghe-hostname -- 'ghe-import-redis' < ghe-redis-backup.rdb
-
Run ghe-import-pages to restore generated GitHub Pages sites.
ssh admin@new-ghe-hostname -- 'ghe-import-pages' < ghe-pages-backup.tar
Open
http://[new-ghe-hostname]/setup/settings
in your browser.Under Repository storage, verify that the Block device option appears with the label "recommended." If the option appears with the label "no device detected," you will need to add the new block device (see our instructions for VMware or VirtualBox).
Select the Block device option and choose your block device from the dropdown menu that appears.
Configure any other necessary settings.
Finally, click Save settings at the bottom of the page.