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.
- Create initial cluster with PerconaServerMongoDBs, load in data, ensure logical and pitr are backed up to s3.
- Create new cluster with a different PerconaServerMongoDBs
- 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?
Looked in the specs for PerconaServerMongoDB, PerconaServerMongoDBRestore, and PerconaServerMongoDBBackup, not really seeing anything that would help with this.
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.
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
my-cluster-name-secrets by default).