Search code examples
google-cloud-platformgoogle-cloud-bigtablebigtable

Is there any way to backup all the tables from bigtable instance at once?


we have created a single instance and we want to backup all the tables in that single instance using gcloud command as we have created a pipeline to do that backup thing but while running the backup command gcloud bigtable backups create BACKUP_ID --instance=INSTANCE_ID --cluster=CLUSTER_ID --table=TABLE_ID --async --expiration-date=EXPIRATION_DATE | --retention-period=RETENTION_PERIOD

we are able to backup only one table and after that we are getting an error

 ERROR: (gcloud.bigtable.backups.create) {
  "code": 6,
  "details": [
    {
      "@type": "type.googleapis.com/bigtable.anviltop.proto.FailureTrace",
      "frames": [
        {
          "targetName": "projects/dir/instances/ledger/clusters/ledger-x/backups/bigtable-backup",
          "workflowGuid": "xxxxx84762xxxxxxx/snapshot-replica/",
          "zoneId": "us-west1"
        },
        {
          "targetName": "projects/dir/instances/ledger/clusters/ledger-x/backups/bigtable-backup",
          "workflowGuid": "x4426xxxxxxxxx",
          "zoneId": "us-west1-b"
        }
      ]
    }
  ],
  "message": "Backup bigtable-backup already exists."
}

Solution

  • Based on the error message you received:

    "message": "Backup bigtable-backup already exists."

    It seems like you already have a BACKUP_ID named bigtable-backup.

    BACKUP_ID should be unique. As stated in the Cloud Bigtable documentation,

    BACKUP_ID: The ID you assign to the backup.

    Try using a different BACKUP_ID on your succeeding backups.