Back to the "Users API" | Back to the navigation
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#list-user-migrations
$api = $github->api('user')->migration();
$paginator = new Github\ResultPager($github);
$parameters = [];
$migrations = $paginator->fetchAll($api, 'list', $parameters);
do {
foreach ($migrations as $migration) {
// do something
}
$migrations = $paginator->fetchNext();
}
while($paginator->hasNext());
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#start-a-user-migration
$client->users()->migration()->start([
'repositories' => [
'KnpLabs/php-github-api'
],
'lock_repositories' => true,
'exclude_metadata' => false,
'exclude_git_data' => false,
'exclude_attachments' => true,
'exclude_releases' => false,
'exclude_owner_projects' => true,
'org_metadata_only' => false,
'exclude' => [
'Exclude attributes from the API response to improve performance'
]
]);
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#get-a-user-migration-status
$status = $client->user()->migration()->status(12, [
'exclude' => [
'exclude attributes'
]
]);
$client->user()->migration()->deleteArchive(12);
https://docs.github.com/en/rest/migrations/users?apiVersion=2022-11-28#unlock-a-user-repository
$client->user()->migration()->unlockRepo(12, 'php-github-api');
$repos = $client->user()->migration()->repos(2);