Skip to main content

Backing up and restoring GitHub Enterprise Server with GitHub Actions enabled

To restore a backup of sua instância do GitHub Enterprise Server when GitHub Actions is enabled, you must configure GitHub Actions before restoring the backup with GitHub Enterprise Server Backup Utilities.

About backups of GitHub Enterprise Server when using GitHub Actions

You can use GitHub Enterprise Server Backup Utilities to back up and restore the data and configuration for sua instância do GitHub Enterprise Server to a new instance. For more information, see "Como configurar backups em sua instância."

However, not all the data for GitHub Actions is included in these backups. GitHub Actions usa armazenamento externo para armazenar artefatos e registros de fluxo de trabalho. Esses dados são armazenados no provedor externo, como o Armazenamento de Blobs do Azure, o Amazon S3, o Google Cloud Storage ou o MinIO. Como resultado, os backups do GitHub Enterprise Server e as configurações de alta disponibilidade do GitHub Enterprise Server não fornecem proteção para os dados armazenados nesse armazenamento externo. Eles dependem da proteção e replicação de dados fornecidas pelo provedor de armazenamento externo, como Azure, Google Cloud ou AWS.

Restoring a backup of GitHub Enterprise Server when GitHub Actions is enabled

To restore a backup of sua instância do GitHub Enterprise Server with GitHub Actions, you must manually configure network settings and external storage on the destination instance before you restore your backup from GitHub Enterprise Server Backup Utilities.

  1. Confirm that the source instance is offline.

  2. Manually configure network settings on the replacement GitHub Enterprise Server instance. Network settings are excluded from the backup snapshot, and are not overwritten by ghe-restore. For more information, see "Configuring network settings."

  3. SSH into the destination instance. For more information, see "Acesar o shell administrativo (SSH)."

    Shell
    ssh -p 122 admin@HOSTNAME
    
  4. Configure the destination instance to use the same external storage service for GitHub Actions as the source instance by entering one of the following commands.

    • Armazenamento de Blobs do Azure:

      Shell
      ghe-config secrets.actions.storage.blob-provider "azure"
      
    • Amazon S3:

      Shell
      ghe-config secrets.actions.storage.blob-provider "s3"
      
    • Google Cloud Storage:

      Shell
      ghe-config secrets.actions.storage.blob-provider "gcs"
      
  5. Configure a conexão de armazenamento externo inserindo os comandos a seguir e substituindo os valores de espaço reservado pelos valores reais da sua conexão.

    • Armazenamento de Blobs do Azure:

      Shell
      ghe-config secrets.actions.storage.azure.connection-string "CONNECTION STRING"
      
    • Amazon S3:

      Shell
      ghe-config secrets.actions.storage.s3.bucket-name "S3 BUCKET NAME"
      ghe-config secrets.actions.storage.s3.service-url "S3 SERVICE URL"
      ghe-config secrets.actions.storage.s3.access-key-id "S3 ACCESS KEY ID"
      ghe-config secrets.actions.storage.s3.access-secret "S3 ACCESS SECRET"
      

      Opcionalmente, para forçar o endereçamento no estilo de caminho para S3, insira também o comando a seguir.

      Shell
      ghe-config secrets.actions.storage.s3.force-path-style true
      
    • Google Cloud Storage:

      Shell
      ghe-config secrets.actions.storage.gcs.service-url "SERVICE URL"
      ghe-config secrets.actions.storage.gcs.bucket-name "BUCKET NAME"
      ghe-config secrets.actions.storage.gcs.access-key-id "HMAC ACCESS ID"
      ghe-config secrets.actions.storage.gcs.access-secret "HMAC SECRET"
      
  6. To prepare to enable GitHub Actions on the destination instance, enter the following command.

    Shell
    ghe-config app.actions.enabled true
    
  7. Para aplicar a configuração e habilitar GitHub Actions a fim de se conectar ao provedor de armazenamento externo, insira o comando a seguir.

    Shell
    ghe-config-apply
    
  8. After GitHub Actions is configured and enabled, to restore the rest of the data from the backup, use the ghe-restore command. For more information, see "Como configurar backups em sua instância."

  9. Re-register your self-hosted runners on the destination instance. For more information, see "Adicionar executores auto-hospedados."

  10. To ensure that the bundled actions that are pre-installed on your new instance are up to date, enter the following command.

    Shell
    ghe-config --unset 'app.actions.actions-repos-sha1sum'
    
    1. Para aplicar a configuração, execute o comando a seguir.

      Observação: durante uma execução de configuração, os serviços do sua instância do GitHub Enterprise Server podem ser reiniciados, o que pode causar um breve tempo de inatividade para os usuários.

      Shell
      ghe-config-apply
      
    2. Aguarde a conclusão da execução de suas configurações.