OpenWare OPEX
Vault and Barong GCS object migration
Prerequisites
- Source and destination GCP projects with desired GCS buckets created
- gsutil installed
Log into the source project
First of all make sure that you've logged into the correct project:
gcloud config get-value project
If this is not the case, log into the correct one:
gcloud config set project *SOURCE_PROJECT_ID*
Copy all files from the source bucket to your local machine
Copy all files to you local machine:
gsutil -m cp -r gs://*SOURCE_BUCKET_NAME*/ .
Now you have everything from this bucket in the ./*SOURCE_BUCKET_NAME*
directory.
Copy all files from your local machine to a destination bucket
First of all you need to configure gcloud
to use the right project:
gcloud config set project *DESTINATION_PROJECT_ID*
Now you can copy your local files to the destination bucket:
gsutil -m cp -r *SOURCE_BUCKET_NAME*/* gs://*DESTINATION_BUCKET_NAME*/