Cloud Storage Compute Engine Google Cloud

6 Ways to Transfer Files in Google Cloud Platform

6 Ways to Transfer Files in Google Cloud Platform. In this guide you are going to learn different steps to transfer files in Google Cloud.

Prequisites

Install and Setup Google Cloud SDK.

Table of Contents

  1. Google Cloud Storage to Google Compute Engine.
  2. Google Compute Engine to Google Cloud Storage.
  3. Google Cloud Storage to the local computer.
  4. Local computer to Google Cloud Storage.
  5. Upload/Download using Google Cloud Shell.
  6. Transfer files using FileZilla.
PlatformRAMSSDCost
Alibaba Cloud512 MB20 GB$2.50/mo
Cloudways – Managed Cloud1 GB25 GB$10/mo
Kinsta – Google Cloud Managed WP1 Website10 GB$30/mo

Set up Google Cloud SDK

Once you have installed Google Cloud SDK you can use the gsutil or gcloud command to transfer the files using gsutil cp command.

Open terminal in your local computer and configure the project you wish to use. Run the following command to set up gcloud

gcloud init

Google Cloud Storage to Google Compute Engine

To copy a file from Google Cloud Storage to your VM Instance use the following command.

You can run this command either by the local terminal or from VM Instance SSH.

gsutil cp gs://bucket_name/filename /home/username/folder_name

This command syncs the file from Cloud Storage to your VM Instance.

Google Compute Engine to Google Cloud Storage

To copy a file from your VM Instance to Cloud Storage, SSH your VM Instance and navigate to the directory where the file is and execute the following command.

gsutil cp filename gs://bucket_name

This command syncs the file from your Instance to your Storage Bucket.

Google Cloud Storage to the local computer

Open terminal in your local computer and navigate to the folder where you need the file to be copied and run this command.

gsutil -m cp -r gs://bucket_name/folder dir

This will cause everything nested under gs://bucket_name/folder to be downloaded into dir, resulting in files with names like dir/data/a/b/c

Local computer to Google Cloud Storage

Open a terminal in your local computer and navigate to the folder where the file is and run this command.

gsutil -m cp -r dir gs://bucket_name/folder

This will cause everything nested under dir to be downloaded into gs://bucket_name/folder

Upload/Download using SSH

To download or upload a file using SSH click the SSH button next to your VM Instance to open a terminal in your web browser.

Download using SSH

Click the top right gear icon in your terminal window to upload or download a file directly. This method will be very slow compared to the above all process.

Download

From one instance to another

You can also transfer files from one instance to another instance using the gcloud command.

gcloud compute scp FILE_NAME --project TARGET_PROJECT_ID TARGET_INSTANCE_NAME:folder_name --zone region

Transfer files using FileZilla

You can setup SFTP to fransfer files using FileZilla.

These are the different methods to transfer files in Google Cloud Platform.

2 Comments

  1. THESE WAYS ARE MEANT FOR COMPUTER MAJORS, NOT FOR PEOPLE WHO USE THE COMPUTER FOR COMMON PURPOSES..ENTERTAINMENT, NEWS, PHOTOS, DOCUMENTS TO SAVE. IS THERE A SIMPLE WAY FOR NON-TECHNICAL PEOPLE TO UPLOAD DOCUMENTS?

Write A Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.