Valheim Field guide

Back up and restore a Valheim 1.0 server without mixing world chunks

Back up complete Valheim world data and verify an isolated restore: selected world, player join and restart.

Back up and restore a Valheim 1.0 server without mixing world chunks

A Valheim backup is useful when you can load its complete world into an independent directory and verify the expected buildings survive a restart. An archive that opens successfully proves only that the archive is readable. This guide takes a stopped snapshot, checks its contents and rehearses restoration before replacing production data.

Examples assume the Linux layout from our server setup: service valheim, save root /srv/valheim/data and launcher /srv/valheim/start.sh. Adapt all three together. The scope is stable Valheim 1.0; sources were checked on October 18, 2026.

Back up the whole current save layout#

Valheim 1.0 stores worlds in directories containing multiple chunks. The developer's release announcements explain that world saving changed while character saving did not. A recipe selecting only *.db and *.fwl can therefore miss the active world. Keep the entire configured save root, including access lists and automatic backup directories.

Also retain the launcher, service configuration, installed version and required mods/configuration. The example below snapshots data and launcher; record the matching runtime separately before updating it. A server snapshot does not contain every player's separately stored character. Have players preserve their own characters if the recovery scenario needs them.

A post-1.0 forum question asks how to load backups after the format change. Treat that as a reason to rehearse recovery now, rather than assume an older two-file procedure still covers the world.

Copy whole snapshot trees. Merging individual chunks from different save times is not this recovery procedure.

Stop every writer before copying#

Announce maintenance and keep players disconnected. Inspect systemctl cat valheim: the earlier setup requests graceful SIGINT. A different unit may need its stop behavior corrected before this procedure. Then:

bash
sudo systemctl stop valheim
sudo systemctl show valheim -p ActiveState -p MainPID -p Result
sudo journalctl -u valheim --since '10 minutes ago' --no-pager

Proceed only after a completed graceful save/shutdown, inactive and MainPID=0. A timeout followed by forced termination is not the same result. Confirm that no manually launched process or container still writes this save root. Do not make the absence of a PID in one unit stand in for checking your actual deployment.

Create a private archive and checksum#

Run the block together. Its tree check rejects links and special files instead of following them outside the intended backup. Existing symlink-based installations need an explicitly inventoried regular-file export first.

bash
(
set -e
test "$(sudo systemctl show valheim -p ActiveState --value)" = inactive
test "$(sudo systemctl show valheim -p MainPID --value)" = 0
sudo test ! -L /var/backups
sudo test ! -L /var/backups/valheim
sudo install -d -o root -g root -m 700 /var/backups/valheim
sudo python3 - <<'PYTREE'
from pathlib import Path
for root in [Path('/srv/valheim/data'), Path('/srv/valheim/start.sh')]:
    for item in [root, *root.rglob('*')] if root.is_dir() else [root]:
        if item.is_symlink() or not (item.is_file() or item.is_dir()):
            raise SystemExit('Require a complete regular-file tree without links')
PYTREE
valheim_snapshot=$(sudo mktemp -d /var/backups/valheim/snapshot-XXXXXXXX)
sudo tar -czf "$valheim_snapshot/server.tar.gz" -C /srv/valheim data start.sh
sudo sh -c 'systemctl cat valheim > "$1/unit.txt"' sh "$valheim_snapshot"
sudo sh -c 'cd "$1" && sha256sum server.tar.gz > server.sha256' sh "$valheim_snapshot"
sudo sh -c 'cd "$1" && sha256sum -c server.sha256' sh "$valheim_snapshot"
sudo tar -tzf "$valheim_snapshot/server.tar.gz" >/dev/null
printf '%s\n' "$valheim_snapshot"
)

Record the printed directory and snapshot time. Its unit and launcher may contain secrets, so keep the directory private. Copy the completed snapshot to separate protected storage and verify its checksum there. An archive on the same disk is useful for an operator mistake, but does not survive loss of that disk. Resume the existing service after the stopped copy if you are only taking a backup.

Restore into a new directory first#

For the rehearsal, choose the actual snapshot directory and replace REPLACE_SNAPSHOT_DIRECTORY below. Keep the production service stopped while testing on its host. These commands extract into a new root-owned directory, not over the current world:

bash
(
set -e
valheim_snapshot=/var/backups/valheim/REPLACE_SNAPSHOT_DIRECTORY
test "$(sudo systemctl show valheim -p ActiveState --value)" = inactive
test "$(sudo systemctl show valheim -p MainPID --value)" = 0
sudo test -d "$valheim_snapshot"
sudo test ! -L "$valheim_snapshot"
sudo sh -c 'cd "$1" && sha256sum -c server.sha256' sh "$valheim_snapshot"
valheim_restore=$(sudo mktemp -d /srv/valheim/restore-XXXXXXXX)
sudo tar --extract --gzip --file "$valheim_snapshot/server.tar.gz" --directory "$valheim_restore" --no-same-owner --no-same-permissions
sudo chown -R valheim:valheim "$valheim_restore"
sudo chmod -R u+rwX,go-rwx "$valheim_restore"
printf '%s\n' "$valheim_restore"
)

Use only the archive created above or another trusted, inspected snapshot; this is not a recipe for extracting arbitrary uploaded archives as root. Compare the restored tree with the archive inventory and verify the intended world exists. Empty staging directories and valid checksums alone do not prove that the original selection was complete.

Prove recovery before replacing production#

Edit only the restored launcher. Point -savedir at the printed restore directory's data, retain the exact world selector and use a compatible retained runtime. Preserve required library environment and mods. Configure a separate test endpoint/access policy, or keep the original service stopped and use its endpoint during a controlled maintenance test. A hidden listing alone does not isolate a test: restrict access to the test players.

After checking the restored launcher's paths and access settings, replace REPLACE_RESTORE_DIRECTORY with the printed restore-directory name and run it in the foreground under the existing game account. This keeps the setup guide's server working directory and launcher-provided library environment. The runtime currently at /srv/valheim/server must match the snapshot's recorded compatible version before running:

bash
(
set -e
valheim_restore=/srv/valheim/REPLACE_RESTORE_DIRECTORY
test "$(sudo systemctl show valheim -p ActiveState --value)" = inactive
test "$(sudo systemctl show valheim -p MainPID --value)" = 0
sudo test -d "$valheim_restore/data"
sudo test -f "$valheim_restore/start.sh"
sudo test ! -L "$valheim_restore/start.sh"
sudo -u valheim -H /bin/bash -c 'cd /srv/valheim/server && exec /bin/bash "$1/start.sh"' valheim-restore "$valheim_restore"
)

Keep this terminal open during the test. Stop with Ctrl+C, wait for the completed graceful save/exit and confirm the test process has gone before another start or cutover. Do not start valheim.service concurrently. Inspect the test output and join from a real compatible client. Visit known settlements, check containers, make a small test change, shut down cleanly and load the same copy again. Confirm persistence. Do not accidentally invoke the original launcher, which still points to production.

For a real cutover, stop both writers, preserve the current complete data tree under a new name and install the selected complete restored tree in its place. Restore the matching launcher/runtime when required. Never extract over existing chunks or combine two backup folders. Keep the displaced tree until production passes the same join and restart checks.

Iron Gate's conversion incident notes describe progress lost when reverting to an older snapshot; patch 1.0.17 also addressed a chunk-related loss bug. A working older snapshot recovers its own point in time, not progress written afterward. Keep several independently verified dates.