Menu
 

DayZ Backup and Restore Guide

DayZ Backup and Restore Guide

Protect your server data with regular backups and learn how to restore when needed.

What to Backup

Essential directories and files:

# Server Storage Locations missions/db/ # Database (most critical) profiles/ # Player profiles storage_x/ # Additional storage (if used)

Creating Manual Backups

Windows

# Stop server # Create backup folder mkdir backups\%date% # Copy database xcopy missions\db\ backups\%date%\db\ /E /I # Copy profiles xcopy profiles\ backups\%date%\profiles\ /E /I # Restart server

Linux

# Stop server systemctl stop dayzserver # Create backup directory BACKUP_DIR="/path/to/backups/$(date +%Y%m%d_%H%M%S)" mkdir -p "$BACKUP_DIR" # Copy database cp -r missions/db "$BACKUP_DIR/" # Copy profiles cp -r profiles "$BACKUP_DIR/" # Create archive tar -czf "$BACKUP_DIR.tar.gz" "$BACKUP_DIR" # Restart server systemctl start dayzserver

Automated Backups

Windows Task Scheduler

# Create backup_script.bat @echo off set BACKUP_DIR="C:\DayZ\backups\%date:~-4,4%%date:~-7,2%%date:~-10,2%" mkdir %BACKUP_DIR% xcopy "C:\DayZ\missions\db" %BACKUP_DIR%\db /E /I /Y xcopy "C:\DayZ\profiles" %BACKUP_DIR%\profiles /E /I /Y # Schedule with Task Scheduler # Run daily at 3:00 AM

Linux Cron Job

# Add to crontab (crontab -e) # Backup every 6 hours 0 */6 * * * /path/to/backup_script.sh # Backup daily at 3 AM 0 3 * * * /path/to/backup_script.sh # backup_script.sh content: #!/bin/bash DAYZ_DIR="/path/to/dayz/server" BACKUP_DIR="/path/to/backups/$(date +%Y%m%d_%H%M%S)" mkdir -p "$BACKUP_DIR" systemctl stop dayzserver cp -r "$DAYZ_DIR/missions/db" "$BACKUP_DIR/" cp -r "$DAYZ_DIR/profiles" "$BACKUP_DIR/" systemctl start dayzserver tar -czf "$BACKUP_DIR.tar.gz" "$BACKUP_DIR" rm -rf "$BACKUP_DIR"

Restoring from Backup

Full Database Restore

# Stop server systemctl stop dayzserver # Remove current database rm -rf missions/db/* # Extract backup tar -xzf backups/20250119_030000.tar.gz # Copy database back cp -r 20250119_030000/db/* missions/db/ # Restore profiles (optional) cp -r 20250119_030000/profiles/* profiles/ # Restart server systemctl start dayzserver

Partial Restore

Restore specific tables or data:

# Extract backup tar -xzf backups/backup.tar.gz # Copy specific files cp backup/db/players.db missions/db/ cp backup/db/vehicles.db missions/db/

Database Files Explained

  • players.db: Player characters and inventory
  • vehicles.db: All vehicles and their positions
  • construction.db: Base building structures
  • storage.db: Storage containers and contents
  • events.db: Server events and logs

Backup Retention

Implement retention policy to save disk space:

# Keep backups for 7 days find /path/to/backups -name "dayz_backup_*.tar.gz" -mtime +7 -delete # Or keep daily, weekly, monthly # Daily for 7 days # Weekly for 4 weeks # Monthly for 3 months

Cloud Backup

Upload backups to cloud storage:

# AWS S3 aws s3 sync /path/to/backups s3://bucket-name/dayz/ # Google Cloud Storage gsutil -m rsync -r /path/to/backups gs://bucket-name/dayz/ # rclone (multi-cloud) rclone sync /path/to/backups remote:bucket/dayz/

Warning: Always stop the server before creating backups to ensure database consistency.

Troubleshooting

Corrupted Backup

  • Try older backup
  • Verify file integrity
  • Check for incomplete transfers

Restore Failed

  • Verify file permissions
  • Check disk space
  • Ensure server is stopped
  • Review database file format

Pro Tip: Test your restore procedure regularly to ensure it works when needed.

Top