PerconaServerMongoDBRestores changing users passwords

Hello,

We are evaluating the mongodb operator for prod use, and I have been testing the backup and recovery functionality. It is working well, maybe even a little too well.

Test setup:

  1. Create initial cluster with PerconaServerMongoDBs, load in data, ensure logical and pitr are backed up to s3.
  2. Create new cluster with a different PerconaServerMongoDBs
  3. Create PerconaServerMongoDBRestores to restore backup onto new cluster.

Data is recovered, but all the users passwords are changed to what the initial cluster had.
Is there a way to only target a single database for the backup?

1 Like

Looked in the specs for PerconaServerMongoDB, PerconaServerMongoDBRestore, and PerconaServerMongoDBBackup, not really seeing anything that would help with this.

1 Like

Ah, I see :confused:

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.

1 Like

OK I have a working setup. When creating the mongodb cluster in the first place create the users secret. This way it can easily be used when creating another cluster to recover to in case of disaster on the original cluster.

1 Like

Hello @jonathon ,

glad to see that you figured it out! Yeah, it is described in this doc: Backup and restore - Percona Operator for MongoDB

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. More details about secrets can be found in System Users. The name of the required Secrets object can be found out from the spec.secrets key in the deploy/cr.yaml (my-cluster-name-secrets by default).

1 Like