Backup/restore a single database using encryption

Usually one would use mongodump/restore. Is there a safe way to use mongodump/restore (or else) when running MongoDB as a cluster with the Operator ?

My current approach would be something like:

mongodump --host localhost --db myDB -password myPass … | zip -p myPass

Running on a member of the replicaset - not sure if this works. And next obstacle would be, on which replicaset member to restore.

Possibly you have a better approach.

1 Like

@jamoser this should be primary for sure.
For single DB - you mean you have full backup, but do not want to recover it completely, but want to limit it to single db or collection?

It is not supported yet in Percona Backup for MongoDB and we are researching it.

1 Like

Hi @spronin

Lets say I have databases db1 to db10000.

  1. Backup: I would like to backup them individually (like with mongodump -db dbX). But also I want to make sure that the content is encrypted. It doesnt make sense if the db’s are encrypted individually (encr. at rest) but the backups are not. Also this has to be triggered per db (for ex. “6h after last write”), since if you have a huge amount of data, then you dont want the system doing backup all the time)
  2. Restore: Restore the backups individually

If I had a single instance I would do this with mongodump/restore compining with a zip file encryption. But the issue is now with the replicaset/sharding - on which “pod” should this be executed. I guess in conjunction with the operator it makes backup/restore a little bit more compicated.

1 Like