# PerconaServerMongoDBRestore selective not possible in K8s with psmdb-db 1.18.0

**URL:** https://forums.percona.com/t/perconaservermongodbrestore-selective-not-possible-in-k8s-with-psmdb-db-1-18-0/36529
**Category:** Percona Backup for MongoDB
**Tags:** mongodb, kubernetes, psmdb-operator, pbm
**Created:** [February 4, 2025, 5:21pm UTC](https://forums.percona.com/t/perconaservermongodbrestore-selective-not-possible-in-k8s-with-psmdb-db-1-18-0/36529 "2025-02-04T17:21:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fabien.hannecart](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fabien.hannecart/32/18835_2.png) [@fabien.hannecart](https://forums.percona.com/u/fabien.hannecart)
#### Post date: [February 4, 2025, 5:21pm UTC](https://forums.percona.com/t/perconaservermongodbrestore-selective-not-possible-in-k8s-with-psmdb-db-1-18-0/36529/1 "2025-02-04T17:21:53Z")

</div>

Hi everyone,

Here is my configuration of a test cluster for backup/restore/update:

- Kubernetes: 1.29.10
- Helm chart psmdb-operator: 1.18.0 (1.19.0 impossible to deploy)
- Helm Chart psmdb-db: 1.18.0 (1.19.0 impossible to deploy)
- Mongod: 6.0.19-16-multi
- Operator: 1.18.0
- PBM: 2.7.0-multi (2.8.0-multi error with index for restore)

So I want to do a selective restore of a specific mongo dbs.

For that I have a complete logical backup that is done, existing and that I can restore completely without worries!

But if I want to do a selective restore I have 2 choices and neither works properly:

- K8s manifest (does not work at all)
- PBM CLI (works but after the restore the PBM status indicates that the restore is still in progress !!? after 12h never finished !)

What interests me first is with K8s manifest so I make the file as below :

```auto
apiVersion: psmdb.percona.com/v1
kind: PerconaServerMongoDBRestore
metadata:
  name: xxxxx-restore-logical-selectif-test-1
spec:
  clusterName: "psmdb-db-xxxxxxx"
  selective:
    withUsersAndRoles: true
    namespaces:
      - "dbs_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.*"
  backupSource:
    type: "logical"
    destination: "s3://xxxxx-data-backups-xxxxxxx/2025-02-04T11:30:21Z"
    s3:
      credentialsSecret: "xxx-xxxxxxxx-backup-s3"
      region: "fr-par"
      bucket: "xxxxx-data-backups-xxxxxxxx"
      endpointUrl: "https://s3.fr-par.xxx.xxxx"

```

Source reference is :

- [percona-server-mongodb-operator/deploy/backup/restore.yaml at main · percona/percona-server-mongodb-operator · GitHub](https://github.com/percona/percona-server-mongodb-operator/blob/main/deploy/backup/restore.yaml)
- [percona/percona-server-mongodb-operator v1.18.0 on GitHub](https://newreleases.io/project/github/percona/percona-server-mongodb-operator/release/v1.18.0)
- [Restore from a previously saved backup - Percona Operator for MongoDB](https://docs.percona.com/percona-operator-for-mongodb/backups-restore.html#with-point-in-time-recovery)

Unfortunately when applying the manifest, `kubectl apply -f pbm-restore-logical-selectif-test-1.yaml` I have the following error:

```auto
Error from server (BadRequest): error when creating "pbm-restore-logical-selectif-test-1.yaml": PerconaServerMongoDBRestore in version "v1" cannot be handled as a PerconaServerMongoDBRestore: strict decoding error: unknown field "spec.selective"

```

Can you help me understand what is the problem please for the manifest that does not apply? Am I wrong in the file format or the API?

Thx. Fabien

---

<div class="post-metadata">

### Author: ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)
#### Post date: [February 5, 2025, 11:40am UTC](https://forums.percona.com/t/perconaservermongodbrestore-selective-not-possible-in-k8s-with-psmdb-db-1-18-0/36529/2 "2025-02-05T11:40:51Z")

</div>

Hi, have you upgraded this environment from a previous version of the operator? it seems the CRD might be outdated. If that is not the case, please open a bug at [jira.percona.com](http://jira.percona.com) and provide the cluster dump and `helm list -n namespace`

---

<div class="post-metadata">

### Author: ![Natalia\_Marukovich](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/natalia_marukovich/32/6407_2.png) [@Natalia\_Marukovich](https://forums.percona.com/u/Natalia_Marukovich)
#### Post date: [February 5, 2025, 11:53am UTC](https://forums.percona.com/t/perconaservermongodbrestore-selective-not-possible-in-k8s-with-psmdb-db-1-18-0/36529/3 "2025-02-05T11:53:06Z")

</div>

This documentation may be helpful [Upgrade MongoDB and the Operator - Percona Operator for MongoDB](https://docs.percona.com/percona-operator-for-mongodb/update.html#upgrade-via-helm)

---

<div class="post-metadata">

### Author: ![fabien.hannecart](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fabien.hannecart/32/18835_2.png) [@fabien.hannecart](https://forums.percona.com/u/fabien.hannecart)
#### Post date: [February 18, 2025, 1:26pm UTC](https://forums.percona.com/t/perconaservermongodbrestore-selective-not-possible-in-k8s-with-psmdb-db-1-18-0/36529/4 "2025-02-18T13:26:14Z")

</div>

Thank you for your answers @Ivan_Groenewold and @Natalia_Marukovich . For this test cluster I destroy it all, an CRDS including. I rebuild it as needed for testing only. With new disks and new data, so also with new CRDS.

So @Ivan_Groenewold , I will certainly do as you said to report the bug in Jira regarding CRD’s.

@Natalia_Marukovich For the story of the Chart Helm version updates, I do indeed encounter problems. For example I tried to go from the bar chart 1.17.1 to 1.18.0 and 1.17.1 to 1.19.0 and I had problems which are problems related to expected values ​​in the `values.yaml` file like `.backup.volumeMounts` that I have to add, while if I deploy directly the 1.19.0 I do not need to provide `.backup.volumeMounts` in the `values.yaml` file !!!? I will do another test and report back to you the problems I eventually encounter later.
