# Migrations

迁移类别中 GraphQL 架构类型的参考文档。

## abortQueuedMigrations - mutation

Clear all of a customer's queued migrations.

### Input fields for `abortQueuedMigrations`

* `input` (AbortQueuedMigrationsInput!): 

### Return fields for `abortQueuedMigrations`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `success` (Boolean): Did the operation succeed?.

## AbortQueuedMigrationsInput - input object

Autogenerated input type of AbortQueuedMigrations.

### Input fields for `AbortQueuedMigrationsInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `ownerId` (ID!): The ID of the organization that is running the migrations.

## abortRepositoryMigration - mutation

Abort a repository migration queued or in progress.

### Input fields for `abortRepositoryMigration`

* `input` (AbortRepositoryMigrationInput!): 

### Return fields for `abortRepositoryMigration`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `success` (Boolean): Did the operation succeed?.

## AbortRepositoryMigrationInput - input object

Autogenerated input type of AbortRepositoryMigration.

### Input fields for `AbortRepositoryMigrationInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `migrationId` (ID!): The ID of the migration to be aborted.

## createAttributionInvitation - mutation

Invites a user to claim reattributable data.

### Input fields for `createAttributionInvitation`

* `input` (CreateAttributionInvitationInput!): 

### Return fields for `createAttributionInvitation`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `owner` (Organization): The owner scoping the reattributable data.
* `source` (Claimable): The account owning the data to reattribute.
* `target` (Claimable): The account which may claim the data.

## CreateAttributionInvitationInput - input object

Autogenerated input type of CreateAttributionInvitation.

### Input fields for `CreateAttributionInvitationInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `ownerId` (ID!): The Node ID of the owner scoping the reattributable data.
* `sourceId` (ID!): The Node ID of the account owning the data to reattribute.
* `targetId` (ID!): The Node ID of the account which may claim the data.

## createMigrationSource - mutation

Creates a GitHub Enterprise Importer (GEI) migration source.

### Input fields for `createMigrationSource`

* `input` (CreateMigrationSourceInput!): 

### Return fields for `createMigrationSource`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `migrationSource` (MigrationSource): The created migration source.

## CreateMigrationSourceInput - input object

Autogenerated input type of CreateMigrationSource.

### Input fields for `CreateMigrationSourceInput`

* `accessToken` (String): The migration source access token.
* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `githubPat` (String): The GitHub personal access token of the user importing to the target repository.
* `name` (String!): The migration source name.
* `ownerId` (ID!): The ID of the organization that will own the migration source.
* `type` (MigrationSourceType!): The migration source type.
* `url` (String): The migration source URL, for example https://github.com or https://monalisa.ghe.com.

## grantMigratorRole - mutation

Grant the migrator role to a user or a team.

### Input fields for `grantMigratorRole`

* `input` (GrantMigratorRoleInput!): 

### Return fields for `grantMigratorRole`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `success` (Boolean): Did the operation succeed?.

## GrantMigratorRoleInput - input object

Autogenerated input type of GrantMigratorRole.

### Input fields for `GrantMigratorRoleInput`

* `actor` (String!): The user login or Team slug to grant the migrator role.
* `actorType` (ActorType!): Specifies the type of the actor, can be either USER or TEAM.
* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `organizationId` (ID!): The ID of the organization that the user/team belongs to.

## importProject - mutation

Creates a new project by importing columns and a list of issues/PRs.

> [!WARNING]
> **Deprecation notice:** Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. Removal on 2025-04-01 UTC.

### Input fields for `importProject`

* `input` (ImportProjectInput!): 

### Return fields for `importProject`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `project` (Project): The new Project!.

## ImportProjectInput - input object

Autogenerated input type of ImportProject.

### Input fields for `ImportProjectInput`

* `body` (String): The description of Project.
* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `columnImports` ([ProjectColumnImport!]!): A list of columns containing issues and pull requests.
* `name` (String!): The name of Project.
* `ownerName` (String!): The name of the Organization or User to create the Project under.
* `public` (Boolean): Whether the Project is public or not.

## Mannequin - object

A placeholder user for attribution of imported data on GitHub.

**Implements:** Actor, Node, UniformResourceLocatable

### Fields for `Mannequin`

* `avatarUrl` (URI!): A URL pointing to the GitHub App's public avatar.
  * `size` (Int): The size of the resulting square image.

* `claimant` (User): The user that has claimed the data attributed to this mannequin.
* `createdAt` (DateTime!): Identifies the date and time when the object was created.
* `databaseId` (Int): Identifies the primary key from the database.
* `email` (String): The mannequin's email on the source instance.
* `id` (ID!): The Node ID of the Mannequin object.
* `login` (String!): The username of the actor.
* `name` (String): The display name of the imported mannequin.
* `resourcePath` (URI!): The HTML path to this resource.
* `updatedAt` (DateTime!): Identifies the date and time when the object was last updated.
* `url` (URI!): The URL to this resource.

