[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[],[],null,["# Set up for migration\n====================\n\nBefore you start the modernization process, you need to check whether your\napplication component is compatible for modernization and prepare your setup\nfor modernization.\n\nThis page describes how to prepare your source and local machines for\nmodernization.\n\nSet up the Linux source machine\n-------------------------------\n\n| **Note:** If you're going to migrate Windows IIS applications, you don't need to perform the steps to set up the Windows source machine for migration.\n\n- Install `rsync`:\n\n - On Debian:\n\n sudo apt install rsync\n\n - On Fedora:\n\n sudo dnf install rsync\n\n Ensure that `rsync` is available in the `PATH` setting.\n\nSet up the Linux local machine\n------------------------------\n\n- [Install Docker](https://docs.docker.com/engine/install) and\n ensure that it is available in the `PATH`.\n\n | **Note:** To avoid [issues that might occur while using Snap version of Docker](/migrate/containers/docs/troubleshooting/issues-with-m2c-cli#the_analyze_command_fails_when_using_the_snap_version_of_docker), ensure that you install Docker without using Snap.\n\n If the user running Migrate to Containers CLI is a non-root user, then\n [allow the non-root user to run containers](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).\n\n### Download or upgrade Migrate to Containers CLI\n\n- Download or upgrade the Migrate to Containers CLI on a Linux machine:\n\n curl -O \"https://m2c-cli-release.storage.googleapis.com/$(curl -s https://m2c-cli-release.storage.googleapis.com/latest)/linux/amd64/m2c\"\n chmod +x ./m2c\n\n This downloads the latest version of the Migrate to Containers CLI and\n Migrate to Containers plugins.\n\n### Check connectivity\n\nEnsure that you can access the source machine from the local machine using\neither direct SSH or the `gcloud compute ssh` command.\n| **Note:** The user used for SSH connection must be either a sudoer or root. If the user used to perform SSH can't act as root, then Migrate to Containers CLI might not be able to examine files and directories relevant to the modernization process.\n\n### Optional: Set up for offline migration\n\nIf you want to perform migration on your local network without pulling\nresources from the internet, then you can complete the following steps to\nprepare your local machine for offline migrations.\n\nAfter you've downloaded Migrate to Containers CLI, perform the\nfollowing steps:\n\n1. Download the offline Migrate to Containers CLI plugins bundle:\n\n curl -O https://storage.googleapis.com/modernize-plugins-prod/$(curl -s https://storage.googleapis.com/modernize-plugins-prod/latest)/m2c-offline-bundle-linux.tar\n\n2. If required, copy the Migrate to Containers CLI and offline Migrate to Containers CLI\n plugins bundle to the offline environment.\n\n3. Unpack the offline Migrate to Containers CLI plugins bundle:\n\n ./m2c plugins unpack -i m2c-offline-bundle-linux.tar\n\n To add support for offline data migration, specify a container registry\n that is available in your local network: \n\n ./m2c plugins unpack -i m2c-offline-bundle-linux.tar --registry \u003cvar translate=\"no\"\u003eHOSTNAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eHOSTNAME\u003c/var\u003e with the container registry hostname.\n\nYour local machine is set up for offline migration. To upgrade the offline\nMigrate to Containers CLI plugins bundle, [upgrade Migrate to Containers CLI](#download-cli-linux)\nto the latest version, and then repeat the steps to download and unpack the\nplugins bundle.\n\nIf you want to turn off the offline mode later, then you can use the\n`config set` command to set the `offline` option to `false`.\n\nSet up the Windows local machine\n--------------------------------\n\n- You must be able to run as administrator on the local machine.\n- [Install Docker](https://docs.docker.com/engine/install).\n\n### Download or upgrade Migrate to Containers CLI\n\nTo download or upgrade Migrate to Containers CLI on a Windows machine, perform the\nfollowing steps: \n\n### cmd\n\n1. Find the latest version of Migrate to Containers CLI:\n\n curl -s https://m2c-cli-release.storage.googleapis.com/latest\n\n2. Download the latest version of Migrate to Containers CLI:\n\n curl -O \"https://m2c-cli-release.storage.googleapis.com/\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e/windows/amd64/m2c.exe\"\n\n Replace \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e with the latest version of Migrate to Containers CLI.\n\n### PowerShell\n\n- Download the latest version of Migrate to Containers CLI:\n\n curl.exe -O https://m2c-cli-release.storage.googleapis.com/$(curl.exe -s https://m2c-cli-release.storage.googleapis.com/latest)/windows/amd64/m2c.exe\n\nThis downloads the latest version of the Migrate to Containers CLI and\nMigrate to Containers plugins.\n\nWhat's next\n-----------\n\n- Learn how to [copy the source machine's file system](/migrate/containers/docs/m2c-cli/copy-file-system)."]]