How to replicate a GCP filestore instance on a different project

378 views Asked by At

I have a GCP Filestore (note - not fiRestore) instance that is used by VM's in a development project and I'd like to make a copy of it for use in a staging project.

I created an blank instance in the destination project called staging-filestore that I want to restore the backup to. (both are basic HDD 1TB) I have tried the gcloud command for restoring instances from backups, but it doesn't seem to allow me to specify both the source and destination projects. It assumes that the specified projectId is both src and destination.

 gcloud filestore instances restore staging-filestore \     
--source-backup=dev-filestore-backup  \   
--source-backup-region=us-east1  \   
--file-share=dev_filestore_vol   \  
--zone=us-central1-a \
--project=my-dev-project

If I don't specify the project, it uses the project that I'm currently logged into (I use the Cloud Shell). If I do specify it, it assumes the backup and restore instance are in that project.

If I use a fully qualified path for the destination filestore, I get an error "INVALID_ARGUMENT: backup must belong to the same project as the source instance."

I don't see any way to copy the backup to and from Cloud Storage or download it.

Currently it is a read-only instance, but could become read/write with different projects diverging in content over time so am reluctant to place it on a shared VPC network.

0

There are 0 answers