Menu
 

Server Backup and Restore - Unturned Wiki

Unturned Server Backup and Restore

Regular backups are essential for protecting your Unturned server data, player progress, and world builds. This comprehensive guide covers backup strategies, automated systems, and restoration procedures.

Understanding Server Data

Your Unturned server contains several important data types:

  • World Files: Terrain, structures, and object placements
  • Player Data: Inventories, skills, and character information
  • Server Config: Commands.dat and configuration files
  • Workshop Mods: Downloaded mods and workshop content
  • Logs: Server activity and error logs

World Data

Map terrain, buildings, and environment

Player Progress

Character saves and inventory data

Configuration

Server settings and mod configurations

Solution 1: Manual Backup Process

Identifying Important Files

Locate these key directories for backup:

/Servers/YourServerName/
├── Server/
│   ├── Commands.dat
│   ├── ServerConfig.json
│   └── Level.sav
├── Players/
│   └── [PlayerID].dat
├── Workshop/
│   └── [WorkshopContent]
└── Logs/
    └── [ServerLogFiles]

Manual Backup Steps

  1. Stop your Unturned server to prevent data corruption
  2. Navigate to your server directory
  3. Create a backup folder with timestamp: backup_YYYY-MM-DD_HH-MM
  4. Copy entire server directory to backup location
  5. Verify backup integrity (check file sizes)
  6. Restart server to resume normal operation

Solution 2: Automated Backup Systems

Bash Script for Linux

Create automated backups with this script:

#!/bin/bash
SERVER_DIR="/path/to/unturned/server"
BACKUP_DIR="/path/to/backups"
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
BACKUP_NAME="unturned_backup_$TIMESTAMP"

# Stop server
systemctl stop unturned

# Create backup
tar -czf "$BACKUP_DIR/$BACKUP_NAME.tar.gz" -C "$(dirname "$SERVER_DIR")" "$(basename "$SERVER_DIR")"

# Start server
systemctl start unturned

# Clean old backups (keep last 7 days)
find "$BACKUP_DIR" -name "unturned_backup_*.tar.gz" -mtime +7 -delete

echo "Backup completed: $BACKUP_NAME"

Windows Batch Script

For Windows servers:

@echo off
set SERVER_DIR="C:\Unturned\Servers\YourServer"
set BACKUP_DIR="D:\UnturnedBackups"
set TIMESTAMP=%date:~0,4%-%date:~5,2%-%date:~8,2%_%time:~0,2%-%time:~3,2%

:: Stop server
taskkill /f /im Unturned.exe

:: Create backup
7z a "%BACKUP_DIR%\unturned_backup_%TIMESTAMP%.7z" "%SERVER_DIR%"

:: Start server
start "" "C:\Unturned\Unturned.exe" -batchmode -nographics

echo Backup completed: unturned_backup_%TIMESTAMP%.7z

Solution 3: Cloud Backup Integration

Amazon S3 Backup

Upload backups to cloud storage:

#!/bin/bash
AWS_BUCKET="your-backup-bucket"
BACKUP_FILE="$BACKUP_DIR/$BACKUP_NAME.tar.gz"

# Upload to S3
aws s3 cp "$BACKUP_FILE" "s3://$AWS_BUCKET/unturned-backups/"

# Set lifecycle policy for automatic cleanup
aws s3api put-bucket-lifecycle-configuration \
    --bucket "$AWS_BUCKET" \
    --lifecycle-configuration file://lifecycle.json

Google Drive Backup

Use rclone for Google Drive integration:

# Configure rclone
rclone config create gdrive drive

# Sync backups
rclone sync "$BACKUP_DIR" gdrive:UnturnedBackups/ \
    --include "*.tar.gz" \
    --delete-after 7d

Solution 4: Restore Procedures

Complete Server Restore

  1. Stop the current server instance
  2. Backup current server data (in case restore fails)
  3. Extract the desired backup to temporary location
  4. Move/replace files in server directory
  5. Verify file permissions and ownership
  6. Start the server and test functionality

Selective Data Restore

Restore specific data types:

Data Type Files to Restore Considerations
World OnlyLevel.sav, Maps/Keeps player data intact
Player Data OnlyPlayers/Preserves world structures
Configuration OnlyCommands.dat, ServerConfig.jsonDoesn't affect world/players

Solution 5: Advanced Backup Strategies

Differential Backups

Save space with differential backups:

  • Weekly full backup
  • Daily differential backups
  • Use rsync for efficient file comparison
  • Compress only changed files

Incremental Backup Script

#!/bin/bash
BASE_BACKUP="$BACKUP_DIR/base_backup.tar.gz"
INCREMENTAL_DIR="$BACKUP_DIR/incremental"

# Create incremental backup based on base
tar --listed-incremental=incremental.snar \
    -czf "$BACKUP_DIR/incremental_$(date +%Y%m%d).tar.gz" \
    -C "$(dirname "$SERVER_DIR")" "$(basename "$SERVER_DIR")"

Troubleshooting Backup Issues

Common Backup Problems

Issue Cause Solution
Corrupted backupsServer running during backupAlways stop server before backup
Incomplete backupsInsufficient disk spaceCheck available space before backup
Large backup filesUncompressed backupsEnable compression
Permission errorsWrong file permissionsCheck file ownership

Verification Procedures

Always verify backup integrity:

  • Check archive file integrity: tar -tzf backup.tar.gz
  • Verify file sizes match expectations
  • Test restore on temporary directory
  • Monitor backup completion logs

Backup Scheduling

Cron Jobs for Automation

Schedule regular backups with cron:

# Daily backup at 2 AM
0 2 * * * /path/to/backup_script.sh

# Weekly full backup on Sunday at 3 AM
0 3 * * 0 /path/to/full_backup_script.sh

# Monthly backup verification
0 4 1 * * /path/to/verify_backups.sh

Windows Task Scheduler

Set up automated backups on Windows:

  1. Open Task Scheduler
  2. Create new task with backup script
  3. Set trigger: Daily at specific time
  4. Configure conditions and settings
  5. Test the scheduled task

Pro Tip: Store backups in multiple locations (local + cloud) to protect against both hardware failure and data corruption. Test restore procedures monthly to ensure they work when needed.

Disaster Recovery

Emergency Restore Plan

Have a disaster recovery checklist:

  • Identify the last known good backup
  • Document restore procedures
  • Test backup systems regularly
  • Maintain contact information for technical support
  • Keep offline copies of critical configuration files

Rollback Procedures

For server issues and corruption:

  1. Stop the server immediately
  2. Identify the problematic change or update
  3. Select appropriate backup from before the issue
  4. Perform selective or full restore
  5. Test server functionality before opening to players

Protect your Unturned server data with comprehensive backup strategies and restore procedures to ensure minimal downtime and data loss protection.

Top