A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/migrate/containers/docs/m2c-cli/copy-file-system below:

Copy the source machine's file system | Migrate to Containers

Stay organized with collections Save and categorize content based on your preferences.

Copy the source machine's file system

Modernization of an application component requires creating a copy of the source machine's file system.

This page describes the steps required to copy the source machine's file system along with some specifications for reducing the size of the copied file system.

Create a local copy of the Linux source machine file system

The Migrate to Containers CLI supports access to source machines using either direct SSH connection or by using gcloud.

Note: The user that you use to access the source machine must be a sudoer to be able to access all files and directories relevant to modernization. If sudo is disabled for all users including root, use the root user and use the flag --remote-sudo=false. Direct SSH

To copy using direct SSH access, run the following command:

./m2c copy ssh [USERNAME@]HOSTNAME \
  -i PATH_TO_PRIVATE_KEY \
  -o OUTPUT_FILESYSTEM_DIR

Replace the following:

gcloud

If the source machine has a public IP, run the following command:

./m2c copy gcloud \
  -p PROJECT_ID \
  -z ZONE \
  -n VM_NAME \
  -o OUTPUT_FILESYSTEM_DIR

Replace the following:

If the source machine doesn't have a public IP, you can do one of the following:

For more information about these flags, see the gcloud documentation.

After the copy is complete, a copy of the source machine's file system is available in the specified output directory.

Reduce the size of the copied file system

Depending on the source machine, the copied file system might be very large. The larger the copy, the longer it takes for each operation to complete and, if there's not enough space, the copy operation fails.

The Migrate to Containers CLI applies filters to reduce the size of the copy, but with the given knowledge of the application component, you can modify the filters to further reduce the size of the copy.

When you run the copy command again with the modified filters, the contents of the output directory are updated according to the changes you applied in the filter file.

To modify the default filters, follow these steps:

  1. Get a list of the default filters:

    ./m2c copy default-filters > filters.txt
    
  2. Edit the file filters.txt to remove irrelevant directories. The file uses the rsync filter rule format, as specified in the rsync documentation page.

  3. Use the --filters flag to specify the filter file with the copy command.

    Direct SSH
    ./m2c copy ssh [USERNAME@]HOSTNAME \
      -i PATH_TO_PRIVATE_KEY \
      -o OUTPUT_FILESYSTEM_DIR \
      --filters filters.txt
    
    gcloud
    ./m2c copy gcloud \
      -p PROJECT_ID \
      -z ZONE \
      -n VM_NAME \
      -o OUTPUT_FILESYSTEM_DIR \
      --filters filters.txt
    
Create a local copy of the Windows source machine file system

For Windows source machines, you need to copy the disk images in VHD or VHDX format for the migration process. However, Migrate to Containers CLI does not support exporting disk images from your source platform to your local machine.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4