Bird
Raised Fist0
GCPcloud~10 mins

Storage transfer service in GCP - Step-by-Step Execution

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Process Flow - Storage transfer service
Define Transfer Job
Set Source and Destination
Configure Schedule and Options
Start Transfer Job
Service Copies Data
Monitor Transfer Status
Transfer Complete or Error
The flow shows how you create a transfer job, set source and destination, start it, and monitor until completion.
Execution Sample
GCP
gcloud transfer jobs create \
  --source-bucket=source-bucket-name \
  --sink-bucket=destination-bucket-name \
  --schedule-start-date=2024-06-01 \
  --schedule-end-date=2024-06-01 \
  --description="Daily backup"
This command creates a transfer job to copy data from one bucket to another on a specific date.
Process Table
StepActionInput/ConfigService BehaviorResult
1Define Transfer JobJob name, descriptionRegisters job in serviceJob created with ID
2Set Source and DestinationSource: source-bucket-name Destination: destination-bucket-nameValidates buckets existBuckets linked to job
3Configure ScheduleStart date: 2024-06-01 End date: 2024-06-01Schedules job for that dayJob scheduled
4Start Transfer JobTrigger job startService begins copying dataTransfer in progress
5Monitor Transfer StatusCheck job statusReports progress, errorsStatus: Running or Completed
6Transfer CompleteJob finishes copyingMarks job as doneData copied successfully
7ExitNo more scheduled runsJob endsTransfer job completed
💡 Transfer job completes after copying all data on scheduled date.
Status Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 6Final
Job IDNoneJob123Job123Job123Job123Job123
Source BucketNonesource-bucket-namesource-bucket-namesource-bucket-namesource-bucket-namesource-bucket-name
Destination BucketNonedestination-bucket-namedestination-bucket-namedestination-bucket-namedestination-bucket-namedestination-bucket-name
ScheduleNoneNone2024-06-01 to 2024-06-012024-06-01 to 2024-06-012024-06-01 to 2024-06-012024-06-01 to 2024-06-01
StatusNonePendingPendingRunningCompletedCompleted
Key Moments - 3 Insights
Why does the transfer job have a status of 'Pending' before it starts copying data?
Because after setting the schedule, the job waits for the scheduled time to start. This is shown in execution_table row 3 where the job is scheduled but not yet running.
What happens if the source or destination bucket does not exist when creating the job?
The service validates buckets at step 2 and will not create the job if buckets are invalid. This prevents errors during transfer.
How do you know when the transfer job is fully complete?
At step 6 in the execution_table, the status changes to 'Completed' indicating all data has been copied and the job is done.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the job status after step 4?
APending
BCompleted
CRunning
DFailed
💡 Hint
Check the 'Status' variable in variable_tracker after Step 4.
At which step does the service start copying data?
AStep 3
BStep 4
CStep 2
DStep 6
💡 Hint
Look at the 'Service Behavior' column in execution_table for when copying begins.
If the schedule end date is before the start date, what would happen?
AJob creation fails or no runs scheduled
BJob runs once on start date
CJob runs multiple times
DJob runs indefinitely
💡 Hint
Consider the scheduling logic in execution_table step 3 and how invalid dates affect scheduling.
Concept Snapshot
Storage Transfer Service lets you copy data between buckets or from other sources.
You create a transfer job, set source and destination buckets, and schedule when to run.
The service copies data on schedule and reports status.
You monitor progress and know when transfer completes.
It helps automate data movement safely and reliably.
Full Transcript
Storage Transfer Service in Google Cloud helps move data from one storage location to another automatically. First, you create a transfer job by defining its name and description. Then, you specify the source bucket where data currently lives and the destination bucket where data should go. Next, you set a schedule for when the transfer should happen, such as a specific date or recurring times. When the scheduled time arrives, the service starts copying data from source to destination. You can check the job status anytime to see if it is running, completed, or if there were errors. Once all data is copied, the job marks itself complete. This process helps keep data backed up or moved without manual copying. The execution table shows each step from job creation to completion, and the variable tracker shows how job status and settings change over time. Common confusions include understanding the 'Pending' status before start, bucket validation, and knowing when the job is done. The visual quiz tests understanding of these steps and statuses. Overall, Storage Transfer Service automates and simplifies data transfers in the cloud.

Practice

(1/5)
1. What is the primary purpose of the Google Cloud Storage Transfer Service?
easy
A. To move or copy data between different storage locations automatically
B. To create backups of virtual machines
C. To monitor network traffic between cloud services
D. To manage user permissions in Google Cloud

Solution

  1. Step 1: Understand the service function

    Storage Transfer Service is designed to move or copy data between storage locations like on-premises, AWS S3, or Google Cloud Storage.
  2. Step 2: Eliminate unrelated options

    Options B, C, and D describe different services unrelated to data transfer.
  3. Final Answer:

    To move or copy data between different storage locations automatically -> Option A
  4. Quick Check:

    Storage Transfer Service = Data movement [OK]
