Google Cloud Cloud Storage Compute Engine

6 Ways to Transfer Files in Google Cloud Platform

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we recommended.

Pinterest LinkedIn Tumblr

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.

To use the gsutil command you need a little knowledge about how to use the terminal/command line/ssh.

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

Another method is below.

gcloud compute copy-files instance_name:remote_location local_dir --zone=region

Transfer files using FileZilla

You can setup SFTP to fransfer files using FileZilla.

Get your Professional Google Cloud Architect certificate with this easy to learn course now.

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

3 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.