1
Backup & Restore
the_minisip edited this page 2026-10-16 13:23:41 -03:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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:

  • Container-managed backups — configurable interval, timestamped ZIP archives, automatic pruning.
  • Valheim internal rolling backups — built-in game mechanism that keeps up to 5 rotating world snapshots.

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:

  • <WORLD_NAME>.db — primary world database
  • <WORLD_NAME>.fwl — world metadata
  • <WORLD_NAME>_1.db
  • <WORLD_NAME>_2.db
  • <WORLD_NAME>_3.db
  • <WORLD_NAME>_4.db
  • <WORLD_NAME>_5.db

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:

Variable Default Description
BACKUP_INTERVAL 21600 Backup interval (seconds). Default is 6 hours.
BACKUP_RETENTION_DAYS 7 Days 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. Creates a ZIP archive in /backups
  3. Logs the backup creation
  4. Prunes backups older than BACKUP_RETENTION_DAYS

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


6. Restoring a World

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

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. Navigate to:
    /root/.config/unity3d/IronGate/Valheim/worlds_local/<WORLD_NAME>
  3. Choose one of the numbered backups (e.g., _3.db).
  4. Replace:
    <WORLD_NAME>.db
    <WORLD_NAME>.fwl
    with the corresponding numbered versions.
  5. Start the TrueNAS SCALE app.

The server will load the restored world automatically.


7. Best Practices

  • Use container backups for long-term retention.
  • Use Valheim’s internal backups for quick rollbacks.
  • Always stop the server before restoring files.
  • Keep multiple container backups before major mod changes.

8. Troubleshooting

No Backups Are Appearing

  • Verify the /backups volume is mounted.
  • Check container logs for backup messages.
  • Ensure BACKUP_INTERVAL is set correctly.

Backups Are Not Being Pruned

  • Verify BACKUP_RETENTION_DAYS is set.
  • Check file permissions on the backup directory.

Next Steps

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