Hint: Remember: Transfer Service moves or copies data [OK]
Common Mistakes:
  • Confusing transfer service with backup or monitoring tools
  • Thinking it manages user permissions
  • Assuming it only works within Google Cloud
2. Which of the following is the correct way to specify a source in a Storage Transfer Service job configuration?
easy
A. "source": {"network": {"subnet": "default"}}
B. "source": {"vmInstance": {"name": "instance-1"}}
C. "source": {"gcsDataSource": {"bucketName": "my-source-bucket"}}
D. "source": {"sqlDatabase": {"dbName": "mydb"}}

Solution

  1. Step 1: Identify valid source types

    Storage Transfer Service supports sources like Google Cloud Storage buckets, AWS S3 buckets, or on-premises data.
  2. Step 2: Match correct JSON syntax for GCS source

    The correct syntax uses "gcsDataSource" with a "bucketName" field, as shown in "source": {"gcsDataSource": {"bucketName": "my-source-bucket"}}.
  3. Final Answer:

    "source": {"gcsDataSource": {"bucketName": "my-source-bucket"}} -> Option C
  4. Quick Check:

    Source config for GCS = "source": {"gcsDataSource": {"bucketName": "my-source-bucket"}} [OK]
Hint: Look for "gcsDataSource" with bucketName for GCS source [OK]
Common Mistakes:
  • Using unsupported source types like VM or SQL database
  • Incorrect JSON structure for source
  • Confusing source with destination fields
3. Given this Storage Transfer Service schedule configuration snippet:
{"schedule": {"scheduleStartDate": {"year": 2024, "month": 6, "day": 10}, "startTimeOfDay": {"hours": 3, "minutes": 0}}}

When will the transfer job start?
medium
A. At 3:00 AM on June 10, 2024
B. At 3:00 PM on June 10, 2024
C. At midnight on June 10, 2024
D. At 3:00 AM on June 9, 2024

Solution

  1. Step 1: Read the scheduleStartDate and startTimeOfDay

    The date is June 10, 2024, and the time is 3 hours and 0 minutes, which means 3:00 AM.
  2. Step 2: Confirm time format

    The time is in 24-hour format, so 3 means 3 AM, not PM.
  3. Final Answer:

    At 3:00 AM on June 10, 2024 -> Option A
  4. Quick Check:

    3 hours = 3 AM, date matches [OK]
Hint: Hours in 24-hour format; 3 means 3 AM [OK]
Common Mistakes:
  • Mistaking 3 for 3 PM instead of 3 AM
  • Ignoring the date and assuming current day
  • Confusing startTimeOfDay with duration
4. You wrote this Storage Transfer Service job configuration but the transfer never starts:
{"transferJob": {"status": "ENABLED", "schedule": {"scheduleStartDate": {"year": 2024, "month": 7, "day": 20}, "startTimeOfDay": {"hours": 25, "minutes": 0}}}}

What is the problem?
medium
A. The transferJob status should be DISABLED to start
B. The scheduleStartDate is in the past
C. The minutes value must be 30 or 60
D. The startTimeOfDay hours value is invalid; it must be between 0 and 23

Solution

  1. Step 1: Check startTimeOfDay values

    The hours field is set to 25, which is invalid because valid hours range from 0 to 23.
  2. Step 2: Validate other fields

    The scheduleStartDate is a future date, status is ENABLED which is correct, and minutes is 0 which is valid.
  3. Final Answer:

    The startTimeOfDay hours value is invalid; it must be between 0 and 23 -> Option D
  4. Quick Check:

    Hours must be 0-23, 25 is invalid [OK]
Hint: Hours must be 0-23; 25 is invalid [OK]
Common Mistakes:
  • Assuming status DISABLED starts the job
  • Thinking minutes must be 30 or 60
  • Ignoring invalid hour value
5. You want to transfer data daily from an AWS S3 bucket to a Google Cloud Storage bucket using Storage Transfer Service. Which combination of settings is required?
hard
A. Set GCS bucket as source, AWS S3 as destination, and schedule weekly
B. Set AWS S3 as source with access keys, GCS bucket as destination, and schedule daily
C. Use on-premises source with VPN, GCS bucket as destination, and schedule once
D. Set AWS S3 as source without credentials, GCS bucket as destination, and no schedule

Solution

  1. Step 1: Identify source and destination

    The source is AWS S3 bucket, which requires access keys for authentication. The destination is a Google Cloud Storage bucket.
  2. Step 2: Set schedule for daily transfers

    To transfer data daily, the schedule must be configured to run every day.
  3. Final Answer:

    Set AWS S3 as source with access keys, GCS bucket as destination, and schedule daily -> Option B
  4. Quick Check:

    AWS S3 source + credentials + daily schedule = Set AWS S3 as source with access keys, GCS bucket as destination, and schedule daily [OK]
Hint: AWS S3 needs keys; schedule daily for repeated transfers [OK]
Common Mistakes:
  • Forgetting AWS credentials
  • Reversing source and destination
  • Not setting a schedule for repeated transfers