Backup System

Backup System

Three backup types, restore with intelligent diff-based file replacement, and backup management.


Backup Types

Type What's included Method API
World World data only Native Java Mod API POST /backups
Mods All mods in mods/ directory Daemon ZIP compression DaemonFileRepository
Full Entire server directory Daemon ZIP compression DaemonFileRepository

Permissions

Action Permission
View backups hytale-admin.backups-read
Create/restore/delete backups hytale-admin.backups-manage

Creating a Backup

Detail Value
API (World) POST /backups
API (Mods/Full) Daemon ZIP via DaemonFileRepository
Success "Backup created"
Failure "Backup creation failed" + optional error from $result['error']
Logged as server:hytale-admin.create-backup

Backup Process

  1. Select backup type (world, mods, or full)
  2. Click Create Backup
  3. For world backups: API handles the backup natively on the server
  4. For mods/full backups: Daemon compresses the target directory into a ZIP archive
  5. Backup stored in the configured backupDir directory
  6. Success notification displayed

What the API error can contain

When backup creation fails, the API may return a specific error message in $result['error']. This could be:

  • Insufficient disk space
  • Directory not found
  • Permission denied
  • IO error during compression

Restoring a Backup

Detail Value
Success "Backup restored"
Failure "Backup restore failed"
Logged as server:hytale-admin.restore-backup

Restore Process (Intelligent Diff)

Restoring doesn't simply overwrite everything. The plugin uses an intelligent restoration process:

  1. Create temporary directory for extraction
  2. Unzip the backup archive to temp directory
  3. Diff files — compare backup files with current files
  4. Move only changed files — only files that differ from current state are replaced
  5. Clean up temp directory

This approach:

  • Preserves files that haven't changed (no unnecessary writes)
  • Reduces risk of corrupting currently-used files
  • Faster than full overwrite for large servers

Important: Stop the server before restoring to prevent file conflicts.


Deleting a Backup

Detail Value
Success "Backup deleted"
Failure "Backup deletion failed"
Logged as server:hytale-admin.delete-backup

Backup List

The backup table shows all available backups and polls every 60 seconds:

Column Description
Name Backup filename
Type World, Mods, or Full
Size File size
Created Timestamp
Actions Restore, Delete

Troubleshooting

"Backup creation failed"

  • Disk space: Check available space on the server
  • Permission: Backup directory must be writable
  • For mods/full: Daemon must have access to the target directory
  • API body error: The $result['error'] message provides specific details
  • Check storage/logs/laravel.log for "Hytale API error"

"Backup restore failed"

  • Backup file may be corrupted
  • Stop the server first — files may be locked
  • Insufficient disk space for temp extraction
  • Target directory permissions

Backups don't appear in list

  • backupDir not configured in config.json
  • Backup directory is empty
  • Daemon can't list directory — check file permissions
  • Table polls every 60s — wait or refresh

World backup vs. Full backup — when to use which

Scenario Recommended Type
Quick save before experiments World
Before updating mods Mods
Before major changes Full
Regular scheduled backups World (small, fast)
Before server migration Full