## MannequinConnection - object

A list of mannequins.

### Fields for `MannequinConnection`

* `edges` ([MannequinEdge]): A list of edges.
* `nodes` ([Mannequin]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## MannequinEdge - object

Represents a mannequin.

### Fields for `MannequinEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (Mannequin): The item at the end of the edge.

## MannequinOrder - input object

Ordering options for mannequins.

### Input fields for `MannequinOrder`

* `direction` (OrderDirection!): The ordering direction.
* `field` (MannequinOrderField!): The field to order mannequins by.

## MannequinOrderField - enum

Properties by which mannequins can be ordered.

### Values for `MannequinOrderField`

* `CREATED_AT`: Order mannequins why when they were created.
* `LOGIN`: Order mannequins alphabetically by their source login.

## Migration - interface

Represents a GitHub Enterprise Importer (GEI) migration.

### Fields for `Migration`

* `continueOnError` (Boolean!): The migration flag to continue on error.
* `createdAt` (DateTime!): Identifies the date and time when the object was created.
* `databaseId` (String): Identifies the primary key from the database.
* `failureReason` (String): The reason the migration failed.
* `id` (ID!): The Node ID of the Migration object.
* `migrationLogUrl` (URI): The URL for the migration log (expires 1 day after migration completes).
* `migrationSource` (MigrationSource!): The migration source.
* `repositoryName` (String!): The target repository name.
* `sourceUrl` (URI!): The migration source URL, for example https://github.com or https://monalisa.ghe.com.
* `state` (MigrationState!): The migration state.
* `warningsCount` (Int!): The number of warnings encountered for this migration. To review the warnings,
check the Migration Log.

### Implemented by

* RepositoryMigration

## MigrationSource - object

A GitHub Enterprise Importer (GEI) migration source.

**Implements:** Node

### Fields for `MigrationSource`

* `id` (ID!): The Node ID of the MigrationSource object.
* `name` (String!): The migration source name.
* `type` (MigrationSourceType!): The migration source type.
* `url` (URI!): The migration source URL, for example https://github.com or https://monalisa.ghe.com.

## MigrationSourceType - enum

Represents the different GitHub Enterprise Importer (GEI) migration sources.

### Values for `MigrationSourceType`

* `AZURE_DEVOPS`: An Azure DevOps migration source.
* `BITBUCKET_SERVER`: A Bitbucket Server migration source.
* `GITHUB_ARCHIVE`: A GitHub Migration API source.

## MigrationState - enum

The GitHub Enterprise Importer (GEI) migration state.

### Values for `MigrationState`

* `FAILED`: The migration has failed.
* `FAILED_VALIDATION`: The migration has invalid credentials.
* `IN_PROGRESS`: The migration is in progress.
* `NOT_STARTED`: The migration has not started.
* `PENDING_VALIDATION`: The migration needs to have its credentials validated.
* `QUEUED`: The migration has been queued.
* `SUCCEEDED`: The migration has succeeded.

## OrganizationMigration - object

A GitHub Enterprise Importer (GEI) organization migration.

**Implements:** Node

### Fields for `OrganizationMigration`

* `createdAt` (DateTime!): Identifies the date and time when the object was created.
* `databaseId` (String): Identifies the primary key from the database.
* `failureReason` (String): The reason the organization migration failed.
* `id` (ID!): The Node ID of the OrganizationMigration object.
* `remainingRepositoriesCount` (Int): The remaining amount of repos to be migrated.
* `sourceOrgName` (String!): The name of the source organization to be migrated.
* `sourceOrgUrl` (URI!): The URL of the source organization to migrate.
* `state` (OrganizationMigrationState!): The migration state.
* `targetOrgName` (String!): The name of the target organization.
* `totalRepositoriesCount` (Int): The total amount of repositories to be migrated.

## OrganizationMigrationState - enum

The Octoshift Organization migration state.

### Values for `OrganizationMigrationState`

* `FAILED`: The Octoshift migration has failed.
* `FAILED_VALIDATION`: The Octoshift migration has invalid credentials.
* `IN_PROGRESS`: The Octoshift migration is in progress.
* `NOT_STARTED`: The Octoshift migration has not started.
* `PENDING_VALIDATION`: The Octoshift migration needs to have its credentials validated.
* `POST_REPO_MIGRATION`: The Octoshift migration is performing post repository migrations.
* `PRE_REPO_MIGRATION`: The Octoshift migration is performing pre repository migrations.
* `QUEUED`: The Octoshift migration has been queued.
* `REPO_MIGRATION`: The Octoshift org migration is performing repository migrations.
* `SUCCEEDED`: The Octoshift migration has succeeded.

## RepositoryMigration - object

A GitHub Enterprise Importer (GEI) repository migration.

**Implements:** Migration, Node

### Fields for `RepositoryMigration`

* `continueOnError` (Boolean!): The migration flag to continue on error.
* `createdAt` (DateTime!): Identifies the date and time when the object was created.
* `databaseId` (String): Identifies the primary key from the database.
* `failureReason` (String): The reason the migration failed.
* `id` (ID!): The Node ID of the RepositoryMigration object.
* `migrationLogUrl` (URI): The URL for the migration log (expires 1 day after migration completes).
* `migrationSource` (MigrationSource!): The migration source.
* `repositoryName` (String!): The target repository name.
* `sourceUrl` (URI!): The migration source URL, for example https://github.com or https://monalisa.ghe.com.
* `state` (MigrationState!): The migration state.
* `warningsCount` (Int!): The number of warnings encountered for this migration. To review the warnings,
check the Migration Log.

## RepositoryMigrationConnection - object

A list of migrations.

### Fields for `RepositoryMigrationConnection`

* `edges` ([RepositoryMigrationEdge]): A list of edges.
* `nodes` ([RepositoryMigration]): A list of nodes.
* `pageInfo` (PageInfo!): Information to aid in pagination.
* `totalCount` (Int!): Identifies the total count of items in the connection.

## RepositoryMigrationEdge - object

Represents a repository migration.

### Fields for `RepositoryMigrationEdge`

* `cursor` (String!): A cursor for use in pagination.
* `node` (RepositoryMigration): The item at the end of the edge.

## RepositoryMigrationOrder - input object

Ordering options for repository migrations.

### Input fields for `RepositoryMigrationOrder`

* `direction` (RepositoryMigrationOrderDirection!): The ordering direction.
* `field` (RepositoryMigrationOrderField!): The field to order repository migrations by.

## RepositoryMigrationOrderDirection - enum

Possible directions in which to order a list of repository migrations when provided an orderBy argument.

### Values for `RepositoryMigrationOrderDirection`

* `ASC`: Specifies an ascending order for a given orderBy argument.
* `DESC`: Specifies a descending order for a given orderBy argument.

## RepositoryMigrationOrderField - enum

Properties by which repository migrations can be ordered.

### Values for `RepositoryMigrationOrderField`

* `CREATED_AT`: Order mannequins why when they were created.

## revokeMigratorRole - mutation

Revoke the migrator role from a user or a team.

### Input fields for `revokeMigratorRole`

* `input` (RevokeMigratorRoleInput!): 

### Return fields for `revokeMigratorRole`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `success` (Boolean): Did the operation succeed?.

## RevokeMigratorRoleInput - input object

Autogenerated input type of RevokeMigratorRole.

### Input fields for `RevokeMigratorRoleInput`

* `actor` (String!): The user login or Team slug to revoke the migrator role from.
* `actorType` (ActorType!): Specifies the type of the actor, can be either USER or TEAM.
* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `organizationId` (ID!): The ID of the organization that the user/team belongs to.

## startOrganizationMigration - mutation

Starts a GitHub Enterprise Importer organization migration.

### Input fields for `startOrganizationMigration`

* `input` (StartOrganizationMigrationInput!): 

### Return fields for `startOrganizationMigration`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `orgMigration` (OrganizationMigration): The new organization migration.

## StartOrganizationMigrationInput - input object

Autogenerated input type of StartOrganizationMigration.

### Input fields for `StartOrganizationMigrationInput`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `sourceAccessToken` (String!): The migration source access token.
* `sourceOrgUrl` (URI!): The URL of the organization to migrate.
* `targetEnterpriseId` (ID!): The ID of the enterprise the target organization belongs to.
* `targetOrgName` (String!): The name of the target organization.

## startRepositoryMigration - mutation

Starts a GitHub Enterprise Importer (GEI) repository migration.

### Input fields for `startRepositoryMigration`

* `input` (StartRepositoryMigrationInput!): 

### Return fields for `startRepositoryMigration`

* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `repositoryMigration` (RepositoryMigration): The new repository migration.

## StartRepositoryMigrationInput - input object

Autogenerated input type of StartRepositoryMigration.

### Input fields for `StartRepositoryMigrationInput`

* `accessToken` (String): The migration source access token.
* `clientMutationId` (String): A unique identifier for the client performing the mutation.
* `continueOnError` (Boolean): Whether to continue the migration on error. Defaults to true.
* `gitArchiveUrl` (String): The signed URL to access the user-uploaded git archive.
* `githubPat` (String): The GitHub personal access token of the user importing to the target repository.
* `lockSource` (Boolean): Whether to lock the source repository.
* `metadataArchiveUrl` (String): The signed URL to access the user-uploaded metadata archive.
* `ownerId` (ID!): The ID of the organization that will own the imported repository.
* `repositoryName` (String!): The name of the imported repository.
* `skipReleases` (Boolean): Whether to skip migrating releases for the repository.
* `sourceId` (ID!): The ID of the migration source.
* `sourceRepositoryUrl` (URI!): The URL of the source repository.
* `targetRepoVisibility` (String): The visibility of the imported repository.