My coworker accidentally deleted a production google cloud datastore , is there a way to recover it

46 Views Asked by At

My coworker accidentally deleted a whole google cloud datastore database, is there any way to recover it?

1

There are 1 best solutions below

1
Cory Kramer On

Did you have backups enabled? If so you can restore a backup using the following https://cloud.google.com/datastore/docs/backups#restore_data_from_a_database_backup

Restore data from a database backup
A restore operation writes the data from a backup to a new Datastore mode database. To begin a restore operation, use the gcloud alpha firestore databases restore command:

gcloud alpha firestore databases restore \
--source-backup=projects/PROJECT_ID/locations/LOCATION/backups/BACKUP_ID \
--destination-database='DATABASE_ID'
  • PROJECT_ID: Your project ID.
  • LOCATION: The location of the database backup and the location of the new database created for the restored data.
  • BACKUP_ID: The ID of a backup. You can view the ID each backup when you list all backups.
  • DATABASE_ID: A database ID for the new database. You cannot use a database ID that is already in use. The database mode will match that of the backup.

The output will include metadata, name, and response components: