Backup & Restore

Protect your compliance data with regular backups and understand how to restore when needed.

Cloud Hosted Customers

If you're using Pestle's managed cloud service:

  • Automatic daily backups - Retained for 30 days
  • Point-in-time recovery - Restore to any point in the last 7 days
  • Geographic redundancy - Backups stored in multiple regions
  • Encryption at rest - AES-256 encryption for all backup data

Contact support@pestle.com to request a restore.

Self-Hosted Backup

Database Backup

Back up your PostgreSQL database regularly:

# Full database backup
pg_dump -h localhost -U pestle_user -d pestle_db > backup_$(date +%Y%m%d).sql

# Compressed backup
pg_dump -h localhost -U pestle_user -d pestle_db | gzip > backup_$(date +%Y%m%d).sql.gz

# With Docker
docker-compose exec db pg_dump -U pestle pestle > backup_$(date +%Y%m%d).sql

Media Files Backup

Back up uploaded files (evidence, attachments):

# Copy media directory
cp -r /path/to/pestle/media /backup/media_$(date +%Y%m%d)

# Or with rsync for incremental backups
rsync -av /path/to/pestle/media/ /backup/media/

Configuration Backup

Don't forget your configuration:

# Back up environment and config files
cp .env /backup/config/
cp docker-compose.yml /backup/config/

Automated Backup Script

Example cron job for daily backups:

#!/bin/bash
# /opt/pestle/backup.sh

BACKUP_DIR="/backups/pestle"
DATE=$(date +%Y%m%d_%H%M%S)

# Create backup directory
mkdir -p $BACKUP_DIR/$DATE

# Database backup
docker-compose exec -T db pg_dump -U pestle pestle | gzip > $BACKUP_DIR/$DATE/database.sql.gz

# Media backup
tar -czf $BACKUP_DIR/$DATE/media.tar.gz /path/to/pestle/media

# Config backup
cp .env docker-compose.yml $BACKUP_DIR/$DATE/

# Remove backups older than 30 days
find $BACKUP_DIR -type d -mtime +30 -exec rm -rf {} +

echo "Backup completed: $BACKUP_DIR/$DATE"

Add to crontab:

# Run daily at 2 AM
0 2 * * * /opt/pestle/backup.sh >> /var/log/pestle-backup.log 2>&1

Restore Procedures

Database Restore

# Stop the application
docker-compose stop backend

# Restore from backup
gunzip -c backup_20240115.sql.gz | docker-compose exec -T db psql -U pestle pestle

# Or without compression
docker-compose exec -T db psql -U pestle pestle < backup_20240115.sql

# Start the application
docker-compose start backend

Media Files Restore

# Restore media directory
cp -r /backup/media_20240115/* /path/to/pestle/media/

# Or extract from tar
tar -xzf /backup/media.tar.gz -C /path/to/pestle/

Disaster Recovery

Full System Restore

  1. Provision new server with required dependencies
  2. Restore configuration files (.env, docker-compose.yml)
  3. Start database container
  4. Restore database from backup
  5. Restore media files
  6. Start application containers
  7. Run database migrations (if upgrading)
  8. Verify application functionality

Testing Backups

Regularly verify your backups work:

  1. Restore to a test environment monthly
  2. Verify data integrity
  3. Test application functionality
  4. Document restore time for RTO planning

Data Export

Export your data for external backup or migration:

  • Settings → Export Data - Export all data as JSON/CSV
  • API Export - Programmatic data export via API
  • Individual Reports - Export specific assessments or registers

Retention Policy

Recommended backup retention:

  • Daily backups - Keep for 7 days
  • Weekly backups - Keep for 4 weeks
  • Monthly backups - Keep for 12 months
  • Annual backups - Keep for 7 years (compliance)
© 2026 Pestle. All rights reserved.

Contact: sales@pestle.in | +91 897 702 5287

Trendz Pride 5th Floor, Plot No 20/127, Survey No.79, Road No 1, Patrika Nagar, Madhapur, Hyderabad, Telangana, India, 500081