# Restore from deleted backup

**URL:** https://forums.percona.com/t/restore-from-deleted-backup/28081
**Category:** Percona Operator for MongoDB
**Tags:** percona, mongodb, kubernetes
**Created:** [January 27, 2024, 2:28pm UTC](https://forums.percona.com/t/restore-from-deleted-backup/28081 "2024-01-27T14:28:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![taglas\_tamas](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/taglas_tamas/32/12172_2.png) [@taglas\_tamas](https://forums.percona.com/u/taglas_tamas)
#### Post date: [January 27, 2024, 2:28pm UTC](https://forums.percona.com/t/restore-from-deleted-backup/28081/1 "2024-01-27T14:28:46Z")

</div>

Hi everyone, I have a simple straightforward question, but I have not found anything about this in the official documentation.

I deployed Percona MongoDB Operator and Percona MongoDB Server (sharded) on my Kubernetes cluster, with MinIO used as S3 storage.

The scenario is the following:

- I have created a backup using the Backup yaml file.
- The backup happened, the data is in the bucket.
- The `Percona Backup` kubernetes resource have been deleted.
- The data is still in the bucket.

Can I restore it in some way? The `Restore` custom resource is no applicable in this case, as gives an error, with `Backup <name> not found`.

---

<div class="post-metadata">

### Author: ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)
#### Post date: [January 27, 2024, 6:39pm UTC](https://forums.percona.com/t/restore-from-deleted-backup/28081/2 "2024-01-27T18:39:55Z")

</div>

Hello @taglas_tamas ,

please have a look at this doc: [Restore backup to a new Kubernetes-based environment - Percona Operator for MongoDB](https://docs.percona.com/percona-operator-for-mongodb/backups-restore-to-new-cluster.html)

It boils down to specifying the S3 bucket in the restore.yaml:

```auto
backupSource:
  type: logical
  destination: s3://S3-BUCKET-NAME/BACKUP-NAME
  s3:
    credentialsSecret: my-cluster-name-backup-s3
    region: us-west-2
    endpointUrl: https://URL-OF-THE-S3-COMPATIBLE-STORAGE

```

Please note the following though:

> When restoring to a new Kubernetes-based environment, make sure it has a Secrets object with the same user passwords as in the original cluster.

You need to have secrets from your k8s cluster as well.

---

<div class="post-metadata">

### Author: ![taglas\_tamas](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/taglas_tamas/32/12172_2.png) [@taglas\_tamas](https://forums.percona.com/u/taglas_tamas)
#### Post date: [January 30, 2024, 7:45pm UTC](https://forums.percona.com/t/restore-from-deleted-backup/28081/3 "2024-01-30T19:45:31Z")

</div>

@Sergey_Pronin

Thank you for your response, I have tried the method you’re suggesting, and here are my findings:

Unfortunately, I could not give a name to the backup that would be used in this situation.  
The name of the backup on the storage is a UNIX timestamp, and that gives me more information to maintain, I tried using the key `pbmName` in the Backup custom resource, but it is not declared in the schema. I think this can be a feature, because it would be more accessible to be able to restore a backup called `emergency_backup_before_disaster` than `2024-01-30T19:28:05Z`.

Another thing, just for your information, I have made the mistake to try to a logical backup as a physical, and the following scenario happened:

- The backup was requested
- The MongoDB Server was put in Initializing state
- All of the Server pods restarted, with pbm-init containers instead of backup-agent containers
- The mongos pods did not start
- The state of the MongoDB Server did not change with time

When I deleted the Custom Resrouce, and I redeployed it, it redeployed with the already declared PVCs and the backup was finished though.

Anyway, thanks for the information the issue is solved,
