Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Une fois que vous avez collecté les données sur vos composants, vous pouvez les exporter vers le centre de migration, où vous pouvez effectuer les opérations suivantes :
Ce document explique comment exporter les données vers le centre de migration pour une évaluation en ligne à l'aide de la CLI du client de découverte du centre de migration.
Avant de commencer
Suivez la procédure pour découvrir les composants de votre infrastructure.
Pour obtenir les autorisations nécessaires pour exporter les données collectées vers Migration Center, demandez à votre administrateur de vous accorder le rôle IAM Administrateur Migration Center (migrationcenter.admin) sur le projet.
Pour en savoir plus sur l'attribution de rôles, consultez la page Gérer l'accès aux projets, aux dossiers et aux organisations.
Ce rôle prédéfini contient les autorisations requises pour exporter les données collectées vers Migration Center. Pour connaître les autorisations exactes requises, développez la section Autorisations requises :
Autorisations requises
Les autorisations suivantes sont requises pour exporter les données collectées vers le centre de migration :
Configurer l'authentification auprès de Migration Center
Pour exporter les données collectées vers Migration Center, vous devez configurer l'authentification auprès de Migration Center à l'aide de l'une des méthodes suivantes :
Utiliser un compte de service
Vous utilisez un compte personnel.
Nous vous recommandons de créer un compte de service à partir de Cloud Shell dans la console Google Cloud , qui est déjà installé avec Google Cloud CLI.
Si vous souhaitez utiliser votre compte personnel, vous devez installer et initialiser gcloud CLI.
Configurer l'authentification à l'aide d'un compte de service
Remplacez PROJECT_ID par le nom ou l'ID de votre projet.
Exporter les données collectées
Une fois la collecte de données et la configuration de l'authentification dans Migration Center terminées, vous pouvez exporter les données collectées vers Migration Center.
Pour exporter les données collectées depuis votre poste de travail vers Migration Center, exécutez la commande suivante :
Si vous avez configuré l'authentification auprès de Migration Center à l'aide d'une clé de compte de service, vous devez fournir le chemin d'accès au fichier de clé JSON à l'aide de l'indicateur --json-key :
Remplacez PATH_TO_JSON_KEY par le chemin d'accès au fichier de clé JSON.
Si vous souhaitez attendre que le centre de migration ait fini de traiter les composants et vérifier que toutes les tâches ont été effectuées correctement, utilisez l'option --wait avec la commande export.
Une fois l'exportation terminée, le client de découverte affiche un lien que vous pouvez suivre pour afficher vos composants dans Migration Center.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Export data to Migration Center\n\nAfter you've collected the data about your assets, you can then export it to\nMigration Center where you can do the following:\n\n- [View the collected assets in one place](/migration-center/docs/view-assets)\n- [View and understand insights that Migration Center generates about your infrastructure](/migration-center/docs/view-and-understand-insights)\n- [Create groups of assets](/migration-center/docs/create-groups)\n- [Generate total cost of ownership (TCO) reports](/migration-center/docs/generate-tco-report) for your infrastructure\n\nThis document describes how to export the data to Migration Center for\nan online assessment by using the Migration Center discovery client CLI.\n\nBefore you begin\n----------------\n\n1. Complete the steps to discover assets in your infrastructure.\n2. From the Google Cloud console, [activate Migration Center](/migration-center/docs/get-started-with-migration-center#activate-migration-center).\n3. Enable the Cloud Resource Manager API.\n\n [Enable the API](https://console.cloud.google.com/apis/library/cloudresourcemanager.googleapis.com)\n\n### Review required roles and permissions\n\n\nTo get the permissions that\nyou need to export the collected data to Migration Center,\n\nask your administrator to grant you the\n\n\nMigration Center Admin (`migrationcenter.admin`)\nIAM role on the project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains\n\nthe permissions required to export the collected data to Migration Center. To see the exact permissions that are\nrequired, expand the **Required permissions** section:\n\n\n#### Required permissions\n\nThe following permissions are required to export the collected data to Migration Center:\n\n- ` resourcemanager.projects.get `\n- ` migrationcenter.sources.create `\n- ` migrationcenter.sources.get `\n- ` migrationcenter.assets.reportFrames`\n\n\nYou might also be able to get\nthese permissions\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\n### Set up authentication to Migration Center\n\nTo export the collected data to Migration Center, you need to\nset up authentication to Migration Center with one of the following\nmethods:\n\n- Using a service account.\n- Using a personal account.\n\nWe recommend you to create a service account from the Cloud Shell\nin the Google Cloud console, which has the Google Cloud CLI already installed.\nAlternatively, if you want to use your personal account, then you need to\n[install and initialize the gcloud CLI](/sdk/docs/install).\n\n#### Set up authentication using a service account\n\n| **Note:** Service account keys are a security risk if not managed correctly. You should [choose a more secure alternative to service account keys](/docs/authentication#auth-decision-tree) whenever possible. If you must authenticate with a service account key, you are responsible for the security of the private key and for other operations described by [Best practices for managing service account keys](/iam/docs/best-practices-for-managing-service-account-keys). If you are prevented from creating a service account key, service account key creation might be disabled for your organization. For more information, see [Managing secure-by-default organization resources](/resource-manager/docs/secure-by-default-organizations).\n|\n|\n| If you acquired the service account key from an external source, you must validate it before use.\n| For more information, see [Security requirements for externally sourced credentials](/docs/authentication/external/externally-sourced-credentials).\n\n1. If you have the\n [required permissions](/iam/docs/service-accounts-create#permissions), then\n [create a service account](/iam/docs/service-accounts-create#creating):\n\n gcloud iam service-accounts create \u003cvar translate=\"no\"\u003eSA_NAME\u003c/var\u003e \\\n --description='\u003cvar translate=\"no\"\u003eSA_DESCRIPTION\u003c/var\u003e' \\\n --display-name='\u003cvar translate=\"no\"\u003eSA_DISPLAY_NAME\u003c/var\u003e'\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eSA_NAME\u003c/var\u003e: the name you want for the service account\n - \u003cvar translate=\"no\"\u003eSA_DESCRIPTION\u003c/var\u003e: an optional description for the service account\n - \u003cvar translate=\"no\"\u003eSA_DISPLAY_NAME\u003c/var\u003e: the display name for the service account\n2. To grant the service account the required permissions, assign\n the [`migrationcenter.admin` role](/migration-center/docs/roles-and-permissions#migrationcenter.admin):\n\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --member='serviceAccount:\u003cvar translate=\"no\"\u003eSA_NAME\u003c/var\u003e@\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e.iam.gserviceaccount.com' \\\n --role='roles/migrationcenter.admin'\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the name of your project.\n3. [Create a service account key](/iam/docs/keys-create-delete#creating):\n\n gcloud iam service-accounts keys create ~/sa-private-key.json \\\n --iam-account=\u003cvar translate=\"no\"\u003eSA_NAME\u003c/var\u003e@\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e.iam.gserviceaccount.com \\\n --billing-project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n\n The key is saved in the specified path: `~/sa-private-key.json`.\n | **Note:** It is recommended that you set an [expiration date](/iam/docs/best-practices-for-managing-service-account-keys#key-expiry) for the service account key. If you don't set an expiration date for the service account key, the generated key has no expiration date and you must delete it manually. For more information, see the [best practices for managing service account keys](/iam/docs/best-practices-for-managing-service-account-keys).\n4. Copy the key file to the machine where you want to run the\n `mcdc` CLI.\n\n#### Set up authentication using a personal account\n\n- Provide your user credentials to [Application Default Credentials (ADC)](/docs/authentication/application-default-credentials):\n\n gcloud --project \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e auth application-default login\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the name or ID of your project.\n\nExport the collected data\n-------------------------\n\nAfter the data collection and authentication setup to Migration Center\nis complete, you can proceed to exporting the collected data to\nMigration Center.\n\n- To export the collected data from your workstation to Migration Center,\n run the following command:\n\n\n ### Linux\n\n \u003cbr /\u003e\n\n ```\n ./mcdc export mc --project PROJECT_ID\n ```\n\n \u003cbr /\u003e\n\n ### Windows\n\n \u003cbr /\u003e\n\n ```\n mcdc.exe export mc --project PROJECT_ID\n ```\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the name of your project.\n- If you've set up authentication to Migration Center using a service\n account key, then you need to provide the path to the JSON key file using\n the `--json-key` flag:\n\n\n ### Linux\n\n \u003cbr /\u003e\n\n ```\n ./mcdc export mc --project PROJECT_ID --json-key PATH_TO_JSON_KEY\n ```\n\n \u003cbr /\u003e\n\n ### Windows\n\n \u003cbr /\u003e\n\n ```\n mcdc.exe export mc --project PROJECT_ID --json-key PATH_TO_JSON_KEY\n ```\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n Replace \u003cvar translate=\"no\"\u003ePATH_TO_JSON_KEY\u003c/var\u003e with the path to the JSON key file.\n\n Optionally, if you want to wait for Migration Center to finish\n processing the assets, and check whether all the work is done successfully,\n then use the `--wait` flag with the `export` command.\n\nAfter the export is complete, the discovery client prints a link that you can\nfollow to see your assets in Migration Center.\n\nWhat's next\n-----------\n\n- Learn how to [manage the `mcdc` CLI](/migration-center/docs/manage-collector-cli).\n- Learn how to [view the collected assets in Migration Center](/migration-center/docs/view-assets)."]]