--- title: "Dgraph Backup and Restore" slug: "dgraph-back-and-restore" updated: 2026-11-04T18:48:11Z published: 2026-11-04T18:48:11Z canonical: "docs.crossworkassurance.cisco.com/dgraph-back-and-restore" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.crossworkassurance.cisco.com/llms.txt > Use this file to discover all available pages before exploring further. # Dgraph Backup and Restore This guide provides detailed procedures for backing up and restoring Dgraph in on-premises Kubernetes PCA deployments. ## Prerequisites - `kubectl` access to the PCA cluster - SSH access to cluster nodes (for restoration) - Familiarity with OpenEBS local storage paths ## Backup Overview Dgraph backups are managed by the `stitchit` service using configuration from the `stitchit-env-config` ConfigMap. Unlike other components that use CronJobs, Dgraph backup scheduling is controlled through this ConfigMap. View the backup configuration: ``` kubectl describe configmap -n pca stitchit-env-config ``` Key configuration values: | Setting | Description | | --- | --- | | `S3_BUCKET` | MinIO bucket path for backups | | `S3_SERVER` | MinIO server endpoint | | `BACKUP_SCHEDULE` | Cron expression for backup timing | | `BACKUP_RETENTION` | Retention period (e.g., `P15D` = 15 days) | Default behavior: - Runs daily at **04:00 UTC** - Writes backups to the local MinIO storage backend - Retains backups for 15 days ## Manually Trigger a Backup You can trigger a Dgraph backup using the GraphQL admin API from any pod with `curl`: ``` kubectl exec -it -n pca airflow-0 -- sh ``` First, retrieve the MinIO credentials: ``` kubectl exec -it -n pca pca-minio-pool-0-0 -- cat /tmp/minio/config.env | grep ROOT ``` Then execute the backup mutation: ``` curl -H "Content-Type: application/graphql" -X POST dgraphalpha1-0:8080/admin -d ' mutation { export(input: { destination: "minio://pca-minio-hl.pca.svc.cluster.local:9000/?secure=false" accessKey: "" secretKey: "" }) { response { message code } } } ' ``` Replace `<bucket-name>`, `<MINIO_ROOT_USER>`, and `<MINIO_ROOT_PASSWORD>` with your actual values. ### Alternative: Modify Backup Schedule You can trigger an immediate backup by temporarily changing the schedule: 1. Edit the ConfigMap: ``` kubectl edit configmap -n pca stitchit-env-config ``` 2. Change `BACKUP_SCHEDULE` to a time a few minutes in the future 3. Restart the stitchit deployment: ``` kubectl rollout restart deploy -n pca stitchit ``` 4. After the backup completes, restore the original schedule ## Access Backups in MinIO 1. Connect to the MinIO pod: ``` kubectl exec -it -n pca pca-minio-pool-0-0 -- sh . /tmp/minio/config.env ``` 2. Configure the MinIO client: ``` mc alias set --insecure pca https://localhost:9000 "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD" ``` 3. List available backups: ``` mc --insecure ls pca//dgraphBackup/v2/ ``` 4. Copy a backup to the pod filesystem: ``` mc --insecure cp -r \ pca//dgraphBackup/v2// \ /tmp/ ``` ## Restore Procedure > **Important:** Dgraph restoration procedures are complex and depend on your specific deployment configuration. Contact Cisco TAC for guidance on restoring Dgraph data in your environment. The general restoration approach involves: 1. Export the backup from MinIO to the admin VM 2. Stop Dgraph services 3. Clear existing Dgraph data 4. Import the backup using Dgraph's bulk loader or live loader 5. Restart services and validate ## Post-Restore Validation 1. Verify Dgraph cluster health 2. Confirm data queries return expected results 3. Check dependent services are functioning correctly ## Related Topics - [Backup and Restore Overview (Kubernetes)](/docs/opensearch-backup-and-restore) - [CouchDB Backup and Restore](/docs/couchdb-backup-and-restore) - [PostgreSQL Backup and Restore](/docs/postgresql-backup-and-restore) - [Elasticsearch Backup and Restore](/docs/elasticsearch-backup-and-restore)