Skip to main content

Backing up and restoring GitHub Enterprise Server with GitHub Actions enabled

To restore a backup of tu instancia de 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 tu instancia de GitHub Enterprise Server to a new instance. For more information, see "Configuración de copias de seguridad en la instancia."

However, not all the data for GitHub Actions is included in these backups. Las GitHub Actions utilizan almacenamiento externo para almacenar artefactos de flujo de trabajo y bitácoras. Estos datos se almacenan en el proveedor externo, como Azure Blob Storage, Amazon S3, Google Cloud Storage, o MinIO. Como resultado, las copias de seguridad de GitHub Enterprise Server y sus configuraciones de disponibilidad GitHub Enterprise Server alta no proporcionan protección para los datos que se almacenan en este servicio externo y, en vez de esto, dependen de la protección de datos y replicación que proporciona el proveedor de almacenamiento externo, como Azure, Google Cloud o AWS.

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

To restore a backup of tu instancia de 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 "Acceder al 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.

    • Azure Blob Storage:

      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. Configura la conexión de almacenamiento externo con los comandos siguientes, reemplazando los valores de marcador de posición por los valores reales de la conexión.

    • Azure Blob Storage:

      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 forzar el direccionamiento con estilo de ruta de acceso para S3, especifica también el comando siguiente.

      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. Si deseas aplicar la configuración y permitir que GitHub Actions se conecte al proveedor de almacenamiento externo, escribe el comando siguiente.

    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 "Configuración de copias de seguridad en la instancia."

  9. Re-register your self-hosted runners on the destination instance. For more information, see "Agrega ejecutores 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 la configuración, ejecuta el siguiente comando.

      Nota: Durante la ejecución de una configuración, los servicios de tu instancia de GitHub Enterprise Server pueden reiniciarse, y esto puede provocar un breve tiempo de inactividad para los usuarios.

      Shell
      ghe-config-apply
      
    2. Espera que se complete la fase de configuración.