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

Hi, I see you are using the K8S operator. I suggest you post in Percona Distribution for MongoDB Operator - Percona Community Forum
Looking at the documentation for PSMDB Operator - Providing Backups backups taken with the operator seem to support only s3-compatible storage at this time.

1 Like