Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Restore file from versioned bucket

How could I restore the delete README-cloudshell.txt from the versioned bucket?

1 Answers

It is not like in AWS, where you delete only the delete flag. You need to copy to a non-versioned URL

gsutil cp gs://storage-lab-zoltan-cli/README-cloudshell.txt#1547219983492482 gs://storage-lab-zoltan-cli/README-cloudshell.txt

and then remove the versioned one

gsutil rm gs://storage-lab-zoltan-cli/README-cloudshell.txt#1547219983492482

or with move in one step:

gsutil mv gs://storage-lab-zoltan-cli/README-cloudshell.txt#1547219983492482 gs://storage-lab-zoltan-cli/README-cloudshell.txt

Mattias Andersson

Good on you for figuring this out and thanks for reporting back so others can learn, too! 😃👍

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?