En este documento se describe cómo exportar los datos a Migration Center para realizar una evaluación online mediante la CLI del cliente de descubrimiento de Migration Center.
Antes de empezar
Sigue los pasos para descubrir recursos en tu infraestructura.
Para obtener los permisos que necesitas para exportar los datos recogidos a Migration Center,
pide a tu administrador que te conceda el
rol de gestión de identidades y accesos (IAM) de administrador de Migration Center (migrationcenter.admin)
en el proyecto.
Para obtener más información sobre cómo conceder roles, consulta el artículo Gestionar el acceso a proyectos, carpetas y organizaciones.
Este rol predefinido contiene los permisos necesarios para exportar los datos recogidos a Migration Center. Para ver los permisos exactos que se necesitan, despliega la sección Permisos necesarios:
Permisos obligatorios
Para exportar los datos recogidos a Migration Center, se necesitan los siguientes permisos:
Para exportar los datos recogidos a Migration Center, debe configurar la autenticación en Migration Center con uno de los siguientes métodos:
Usar una cuenta de servicio.
Usar una cuenta personal.
Te recomendamos que crees una cuenta de servicio desde Cloud Shell en la Google Cloud consola, que ya tiene instalada la CLI de Google Cloud.
Si quieres usar tu cuenta personal, debes instalar e inicializar la CLI de gcloud.
Configurar la autenticación con una cuenta de servicio
Sustituye PROJECT_ID por el nombre o el ID de tu proyecto.
Exportar los datos recogidos
Una vez que haya completado la configuración de la recogida de datos y la autenticación en Migration Center, podrá exportar los datos recogidos a Migration Center.
Para exportar los datos recogidos de tu estación de trabajo a Migration Center, ejecuta el siguiente comando:
Sustituye PROJECT_ID por el nombre de tu proyecto.
Si has configurado la autenticación en Migration Center mediante una clave de cuenta de servicio, debes proporcionar la ruta al archivo de clave JSON mediante la marca --json-key:
Sustituye PATH_TO_JSON_KEY por la ruta al archivo de clave JSON.
Si quieres esperar a que Migration Center termine de procesar los recursos y comprobar si todo se ha completado correctamente, puedes usar la marca --wait con el comando export.
Una vez completada la exportación, el cliente de detección imprime un enlace que puedes seguir para ver tus recursos en Migration Center.
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Es difícil de entender","hardToUnderstand","thumb-down"],["La información o el código de muestra no son correctos","incorrectInformationOrSampleCode","thumb-down"],["Me faltan las muestras o la información que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-11 (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)."]]