Valheim Auto Backup: A Viking’s Guide to Server World Safety
Valheim, the popular Viking survival game, offers a deep and engaging experience. However, losing hours of progress due to server issues or accidental mishaps can be devastating. Thankfully, Valheim has built-in backup features and various other community-driven methods to safeguard your world. This guide explores all you need to know about automatic backups, how to tweak them, and some cool third-party options.
Valheim’s Built-in Backup System: How it Works
The core Valheim server software does come with a basic automated backup functionality. This system, while not incredibly advanced, is enough to protect your world from common setbacks. Here’s how it works:
- Save Interval: The game automatically saves your world every 30 minutes (1800 seconds). This interval ensures that your progress isn’t too far behind in case of a crash.
- Backup Frequency: The system creates backups at specific time intervals. By default, it keeps one backup that is 2 hours old and three backups that are spaced 12 hours apart.
- Backup Retention: This means a total of 4 backup files are stored at a time. The most recent is from the last 2 hours, and there’s 3 additional older backups that are 12 hours apart.
This system offers a good starting point for world protection, but some might want greater control.
Tweak Automatic Backups using Server Arguments
Valheim allows you to modify these automated backup settings using server arguments. These arguments can be added to your server’s startup script. These are some of the most important arguments you should know:
-saveinterval <seconds>
: This determines how often the world saves in seconds. For example,-saveinterval 900
will save every 15 minutes.-backups <number>
: This command allows you to set the number of automatic backups to keep. For example, using-backups 5
would mean it saves 5 backup files.-backupshort <seconds>
: This sets the time interval in seconds for the first backup. So,-backupshort 3600
means the first backup is 1 hour old.-backuplong <seconds>
: This sets the time interval in seconds for the subsequent backups. With-backuplong 21600
, the additional backups would save every 6 hours.
Let’s say you want a backup every hour, with a history of the last 10 hours, and a slightly older one from yesterday. You would use this line in your start_server.bat
:
start valheim_server.exe -name "MyServer" -port 2456 -world "MyWorld" -password "YourPassword" -saveinterval 3600 -backups 12 -backupshort 3600 -backuplong 36000
How to Apply Server Arguments
- Locate your server startup script: Find the batch file or shell script you use to launch your Valheim dedicated server.
- Modify the command line: Add the desired backup arguments to the server launch command. For Windows servers, this usually means modifying the
start_server.bat
file. For example:valheim_server.exe -name "MyServer" -port 2456 -world "MyWorld" -password "YourPassword" -saveinterval 900 -backups 5 -backupshort 3600 -backuplong 21600
- Save the changes: Save the modified file.
- Restart your server: Restart your Valheim server for the changes to take effect.
It’s best to try out your backup settings for a while, to make sure everything is working as expected.
Community-Driven Backup Solutions
While Valheim’s built-in backup system is useful, some players require more robust options. Here are a few popular methods:
1. Automated Backup Scripts
There are several scripts available online that enhance the game’s default backup system. These scripts usually automate more frequent backups, such as running a backup script hourly. They also often compress backup files for easier storage and allow uploading to cloud services for extra protection.
A typical script would:
- Copy world files: Duplicate the world files to a backup directory.
- Compress the files: Use ZIP or a similar utility to reduce the size of backup files.
- Rotate the backups: Delete the oldest backups when a new backup is created to maintain a manageable size.
- Upload to a cloud drive (optional): Upload the backups to Google Drive, OneDrive, etc.
You can find these scripts with a quick search for valheim server backup script
on popular coding websites such as GitHub.
2. Dedicated Server Management Tools
Several server management tools have been created to streamline the process of setting up, maintaining and controlling your server. They often come with features such as:
- Automated backups: Often with greater customization options than the default server.
- Easy server restarts: Without needing to go through shell scripting.
- Mod integration: Allowing you to easily run mods on your server.
- Discord integration: Getting notifications when backups are taken or when the server restarts.
Example: Using a Backup Script
Here is a very basic example of a Linux bash script that would copy your world save files to a new directory:
#!/bin/bash # Configuration WORLD_NAME="MyWorld" # Replace with your world name BACKUP_DIR="/path/to/your/backup/directory" # Change this to your backup directory SAVE_DIR="/path/to/your/valheim/world/save/directory" # Location of world save files DATE=$(date +%Y-%m-%d_%H-%M-%S) # Create backup directory if it doesn't exist mkdir -p "$BACKUP_DIR" # Copy world files cp "$SAVE_DIR/$WORLD_NAME.db" "$BACKUP_DIR/${WORLD_NAME}_${DATE}.db" cp "$SAVE_DIR/$WORLD_NAME.fwl" "$BACKUP_DIR/${WORLD_NAME}_${DATE}.fwl"
In this script, it would save your world into the BACKUP_DIR
directory, with the current date as the filename.
Why Automatic Backups Matter
- Data Loss Prevention: Backups are essential for preventing data loss due to server crashes, accidental deletions, or corrupted save files.
- Peace of Mind: Knowing your progress is regularly saved provides peace of mind, so you can focus on playing without worrying about losing progress.
- Easy Restoration: Backups allow for easy restoration of your world to a previous state in case something goes wrong.
Conclusion
Safeguarding your Valheim world is crucial for a stress-free gaming experience. Using a combination of the game’s built-in backup system, tweaking its settings with server arguments, and exploring community-created solutions, you can ensure your Viking adventures are always protected. Whether you’re just starting out or have an extensive base and world, taking the time to back up your world is always worth the effort.