How to Backup Valheim Dedicated Server

Channel:
Subscribers:
2,750
Published on ● Video Link: https://www.youtube.com/watch?v=XejBIwBYTG8



Valheim
Game:
Valheim (2021)
Duration: 11:53
3,843 views
52


In this video I share my method for backup and restore of my Dedicated Valheim Server worlds. I only back up the worlds directory, so the scope of the backup is strictly the world itself and not the Valheim Server binaries.

Follow my instructions on how to install Valheim Server first:    • Installing Dedicated VALHEIM Server o...  


vi backup.sh

#!/bin/bash
####################################
# Backup Valheim Saved game to a
specified folder.
#
####################################

What to backup.
backup_files="/home/steam/.config/unity3d/IronGate/Valheim/worlds"
backup_file_name="valheim"

Specify which directory to backup to.
Make sure you have enough space to hold {n} days of backups.
dest="/home/steam/backups"

Create backup archive filename.
day=$(date +"%Y-%m-%d_%H-%M-%S")
archive_file="$day-$backup_file_name.tar.gz"

Stop valheimserver Server
systemctl stop valheimserver

Backup the files using tar.
tar zcvf $dest/$archive_file $backup_files

Clear backups
/home/steam/clear_backups.sh

Start valheimserver Server
systemctl start valheimserver



chmod +x backup.sh



vi clear_backups.sh

#!/bin/bash
####################################
# Clean up Valheim saved game to a
specified folder.
#
####################################

-mtime +30 means any file older than 30 days
find /home/steam/backups -type f -mtime +30 -exec rm -f {} \;



chmod +x clear_backups.sh



crontab -l

0 3 * * * /home/steam/backup.sh




Restoring a backup:

E.g.

Stop Valheim Server
systemctl stop valheimserver

Remove existing data
rm -rf /home/steam/.config/unity3d/IronGate/Valheim/worlds/*

Restore a saved file.
tar -xvf /home/steam/backups/2021-02-18_03-00-01-valheim.tar.gz -C /

Restore permissions on files
chown steam:steam -R /home/steam/.config/unity3d/IronGate/Valheim/worlds

Start Valheim Server
systemctl start valheimserver







Tags:
valheim
valheim dedicated server
valheim linux
valheim dedicated server linux
valheim linux server
valheim server
valheim server build
valheim server setup
valheim server ubuntu
install valheim dedicated server
valheim server hosting
valheim server settings
valheim dedicated server setup
valheim dedicated server config
linux server
steamcmd
steamcmd server
steamcmd valheim
valheim backup
valheim backup save
valheim save location
valheim save game



Other Statistics

Valheim Statistics For Geekhead

Currently, Geekhead has 53,646 views for Valheim across 8 videos. Valheim has approximately 1 hour of watchable video on his channel, or 5.76% of the total watchable video on Geekhead's YouTube channel.