Greetings,
I use to manually backup save game on external HDD, but not quit often since that drives requires 120V (and being taken out of a box). In the very case where Windows OS get corrupted well... there's nothing to do. Roland even said on 8/17/2022 at 4:04 PM in this blog page: "it is a flaw in the design that makes it so that our decisions matter and can't be undone".
Also, on 8/17/2022 at 4:04 PM, Roland said:
"Its not a simple problem with a simple answer."
I must say that I disagree with that statement for the 3 reasons I suggested in my previous post. Plus, I made my very first script (which took longer for a non-programmer than if 7 Days to Die devs edited 7 Days to Die files through an update to apply one of the three options I just proposed) which shows how simple backing up a 7 Days to Die save game can be (which can help prevent losing save files, by making regular backup to a different internal drive, while waiting to backup to external drive).
I felt that backing up saved games should be an automated task; every PC user should not be forced to manually backup saved games nor to NOT have any automated backup features...". (Not a single PC user should ever have to lose his save games)!
Thus I made this script to ease backing up 7 Days to Die save games and am posting it here for 7 Days to Die players.
B
For totally new users to programming, I recommend using Windows PowerShell ISE (with admin rights) to edit the following script. Note: You might want to adjust the directories/folders below such as G:\SaveGameBackup\... and C:\Users\YourUserName\... to the one that fits the best your needs ex: D:\OtherLocation\ (and that reflects your Windows login username) and then save the script as .ps1 . Once the .ps1 is created, right click the .ps1 and select to run it with PowerShell.
Basically, just copy-paste the following text into a new "document"/script through PowerShell ISE (starting with the "E" letter of the first ECHO word until the "0" of "Exit 0" at the very bottom):
Code:
ECHO "##########################################################################"
ECHO "### Script to backup and restore 7 Days to Die save game files (v1.00) ###"
ECHO "##########################################################################"
#### Greetings, the main idea behind this script is to create a simple utility to backup 7D2D's save games files
#### to a different drive than the one where the OS is installed and that by the easiest way possible for the user.
#### This lead to a second useful function that the utility could have, such as the opposite function:
#### to "auto-restore" a desired save game backup to the game's original save game folder location.
#### The script mainly has three parts:
#### There is (1) an input section to chose from whether you want to "backup" or "restore" a save game.
#### Then, there is (2) a backup part or (3) a restore part (both options leading to closing the script).
#### It also has a few anti-failproof features.
#### Enjoy!
################################################################################
# (1) Offer the user whether he wants to backup or restore his save games
Start-Sleep -Seconds 5
$Choice = Read-Host "
Do you want to?
(1) Backup 7 Days to Die save games
(2) Restore a 7 Days to Die save game backup to the game's original save game folder location (%AppData%)
Type a number (1 or 2) then press Enter to continue
"
# (2) Proceed with backup function
if($Choice -eq 1)
{
if (-not(Test-Path -Path "G:\SaveGamesBackup\")) # First time checkup + Failproof
{
ECHO "
Creating Main Backup directory..."
mkdir G:\SaveGamesBackup\ > $null
Start-Sleep -Seconds 3
ECHO "
Successfully created G:\SaveGamesBackup\ folder!"
Start-Sleep -Seconds 4
}
if (-not(Test-Path -Path "G:\SaveGamesBackup\7DaysToDie\")) # Failproof
{
ECHO "
Creating 7 Days to Die backup folder..."
mkdir G:\SaveGamesBackup\7DaysToDie\ > $null
Start-Sleep -Seconds 4
ECHO "
Successfully created G:\SaveGamesBackup\7DaysToDie\ folder!"
Start-Sleep -Seconds 4
}
ECHO "
7 Days to Die Backup folder detected...
"
Start-Sleep -Seconds 4
ECHO "
Here's a list of previous backup folder(s) found:
"
Get-ChildItem -Path G:\SaveGamesBackup\7DaysToDie\ -name
ECHO ""
ECHO "(End of the list)."
ECHO ""
Pause
$Backupnumber = Read-Host -Prompt "
Type a new and unique name for this 7 Days to Die backup, then press Enter.
***(Only use letters, numbers and no space)." # Backup function starting here
if (Test-Path -Path "G:\SaveGamesBackup\7DaysToDie\$Backupnumber\") # Failproof
{
DO
{
ECHO "
You've entered the name of an existing folder."
Clear-Variable -name Backupnumber
Start-Sleep -Seconds 3
ECHO "
Here's a list of the backup folder(s) found:
"
Get-ChildItem -Path G:\SaveGamesBackup\7DaysToDie\ -name
ECHO ""
$Restorenumber = Read-Host "Type the EXACT name of the folder you want to restore from then press Enter"
} until (Test-Path -Path "G:\SaveGamesBackup\7DaysToDie\$Backupnumber\")
}
ECHO "
Creating new backup folder $Backupnumber for 7 Days to Die save games..." # Backup function continuing here
New-Item -Path "G:\SaveGamesBackup\7DaysToDie\" -Name "$Backupnumber" -ItemType "directory"
Start-Sleep -Seconds 5
ECHO "
Backing up 7 Days to Die save game files to $Backupnumber folder..."
Copy-Item -path "C:\Users\YourUserName\AppData\Roaming\7DaysToDie\*" -Destination "G:\SaveGamesBackup\7DaysToDie\$Backupnumber\" -Recurse
Start-Sleep -Seconds 10
ECHO "
Successfully backed up 7 Days to Die save game to external drive!"
Start-Sleep -Seconds 6
ECHO "
The Save game backup process has successfully completed."
Start-Sleep -Seconds 4
ECHO "
The backup utility will now quit... Please Wait."
Start-Sleep -Seconds 5
Clear-Variable -Name Choice
Clear-Variable -Name Backupnumber
exit 0
}
# (3) Proceed with restore function
if($Choice -eq 2)
{
if (-not(Test-Path -Path "G:\SaveGamesBackup\")) # Failproof
{
ECHO "No backup folder found. Please create a backup first then try to restore!"
ECHO "The backup utility will now quit... Please Wait."
Start-Sleep -Seconds 12
Clear-Variable -Name Choice
exit 0
}
if (-not(Test-Path -Path "G:\SaveGamesBackup\7DaysToDie\")) # Failproof
{
ECHO "No backup folder found. Please create a backup first then try to restore!"
ECHO "The backup utility will now quit... Please Wait."
Start-Sleep -Seconds 12
Clear-Variable -Name Choice
exit 0
}
ECHO "
Here's a list of the backup folder(s) found:
" # Restore function starting here
Get-ChildItem -Path G:\SaveGamesBackup\7DaysToDie\ -name
ECHO ""
ECHO ""
ECHO "(End of the list)."
ECHO ""
Pause
ECHO ""
$Restorenumber = Read-Host "Please type the exact name of the folder you want to restore the save game files from then press Enter"
if (-not(Test-Path -Path "G:\SaveGamesBackup\7DaysToDie\$Restorenumber\")) # Failproof
{
DO
{
ECHO "
You've entered an invalid folder name."
Clear-Variable -name Restorenumber
Start-Sleep -Seconds 3
ECHO "
Here's a list of the backup folder(s) found:
"
Get-ChildItem -Path G:\SaveGamesBackup\7DaysToDie\ -name
ECHO ""
$Restorenumber = Read-Host "Type the EXACT name of the folder you want to restore from then press Enter"
} until (Test-Path -Path "G:\SaveGamesBackup\7DaysToDie\$Restorenumber\")
}
ECHO "
Backup $Restorenumber successfully selected!" # Restore function continuing here
Start-Sleep -Seconds 3
ECHO "
Deleting 7 Days to Die Original save game folder located in %appdata%..."
Remove-item C:\Users\YourUserName\AppData\Roaming\7DaysToDie\ -r -fo
Start-Sleep -Seconds 6
ECHO "
Creating a new default folder located in %appdata% to hold 7 Days to Die save game files from Backup named $Restorenumber..."
mkdir C:\Users\YourUserName\AppData\Roaming\7DaysToDie\
Start-Sleep -Seconds 7
ECHO "
Restoring 7 Days to Die save game files..."
Copy-Item -path "G:\SaveGamesBackup\7DaysToDie\$Restorenumber\*" -Destination "C:\Users\YourUserName\AppData\Roaming\7DaysToDie\" -Recurse
Start-Sleep -Seconds 10
ECHO "
Sucessfully restored 7 Days to Die save games with the files from backup $Restorenumber."
Start-Sleep -Seconds 5
ECHO "
The Save game restore process has successfully completed."
Start-Sleep -Seconds 4
ECHO "
The 7 Days to Die restore utility will now quit... Please Wait."
Start-Sleep -Seconds 5
Clear-Variable -Name Choice
Clear-Variable -Name Restorenumber
exit 0
}
exit 0