# Granting the migrator role

The migrator role gives a user or team the ability to run migrations on behalf of an organization.

To allow someone other than an organization owner to run a migration or download migration logs, you can grant the migrator role to a user or team.

To grant the migrator role using the CLI, you can use the ADO2GH extension of the GitHub CLI.

1. Instale los GitHub CLI.
   * A fin de obtener instrucciones de instalación para GitHub CLI, vea el [repositorio de GitHub CLI](https://github.com/cli/cli#installation).
   * Si ya tiene GitHub CLI instalado, ejecute `gh --version` para asegurarse de que está ejecutando la versión 2.4.0 o posterior. Si tiene una versión anterior, visite el [GitHub CLI repositorio](https://github.com/cli/cli#installation) para obtener instrucciones de actualización.
1. Instale los ADO2GH extension.

   ```shell copy
   gh extension install github/gh-ado2gh
   ```

1. ADO2GH extension of the GitHub CLI se actualiza semanalmente. Para asegurarte de que usas la versión más reciente, actualiza la extensión.

    ```shell copy
    gh extension upgrade github/gh-ado2gh
    ```

1. On GitHub, create and record a personal access token that has the `admin:org` scope.
1. Establece personal access token como una variable de entorno, y reemplaza TOKEN en los comandos siguientes por el valor personal access token que has registrado antes.

   * Si usas Terminal, utiliza el comando `export`.

      ```shell copy
      export GH_PAT="TOKEN"
      ```

   * Si usas PowerShell, utiliza el comando `$env`.

      ```shell copy
      $env:GH_PAT="TOKEN"
      ```
1. Use the `gh ado2gh grant-migrator-role` command, replacing ORGANIZATION with the organization you want to grant the migrator role for, ACTOR with the user or team name, and TYPE with `USER` or `TEAM`.

   ```shell copy
   gh ado2gh grant-migrator-role --github-org ORGANIZATION --actor ACTOR --actor-type TYPE
   ```

   >[!NOTE] Si va a conceder el rol de migración para GHE.com, también debe incluir la dirección URL de la API de destino para el subdominio de la empresa. Por ejemplo: `--target-api-url https://api.octocorp.ghe.com`.