diff --git a/Backup-%26-Restore.md b/Backup-%26-Restore.md new file mode 100644 index 0000000..8e44a6e --- /dev/null +++ b/Backup-%26-Restore.md @@ -0,0 +1,227 @@ +

Backup & Restore

+ +

+ This page explains how world backups work in the + Managed Valheim server, including both the container’s + automated backup system and Valheim’s own internal rolling backup mechanism. + Together, these provide multiple layers of protection for your world data. +

+ +
+ +

1. Overview

+ +

+ The Managed Valheim server provides two independent backup systems: +

+ + + +

+ Understanding both systems ensures safe restores and reliable world recovery. +

+ +
+ +

2. Valheim’s Internal Rolling Backup System

+ +

+ Valheim automatically maintains a set of rolling backups for each world. These + backups are stored alongside the main world files and are created by the game + itself during save operations. +

+ +

+ Internal backups are located here: +

+ +
/root/.config/unity3d/IronGate/Valheim/worlds_local/<WORLD_NAME>
+ +

+ Inside this directory, you will see files such as: +

+ + + +

+ Valheim rotates these files automatically, keeping the last 5 save states. + These backups are not compressed and not pruned + by the container — they are fully managed by the game. +

+ +

+ You can restore from these internal backups by replacing the main + .db and .fwl files with one of the numbered versions. +

+ +
+ +

3. Container-Managed Backup System

+ +

+ In addition to Valheim’s internal backups, the container provides a + configurable backup system that creates timestamped ZIP archives of the entire + world directory. +

+ +

+ Backups are stored in: +

+ +
/backups
+ +

+ Each backup follows this naming format: +

+ +
<WORLD_NAME>_YYYY-MM-DD_HH-MM-SS.zip
+ +
+ +

4. Backup Configuration

+ +

+ Configure backup behavior using environment variables: +

+ + + + + + + + + + + + + + + + + + + + + +
VariableDefaultDescription
BACKUP_INTERVAL21600Backup interval (seconds). Default is 6 hours.
BACKUP_RETENTION_DAYS7Days to retain backups before pruning.
+ +

+ These values can be changed at any time without rebuilding the container. +

+ +
+ +

5. Backup Creation Process

+ +

+ During each backup cycle, the container: +

+ +
    +
  1. Locates the world directory
  2. +
  3. Creates a ZIP archive in /backups
  4. +
  5. Logs the backup creation
  6. +
  7. Prunes backups older than BACKUP_RETENTION_DAYS
  8. +
+ +

+ This process runs in the background and does not interrupt gameplay. +

+ +
+ +

6. Restoring a World

+ +

Option A — Restore from Container Backup (Recommended)

+ +
    +
  1. Stop the TrueNAS SCALE app.
  2. +
  3. Extract the desired ZIP file from /backups.
  4. +
  5. Copy the extracted world directory into:
    + /root/.config/unity3d/IronGate/Valheim/worlds_local/<WORLD_NAME> +
  6. +
  7. Ensure filenames match the world name exactly.
  8. +
  9. Start the TrueNAS SCALE app.
  10. +
+ +

Option B — Restore from Valheim’s Internal Rolling Backups

+ +

+ If you prefer to use Valheim’s built-in backups: +

+ +
    +
  1. Stop the TrueNAS SCALE app.
  2. +
  3. Navigate to:
    + /root/.config/unity3d/IronGate/Valheim/worlds_local/<WORLD_NAME> +
  4. +
  5. Choose one of the numbered backups (e.g., _3.db).
  6. +
  7. Replace:
    + <WORLD_NAME>.db
    + <WORLD_NAME>.fwl
    + with the corresponding numbered versions.
  8. +
  9. Start the TrueNAS SCALE app.
  10. +
+ +

+ The server will load the restored world automatically. +

+ +
+ +

7. Best Practices

+ + + +
+ +

8. Troubleshooting

+ +

No Backups Are Appearing

+ + +

Backups Are Not Being Pruned

+ + +
+ +

Next Steps

+ + + +

+ With both backup systems available, your Valheim world is protected against + corruption, mod issues, and accidental loss. +