Skip to main content
Argo CD is largely stateless with all data persisted as Kubernetes objects in etcd. This guide covers backup and restore procedures to protect your Argo CD configuration and application definitions.

Understanding Argo CD Data

Argo CD stores its state in:
  • Kubernetes etcd: All Application CRDs, AppProjects, and configuration
  • Redis: Temporary cache only (can be safely rebuilt)
  • Git repositories: Source of truth for application manifests
Redis is used only as a disposable cache and can be safely rebuilt without service disruption.

Backup Procedures

Using argocd admin export

The argocd admin tool provides built-in export functionality to backup all Argo CD data.
1

Check Argo CD version

Determine your Argo CD version to use the correct Docker image:
argocd version | grep server
# Export the version
export VERSION=v3.4.0
2

Configure kubeconfig

Ensure your ~/.kube/config points to your Argo CD cluster:
kubectl config current-context
# Should show your Argo CD cluster
3

Export data to backup

Create a backup file containing all Argo CD resources:
docker run -v ~/.kube:/home/argocd/.kube --rm \
  quay.io/argoproj/argocd:$VERSION \
  argocd admin export > backup.yaml
For non-default namespace:
docker run -v ~/.kube:/home/argocd/.kube --rm \
  quay.io/argoproj/argocd:$VERSION \
  argocd admin export -n <namespace> > backup.yaml
If you are running Argo CD in a namespace other than argocd, remember to pass the -n <namespace> parameter. The export command will not fail if you run it in the wrong namespace, but the backup will be incomplete.

What Gets Backed Up

The export includes:
  • Application definitions
  • AppProject configurations
  • Repository credentials (encrypted)
  • Cluster credentials (encrypted)
  • ConfigMaps (argocd-cm, argocd-rbac-cm, etc.)
  • Secrets (argocd-secret, repository secrets, cluster secrets)

Automated Backup Strategy

Implement automated backups using a CronJob:
apiVersion: batch/v1
kind: CronJob
metadata:
  name: argocd-backup
  namespace: argocd
spec:
  schedule: "0 2 * * *"  # Daily at 2 AM
  jobTemplate:
    spec:
      template:
        spec:
          serviceAccountName: argocd-backup
          containers:
          - name: backup
            image: quay.io/argoproj/argocd:v3.4.0
            command:
            - sh
            - -c
            - |
              argocd admin export > /backup/argocd-backup-$(date +%Y%m%d-%H%M%S).yaml
            volumeMounts:
            - name: backup-storage
              mountPath: /backup
          volumes:
          - name: backup-storage
            persistentVolumeClaim:
              claimName: argocd-backup-pvc
          restartPolicy: OnFailure

Restore Procedures

Restoring from Backup

1

Prepare target cluster

Install Argo CD on the target cluster if not already present:
kubectl create namespace argocd
kubectl apply -n argocd -f \
  https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
2

Import backup data

Restore the backup using the import command:
docker run -i -v ~/.kube:/home/argocd/.kube --rm \
  quay.io/argoproj/argocd:$VERSION \
  argocd admin import - < backup.yaml
For non-default namespace:
docker run -i -v ~/.kube:/home/argocd/.kube --rm \
  quay.io/argoproj/argocd:$VERSION \
  argocd admin import -n <namespace> - < backup.yaml
3

Verify restoration

Check that applications and configurations are restored:
kubectl get applications -n argocd
kubectl get appprojects -n argocd
argocd app list

Alternative Backup Methods

Kubernetes etcd Backup

Since Argo CD data lives in Kubernetes, backing up etcd provides a complete snapshot:
ETCDCTL_API=3 etcdctl snapshot save argocd-snapshot.db \
  --endpoints=https://127.0.0.1:2379 \
  --cacert=/etc/kubernetes/pki/etcd/ca.crt \
  --cert=/etc/kubernetes/pki/etcd/server.crt \
  --key=/etc/kubernetes/pki/etcd/server.key

Velero Integration

Use Velero for cluster-wide backup including Argo CD:
# Install Velero
velero install --provider aws --bucket argocd-backups \
  --secret-file ./credentials-velero

# Create backup schedule
velero schedule create argocd-daily \
  --schedule="@daily" \
  --include-namespaces argocd

# Create on-demand backup
velero backup create argocd-backup-$(date +%Y%m%d) \
  --include-namespaces argocd

Disaster Recovery Scenarios

Scenario 1: Complete Cluster Loss

  1. Provision new cluster: Set up a new Kubernetes cluster
  2. Install Argo CD: Deploy Argo CD fresh installation
  3. Restore backup: Import the latest backup file
  4. Verify applications: Check that all applications are present
  5. Trigger sync: Applications will automatically reconcile with Git
# Quick recovery script
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
sleep 60
docker run -i -v ~/.kube:/home/argocd/.kube --rm \
  quay.io/argoproj/argocd:$VERSION \
  argocd admin import - < backup.yaml

Scenario 2: Corrupted Application State

  1. Identify affected applications: Review application health status
  2. Delete corrupted application: Remove the Application CR
  3. Restore from backup: Import backup or recreate from Git
  4. Resync application: Trigger full sync
# Delete and restore specific application
kubectl delete application myapp -n argocd
kubectl apply -f myapp-backup.yaml
argocd app sync myapp --force

Scenario 3: Lost Repository Credentials

Repository credentials are stored in Kubernetes secrets:
# Export repository secrets from backup
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  name: repo-credentials
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repository
type: Opaque
stringData:
  url: https://github.com/org/repo
  username: git
  password: <token>
EOF

Best Practices

Regular Backups

Schedule automated backups daily or before major changes. Store backups in multiple locations.

Test Restores

Regularly test restore procedures in a non-production environment to verify backup integrity.

Version Compatibility

Use the same Argo CD version for backup and restore operations to avoid compatibility issues.

Secure Storage

Encrypt backup files and store them in secure, access-controlled locations with retention policies.

Backup Retention Policy

Implement a retention strategy:
  • Daily backups: Retain for 7 days
  • Weekly backups: Retain for 4 weeks
  • Monthly backups: Retain for 12 months
  • Pre-upgrade backups: Retain indefinitely
# Cleanup old backups (older than 7 days)
find /backup/argocd-* -mtime +7 -delete

Recovery Time Objective (RTO)

Typical recovery times:
ScenarioExpected RTONotes
Application restore5-10 minutesSingle application from backup
Full Argo CD restore30-60 minutesComplete installation + import
Cluster rebuild2-4 hoursNew cluster + Argo CD + apps

Build docs developers (and LLMs) love