How to backup data from the Mongo DB cluster to a local filesystem

Hi,
We have a requirement to backup the data from a MongoDB cluster using PSMDB to a local filesystem. Below are the snippets from the storages section of the cr.yaml and the backup.yaml files.

From cr.yaml:

  backup:
    enabled: true
    restartOnFailure: true
    image: <image path>
    serviceAccountName: percona-server-mongodb-operator
    storages:
      fs-pvc:
        type: filesystem
        volume:
          persistentVolumeClaim:
            accessModes: [ "ReadWriteOnce" ]
            resources:
              requests:
                storage: 6Gi

From backup.yaml:

apiVersion: <apiversion>
kind: PerconaServerMongoDBBackup
metadata:
  finalizers:
  - delete-backup
  name: backup-aug24-1
  namespace: commonns
spec:
  psmdbCluster: mano-db-percona
  storageName: fs-pvc

We are getting the below error in the Percona server logs while trying to initiate the backup.
Please let us know whether the backup to the local file system is supported. If not, could you please share if it is planned in any of the upcoming releases?

{"level":"error","ts":1629795648.3861542,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"perconaservermongodbbackup-controller","request":"commonns/backup-aug24-1","error":"reconcile backup: set backup config with storage fs-pvc: filesystem backup storage not supported yet, skipping storage name","errorVerbose":"filesystem backup storage not supported yet, skipping storage name\ngithub.com/percona/percona-server-mongodb-operator/pkg/psmdb/backup.(*PBM).SetConfig\n\t/go/src/github.com/percona/percona-server-mongodb-operator/pkg/psmdb/backup/pbm.go:130\ngithub.com/percona/percona-server-
mongodb-operator/pkg/controller/perconaservermongodbbackup.(*Backup
1 Like

Hello @siva,

it is not supported for now.
We have it in the roadmap, but it is not the high priority for now.
What is the use case for local backup? What is stopping you to use any S3-compatible storage (which can also be deployed locally)?

1 Like