Skip to main content

Backing up and restoring GitHub Enterprise Server with GitHub Actions enabled

To restore a backup of votre instance 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 votre instance GitHub Enterprise Server to a new instance. For more information, see "Configuration des sauvegardes sur votre instance."

However, not all the data for GitHub Actions is included in these backups. GitHub Actions utilise un stockage externe pour stocker les artefacts et journaux de workflow. Ces données sont stockées chez votre fournisseur externe, par exemple Stockage Blob Azure, Amazon S3, Google Cloud Storage, ou MinIO. Les sauvegardes de GitHub Enterprise Server et les configurations à haute disponibilité de GitHub Enterprise Server n’offrent donc aucune protection pour les données stockées sur ce stockage externe. À la place, des services de protection et de réplication des données sont assurés par le fournisseur de stockage externe, par exemple Azure, Google Cloud, ou AWS.

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

To restore a backup of votre instance 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 "Accès à l’interpréteur de commandes d’administration (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.

    • Stockage Blob 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. Configurez la connexion au stockage externe en entrant les commandes suivantes, et en remplaçant les valeurs d’espace réservé par les valeurs réelles de votre connexion.

    • Stockage Blob 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"
      

      Le cas échéant, si vous souhaitez forcer l’adressage du style de chemin pour S3, entrez également la commande suivante.

      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. Pour appliquer la configuration et permettre à GitHub Actions de se connecter à votre fournisseur de stockage externe, entrez la commande suivante.

    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 "Configuration des sauvegardes sur votre instance."

  9. Re-register your self-hosted runners on the destination instance. For more information, see "Ajout d’exécuteurs auto-hébergés."

  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. Pour appliquer la configuration, exécutez la commande suivante.

      Remarque : Durant une exécution de configuration, les services sur votre instance GitHub Enterprise Server peuvent redémarrer, ce qui peut entraîner un bref temps d’arrêt pour les utilisateurs.

      Shell
      ghe-config-apply
      
    2. Attendez la fin de l’exécution de la configuration.