# Schedule database dumps > Configure the Orchard Helm chart to run pg_dump on a schedule and upload the result to S3-compatible storage. Source: https://docs.orchard.hackclub.com/operate/database-dumps/ The Helm chart can run `pg_dump` on a schedule and upload each dump to S3-compatible storage. Use it for Postgres databases that Orchard does not back up itself, such as the [control-plane database](/operate/production/#5-back-up-the-control-plane-database), so that you have a copy off the cluster. Databases that Orchard manages have their own [backups and point-in-time restore](/data/backups/). The chart creates one CronJob for each target. ## Prerequisites - Access to the chart values for the instance. - A bucket in S3-compatible storage. ## Set up dumps 1. Create a Secret for the storage credentials. The default name is `database-dumps-r2`. The Secret needs the keys `ACCESS_KEY_ID` and `ACCESS_SECRET_KEY`. 2. Create a Secret that holds the database password for each target. The default key is `password`. 3. Add the following to your chart values: ```yaml databaseDumps: enabled: true schedule: '15 2 * * *' destination: bucket: my-dumps endpointURL: https://s3.example.com targets: - name: orchard host: postgres.orchard.svc.cluster.local database: orchard user: orchard passwordSecret: name: orchard-postgres ``` 4. Apply the chart. ## Verify the job To list the CronJobs, run the following command: ```sh kubectl get cronjobs -A | grep dump- ``` Each CronJob is named `dump-`. Each dump uses the `pg_dump` custom format. ## Values | Key | Default | Description | | --------------------------------------- | ----------------------- | ------------------------------------------------------------------------- | | `databaseDumps.enabled` | `false` | Creates the CronJobs. | | `databaseDumps.schedule` | `15 2 * * *` | The cron schedule, unless a target sets its own `schedule`. | | `databaseDumps.image` | `postgres:17.12-alpine` | The dump image. Keep the Postgres major version at or above the server's. | | `databaseDumps.uploaderImage` | `amazon/aws-cli:2.40.2` | The upload image. | | `databaseDumps.destination.bucket` | Empty | The bucket. Required when there are targets. | | `databaseDumps.destination.prefix` | `platform-dumps` | The key prefix. | | `databaseDumps.destination.endpointURL` | Empty | The S3 endpoint, for storage other than AWS. | | `databaseDumps.destination.secretName` | `database-dumps-r2` | The Secret with the storage credentials. | | `databaseDumps.destination.keep` | `0` | The number of dumps to keep for each target. `0` keeps every dump. | | `databaseDumps.targets` | Empty | The databases to dump. | Each target needs `name`, `host`, `database`, `user`, and `passwordSecret.name`. The optional keys are `port` (default `5432`), `namespace` (default the top-level `namespace` value, `orchard`), `schedule`, and `passwordSecret.key` (default `password`). Each dump goes to `//.dump` in the bucket. ## Related resources - [Go to production](/operate/production/) - Back up the control-plane database and prepare an instance for real users. - [Add S3 storage](/operate/storage/) - Configure the object storage that database backups and uploads use.